linux/cybook.config:

* Use new epaper driver instead of qisda fb driver

linux/arch/arm/mach-s3c2416/orizon-devs.c:
	* Rename old cyio-dev.c

linux/arch/arm/mach-s3c2416/mach-cybook_orizon.c,
linux/arch/arm/mach-s3c2416/orizon-devs.c:
	+ Add support for new drivers in platform device list

linux/drivers/video/Makefile,
linux/drivers/video/Kconfig,
linux/drivers/video/epaper/*:
	+ Add new epaper driver for tcon (resolve #9)

linux/drivers/input/misc/orizon_tilt.c:
	+ Add new driver for the tilt sensor

linux/drivers/char/s3c-adc.c:
	- Remove bloated code (this code must be audited, see ticket #8)

linux/include/cybook.h:
	* Extend the CAPABILITY Field
This commit is contained in:
mlt
2010-04-27 19:56:15 +00:00
committed by Godzil
parent f2fd2aec61
commit a55a73c5d1
14 changed files with 1358 additions and 743 deletions

View File

@@ -2289,233 +2289,6 @@ static int _dbgFL = 0;
#define INFO(s) do { printk("%s:%s(): ", __FILE__, __func__); printk s; printk("\n"); } while(0)
#endif
static int rotMode = 0;
//#define GET_COMMAND_PARAM_NUM(command) ((command >> 20) & 0x0F)
//#define GET_COMMAND_HAVE_DATA(command) ((command >> 28) & 0x01)
//#define GET_COMMAND_NEED_WAIT(command) ((command >> 29) & 0x01)
/* On the i80 port,
* i80 TCON
* -----------
* RS -> D/C
* CS0 -> CSEL
* nWE -> HWE
* OE -> HRD
*/
static inline void _InitI80Interface(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSYSIFCON0); //polarity of RS, set 1 for normal access
tmp |= (1<<2);
__raw_writel(tmp, rSYSIFCON0);
tmp = __raw_readl(rSIFCCON0); // command mode enable
tmp |= (1<<0);
__raw_writel(tmp, rSIFCCON0);
FUNC_OUT();
}
static inline void _DeinitI80Interface(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0); // command mode disable
tmp &= ~(1<<0);
__raw_writel(tmp, rSIFCCON0);
FUNC_OUT();
}
static inline void _SetWriteToData(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0);
// RS high -> D/nC set Data mode
tmp |= (1<<1);
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
static inline void _SetWriteToCommand(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0);
// RS low -> D/nC set Command mode
tmp &= ~(1<<1);
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
static inline void _EnableWrite(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0);
// nWE -> HWE enable
tmp |= (1<<6);
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
static inline void _DisableWrite(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0);
// nWE -> HWE disable
tmp &= ~(1<<6);
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
static inline void _EnableRead(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0); // nRD enable
tmp |= SYS_OE_CON;
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
static inline void _DisableRead(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0); // nRD disable
tmp &= ~SYS_OE_CON;
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
static inline void _SelectChip(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0); // Chip Select
tmp |= (1<<8);
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
static inline void _UnselectChip(void)
{
unsigned long tmp;
FUNC_IN();
tmp = __raw_readl(rSIFCCON0); // nCS0(Main) enable
tmp &= ~(1<<8);
__raw_writel(tmp, rSIFCCON0);
__uDelay(1);
FUNC_OUT();
}
int Epaper_sendCommandStart(sAUOCommand *cmd)
{
FUNC_IN();
INFOL(INFO_VERBOSE,("cmd #%08lX", cmd->cmd));
/* First: verify that the K1900 is ready */
INFOL(INFO_VERBOSE, ("/* First: verify that the K1900 is ready */"));
if (GET_COMMAND_NEED_WAIT(cmd->cmd) != 0x00)
{
INFOL(INFO_VERBOSE, ("Wait for non BUSY..."));
is_Epaper_Write_Ready();
}
if (cmd->cmd == AUOCMD_INIT_SET)
{
rotMode = ~(cmd->params[0]) & (0x1 << 10);
INFOL(INFO_VERBOSE, ("Rotation set to 0x%08X...", rotMode));
}
/* Second: init the i80 interface */
INFOL(INFO_VERBOSE, ("/* Second: init the i80 interface */"));
_InitI80Interface();
/* Third: Select the chip and set to Command mode */
INFOL(INFO_VERBOSE, ("/* Third: Select the chip and set to Command mode */"));
_SelectChip();
_SetWriteToCommand();
/* Fourth: Send command */
INFOL(INFO_VERBOSE, ("/* Fourth: Send command */"));
if (rotMode)
s3c2416_i80_write(cmd->cmd & 0xFFFF); /* This function already manage HWE, */
else
s3c2416_i80_write_Rotate(cmd->cmd & 0xFFFF); /* This function already manage HWE,
* no need to do it here. */
/* Sixth: If parameters is needed, send them */
INFOL(INFO_VERBOSE, ("/* Sixth: If parameters is needed, send them */"));
if (GET_COMMAND_PARAM_NUM(cmd->cmd) > 0)
{
int i, paramNumbers = GET_COMMAND_PARAM_NUM(cmd->cmd);
INFOL(INFO_VERBOSE, ("YES! We have %d parameters", paramNumbers));
_SetWriteToData();
for (i = 0; i < paramNumbers; i++)
{
INFOL(INFO_VERBOSE, (" parameter [%02d] = 0x%04X", i, cmd->params[i]));
if (rotMode)
s3c2416_i80_write(cmd->params[i]);
else
s3c2416_i80_write_Rotate(cmd->params[i]);
}
}
FUNC_OUT();
return 0;
}
int Epaper_sendData(unsigned short *buffer, unsigned long bufferLen)
{
/* Seventh: Send data if needed */
unsigned long i;
FUNC_IN();
//INFOL(INFO_VERBOSE, ("Bufferlen: %ld", bufferLen));
_SetWriteToData();
for (i = 0; i < bufferLen; i++)
{
if (rotMode)
s3c2416_i80_write(buffer[i]);
else
s3c2416_i80_write_Rotate(buffer[i]);
}
FUNC_OUT();
return 0;
}
int Epaper_sendCommandEnd(sAUOCommand *cmd)
{
FUNC_IN();
INFOL(INFO_VERBOSE,("cmd #%08lX START:[#%08lX]", cmd->cmd, AUOCMD_DISPLAY_START));
if (cmd->cmd == AUOCMD_DISPLAY_START)
{
_SetWriteToCommand();
INFOL(INFO_VERBOSE, ("/* Eight: Send STOP command */"));
if (rotMode)
s3c2416_i80_write(AUOCMD_DISPLAY_STOP & 0xFFFF);
else
s3c2416_i80_write_Rotate(AUOCMD_DISPLAY_STOP & 0xFFFF);
_SetWriteToData();
}
INFOL(INFO_VERBOSE, ("/* Nineth: Close all */"));
_UnselectChip();
_DeinitI80Interface();
FUNC_OUT();
return 0;
}
/* [/MTR] */