From 17198f2d681d34b3376f3a55b2837e56062c2439 Mon Sep 17 00:00:00 2001 From: wanzongshun Date: Wed, 4 Feb 2009 05:01:38 +0100 Subject: [ARM] 5374/1: The w90p910 uart0 driver patch Add W90P910 UART0 support,the W90P910 UART0 is 8250 series. Signed-off-by: Wan ZongShun Signed-off-by: Russell King --- arch/arm/mach-w90x900/w90p910.c | 67 ++++++++--------------------------------- 1 file changed, 13 insertions(+), 54 deletions(-) (limited to 'arch/arm/mach-w90x900/w90p910.c') diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/w90p910.c index aa783bc94310..2bcbaa681b99 100644 --- a/arch/arm/mach-w90x900/w90p910.c +++ b/arch/arm/mach-w90x900/w90p910.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -36,12 +37,6 @@ #include "cpu.h" -/*W90P910 has five uarts*/ - -#define MAX_UART_COUNT 5 -static int uart_count; -static struct platform_device *uart_devs[MAX_UART_COUNT-1]; - /* Initial IO mappings */ static struct map_desc w90p910_iodesc[] __initdata = { @@ -53,48 +48,19 @@ static struct map_desc w90p910_iodesc[] __initdata = { /*IODESC_ENT(LCD),*/ }; -/*Init the dev resource*/ - -static W90X900_RES(UART0); -static W90X900_RES(UART1); -static W90X900_RES(UART2); -static W90X900_RES(UART3); -static W90X900_RES(UART4); -static W90X900_DEVICE(uart0, UART0, 0, "w90x900-uart"); -static W90X900_DEVICE(uart1, UART1, 1, "w90x900-uart"); -static W90X900_DEVICE(uart2, UART2, 2, "w90x900-uart"); -static W90X900_DEVICE(uart3, UART3, 3, "w90x900-uart"); -static W90X900_DEVICE(uart4, UART4, 4, "w90x900-uart"); - -static struct platform_device *uart_devices[] __initdata = { - &w90x900_uart0, - &w90x900_uart1, - &w90x900_uart2, - &w90x900_uart3, - &w90x900_uart4 -}; +/* Initial serial platform data */ -/*Init W90P910 uart device*/ +struct plat_serial8250_port w90p910_uart_data[] = { + W90X900_8250PORT(UART0), +}; -void __init w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no) -{ - struct platform_device *platdev; - int uart, uartdev; - - /*By min() to judge count of uart be used indeed*/ - - uartdev = ARRAY_SIZE(uart_devices); - no = min(uartdev, no); - - for (uart = 0; uart < no; uart++, cfg++) { - if (cfg->hwport != uart) - printk(KERN_ERR "w90x900_uartcfg[%d] error\n", uart); - platdev = uart_devices[cfg->hwport]; - uart_devs[uart] = platdev; - platdev->dev.platform_data = cfg; - } - uart_count = uart; -} +struct platform_device w90p910_serial_device = { + .name = "serial8250", + .id = PLAT8250_DEV_PLATFORM, + .dev = { + .platform_data = w90p910_uart_data, + }, +}; /*Init W90P910 evb io*/ @@ -122,13 +88,6 @@ static int __init w90p910_init_cpu(void) static int __init w90x900_arch_init(void) { - int ret; - - ret = w90p910_init_cpu(); - if (ret != 0) - return ret; - - return platform_add_devices(uart_devs, uart_count); - + return w90p910_init_cpu(); } arch_initcall(w90x900_arch_init); -- cgit v1.2.3-59-g8ed1b