rk29:UART->add new uart driver rk_serial.c which can be configurated in menuconfig,but the old driver is default used

This commit is contained in:
hhb
2011-06-27 17:40:18 +08:00
parent 0b3b1d8c29
commit ee1cd71135
7 changed files with 1900 additions and 29 deletions

View File

@@ -2525,16 +2525,16 @@ static void __init rk29_board_iomux_init(void)
}
static struct platform_device *devices[] __initdata = {
#ifdef CONFIG_UART1_RK29
#if defined(CONFIG_UART1_RK29) || defined(CONFIG_UART1_RK29_STANDAR)
&rk29_device_uart1,
#endif
#ifdef CONFIG_UART0_RK29
#if defined(CONFIG_UART0_RK29) || defined(CONFIG_UART0_RK29_STANDAR)
&rk29_device_uart0,
#endif
#ifdef CONFIG_UART2_RK29
#if defined(CONFIG_UART2_RK29) || defined(CONFIG_UART2_RK29_STANDAR)
&rk29_device_uart2,
#endif
#ifdef CONFIG_UART3_RK29
#if defined(CONFIG_UART3_RK29) || defined(CONFIG_UART3_RK29_STANDAR)
&rk29_device_uart3,
#endif

16
arch/arm/mach-rk29/devices.c Executable file → Normal file
View File

@@ -286,7 +286,7 @@ struct platform_device rk29_device_sdmmc1 = {
/*
* rk29 4 uarts device
*/
#ifdef CONFIG_UART0_RK29
#if defined(CONFIG_UART0_RK29) || defined(CONFIG_UART0_RK29_STANDAR)
static struct resource resources_uart0[] = {
{
.start = IRQ_UART0,
@@ -300,7 +300,7 @@ static struct resource resources_uart0[] = {
},
};
#endif
#ifdef CONFIG_UART1_RK29
#if defined(CONFIG_UART1_RK29) || defined(CONFIG_UART1_RK29_STANDAR)
static struct resource resources_uart1[] = {
{
.start = IRQ_UART1,
@@ -314,7 +314,7 @@ static struct resource resources_uart1[] = {
},
};
#endif
#ifdef CONFIG_UART2_RK29
#if defined(CONFIG_UART2_RK29) || defined(CONFIG_UART2_RK29_STANDAR)
static struct resource resources_uart2[] = {
{
.start = IRQ_UART2,
@@ -328,7 +328,7 @@ static struct resource resources_uart2[] = {
},
};
#endif
#ifdef CONFIG_UART3_RK29
#if defined(CONFIG_UART3_RK29) || defined(CONFIG_UART3_RK29_STANDAR)
static struct resource resources_uart3[] = {
{
.start = IRQ_UART3,
@@ -342,7 +342,7 @@ static struct resource resources_uart3[] = {
},
};
#endif
#ifdef CONFIG_UART0_RK29
#if defined(CONFIG_UART0_RK29) || defined(CONFIG_UART0_RK29_STANDAR)
struct platform_device rk29_device_uart0 = {
.name = "rk29_serial",
.id = 0,
@@ -350,7 +350,7 @@ struct platform_device rk29_device_uart0 = {
.resource = resources_uart0,
};
#endif
#ifdef CONFIG_UART1_RK29
#if defined(CONFIG_UART1_RK29) || defined(CONFIG_UART1_RK29_STANDAR)
struct platform_device rk29_device_uart1 = {
.name = "rk29_serial",
.id = 1,
@@ -358,7 +358,7 @@ struct platform_device rk29_device_uart1 = {
.resource = resources_uart1,
};
#endif
#ifdef CONFIG_UART2_RK29
#if defined(CONFIG_UART2_RK29) || defined(CONFIG_UART2_RK29_STANDAR)
struct platform_device rk29_device_uart2 = {
.name = "rk29_serial",
.id = 2,
@@ -366,7 +366,7 @@ struct platform_device rk29_device_uart2 = {
.resource = resources_uart2,
};
#endif
#ifdef CONFIG_UART3_RK29
#if defined(CONFIG_UART3_RK29) || defined(CONFIG_UART3_RK29_STANDAR)
struct platform_device rk29_device_uart3 = {
.name = "rk29_serial",
.id = 3,

14
arch/arm/mach-rk29/iomux.c Executable file → Normal file
View File

@@ -247,30 +247,30 @@ int rk29_iomux_init(void)
rk29_mux_set(&rk29_muxs[i]);
}
#ifdef CONFIG_UART0_RK29
#if defined(CONFIG_UART0_RK29) || defined(CONFIG_UART0_RK29_STANDAR)
rk29_mux_api_set(GPIO1B7_UART0SOUT_NAME, GPIO1L_UART0_SOUT);
rk29_mux_api_set(GPIO1B6_UART0SIN_NAME, GPIO1L_UART0_SIN);
#ifdef CONFIG_UART0_CTS_RTS_RK29
#if defined(CONFIG_UART0_CTS_RTS_RK29) || defined(CONFIG_UART0_CTS_RTS_RK29_STANDAR)
rk29_mux_api_set(GPIO1C1_UART0RTSN_SDMMC1WRITEPRT_NAME, GPIO1H_UART0_RTS_N);
rk29_mux_api_set(GPIO1C0_UART0CTSN_SDMMC1DETECTN_NAME, GPIO1H_UART0_CTS_N);
#endif
#endif
#ifdef CONFIG_UART1_RK29
#if defined(CONFIG_UART1_RK29) || defined(CONFIG_UART1_RK29_STANDAR)
rk29_mux_api_set(GPIO2A5_UART1SOUT_NAME, GPIO2L_UART1_SOUT);
rk29_mux_api_set(GPIO2A4_UART1SIN_NAME, GPIO2L_UART1_SIN);
#endif
#ifdef CONFIG_UART2_RK29
#if defined(CONFIG_UART2_RK29) || defined(CONFIG_UART2_RK29_STANDAR)
rk29_mux_api_set(GPIO2B1_UART2SOUT_NAME, GPIO2L_UART2_SOUT);
rk29_mux_api_set(GPIO2B0_UART2SIN_NAME, GPIO2L_UART2_SIN);
#ifdef CONFIG_UART2_CTS_RTS_RK29
#if defined(CONFIG_UART2_CTS_RTS_RK29) || defined(CONFIG_UART2_CTS_RTS_RK29_STANDAR)
rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_UART2_RTS_N);
rk29_mux_api_set(GPIO2A6_UART2CTSN_NAME, GPIO2L_UART2_CTS_N);
#endif
#endif
#ifdef CONFIG_UART3_RK29
#if defined(CONFIG_UART3_RK29) || defined(CONFIG_UART3_RK29_STANDAR)
rk29_mux_api_set(GPIO2B3_UART3SOUT_NAME, GPIO2L_UART3_SOUT);
rk29_mux_api_set(GPIO2B2_UART3SIN_NAME, GPIO2L_UART3_SIN);
#ifdef CONFIG_UART3_CTS_RTS_RK29
#if defined(CONFIG_UART3_CTS_RTS_RK29) || defined(CONFIG_UART3_CTS_RTS_RK29_STANDAR)
rk29_mux_api_set(GPIO2B5_UART3RTSN_I2C3SCL_NAME, GPIO2L_UART3_RTS_N);
rk29_mux_api_set(GPIO2B4_UART3CTSN_I2C3SDA_NAME, GPIO2L_UART3_CTS_N);
#endif

View File

@@ -95,7 +95,7 @@ static int i2c_read_bytes(struct i2c_client *client, u8 *buf, int len)
msgs[1].len = len-2;
msgs[1].buf = &buf[2];
msgs[1].scl_rate = GT818_I2C_SCL;
//msgs[1].udelay = client->udelay;
msgs[1].udelay = client->udelay;
ret = i2c_transfer(client->adapter, msgs, 2);
if(ret < 0)
@@ -114,7 +114,7 @@ static int i2c_write_bytes(struct i2c_client *client,u8 *data,int len)
msg.len = len;
msg.buf = data;
msg.scl_rate = GT818_I2C_SCL;
//msg.udelay = client->udelay;
msg.udelay = client->udelay;
ret = i2c_transfer(client->adapter, &msg, 1);
if(ret < 0)
printk("%s:i2c_transfer fail =%d\n",__func__, ret);
@@ -150,7 +150,6 @@ static int i2c_end_cmd(struct gt818_ts_data *ts)
static int goodix_init_panel(struct gt818_ts_data *ts)
{
int ret = -1;
// unsigned char i2c_control_buf[3] = {0x06,0x92,0x03};
#if 1
u8 config_info[] = {
@@ -192,7 +191,6 @@ static int goodix_init_panel(struct gt818_ts_data *ts)
};
#endif
// ret = i2c_write_bytes(ts->client, i2c_control_buf, (sizeof(i2c_control_buf)/sizeof(i2c_control_buf[0])));
ret = i2c_write_bytes(ts->client, config_info, (sizeof(config_info)/sizeof(config_info[0])));
if (ret < 0)
return ret;

View File

@@ -1511,7 +1511,6 @@ config SERIAL_RK29
config UART0_RK29
bool "RockChip rk29 serial port 0 support"
depends on SERIAL_RK29
config UART0_CTS_RTS_RK29
bool "RockChip rk29 serial port 0 cts rts support"
depends on UART0_RK29
@@ -1523,24 +1522,68 @@ config UART1_RK29
config UART2_RK29
bool "RockChip rk29 serial port 2 support"
depends on SERIAL_RK29
config UART2_CTS_RTS_RK29
bool "RockChip rk29 serial port 2 cts rts support"
depends on UART2_RK29
depends on UART2_RK29
config UART3_RK29
bool "RockChip rk29 serial port 3 support"
depends on SERIAL_RK29
config UART3_CTS_RTS_RK29
bool "RockChip rk29 serial port 3 cts rts support"
depends on UART3_RK29
config SERIAL_RK29_CONSOLE
bool "Rockchip rk29 serial console support"
depends on SERIAL_RK29=y
select SERIAL_CORE_CONSOLE
config SERIAL_RK29_STANDAR
bool "RockChip rk29 serial port support standar"
depends on ARM && ARCH_RK29
select SERIAL_CORE
config UART0_RK29_STANDAR
bool "RockChip rk29 serial port 0 support standar"
depends on SERIAL_RK29_STANDAR
config UART0_CTS_RTS_RK29_STANDAR
bool "RockChip rk29 serial port 0 cts rts support standar"
depends on UART0_RK29_STANDAR
config UART0_DMA_RK29
bool "RockChip rk29 serial port 0 DMA support standar"
depends on UART0_RK29_STANDAR
config UART1_RK29_STANDAR
bool "RockChip rk29 serial port 1 support standar"
depends on SERIAL_RK29_STANDAR
config UART2_RK29_STANDAR
bool "RockChip rk29 serial port 2 support standar"
depends on SERIAL_RK29_STANDAR
config UART2_CTS_RTS_RK29_STANDAR
bool "RockChip rk29 serial port 2 cts rts support standar"
depends on UART2_RK29_STANDAR
config UART2_DMA_RK29
bool "RockChip rk29 serial port 2 DMA support standar"
depends on UART2_RK29_STANDAR
config UART3_RK29_STANDAR
bool "RockChip rk29 serial port 3 support standar"
depends on SERIAL_RK29_STANDAR
config UART3_CTS_RTS_RK29_STANDAR
bool "RockChip rk29 serial port 3 cts rts support standar"
depends on UART3_RK29_STANDAR
config UART3_DMA_RK29
bool "RockChip rk29 serial port 3 DMA support standar"
depends on UART3_RK29_STANDAR
config SERIAL_RK29_CONSOLE_STANDAR
bool "Rockchip rk29 serial console support standar"
depends on SERIAL_RK29_STANDAR=y
select SERIAL_CORE_CONSOLE
config SERIAL_SC8800
tristate "SC8800 support"
depends on SPI

View File

@@ -82,5 +82,6 @@ obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
obj-$(CONFIG_SERIAL_RK2818) += rk2818_serial.o
obj-$(CONFIG_SERIAL_RK29) += rk29_serial.o
obj-$(CONFIG_SERIAL_RK29_STANDAR) += rk_serial.o
obj-$(CONFIG_SERIAL_SC8800) += sc8800.o
obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o

1829
drivers/serial/rk_serial.c Normal file

File diff suppressed because it is too large Load Diff