aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9261_devices.c
diff options
context:
space:
mode:
authorAndrew Victor <linux@maxim.org.za>2008-04-15 16:16:38 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-17 10:55:52 -0400
commit11aadac4f6adc032cfd1e41c348a7a568819ed94 (patch)
treed9e5523c4ea62cd82f25325a1cd387d538daf26c /arch/arm/mach-at91/at91sam9261_devices.c
parent2f036ac63ebfa3fc618a1f22324ef9297c5b7d05 (diff)
[ARM] 4982/1: [AT91] Drop old-style UART initialization (Part 1)
All the SAM9 boards supported by mainline and the AT91 patches have been converted to the new-style UART initialization. Therefore drop support for the old at91_init_serial() interface for SAM9. at91_uarts[] array can also be marked as __initdata. The warning that no serial-console is defined moved from at91_set_serial_console() to at91_add_device_serial() since the whole point is the board-specific file is not calling at91_set_serial_console(). Signed-off-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9261_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 03cd32482eac..37cd547855b1 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -987,49 +987,9 @@ static inline void configure_usart2_pins(unsigned pins)
987 at91_set_B_periph(AT91_PIN_PA16, 0); /* CTS2 */ 987 at91_set_B_periph(AT91_PIN_PA16, 0); /* CTS2 */
988} 988}
989 989
990static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 990static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
991struct platform_device *atmel_default_console_device; /* the serial console device */ 991struct platform_device *atmel_default_console_device; /* the serial console device */
992 992
993void __init __deprecated at91_init_serial(struct at91_uart_config *config)
994{
995 int i;
996
997 /* Fill in list of supported UARTs */
998 for (i = 0; i < config->nr_tty; i++) {
999 switch (config->tty_map[i]) {
1000 case 0:
1001 configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
1002 at91_uarts[i] = &at91sam9261_uart0_device;
1003 at91_clock_associate("usart0_clk", &at91sam9261_uart0_device.dev, "usart");
1004 break;
1005 case 1:
1006 configure_usart1_pins(0);
1007 at91_uarts[i] = &at91sam9261_uart1_device;
1008 at91_clock_associate("usart1_clk", &at91sam9261_uart1_device.dev, "usart");
1009 break;
1010 case 2:
1011 configure_usart2_pins(0);
1012 at91_uarts[i] = &at91sam9261_uart2_device;
1013 at91_clock_associate("usart2_clk", &at91sam9261_uart2_device.dev, "usart");
1014 break;
1015 case 3:
1016 configure_dbgu_pins();
1017 at91_uarts[i] = &at91sam9261_dbgu_device;
1018 at91_clock_associate("mck", &at91sam9261_dbgu_device.dev, "usart");
1019 break;
1020 default:
1021 continue;
1022 }
1023 at91_uarts[i]->id = i; /* update ID number to mapped ID */
1024 }
1025
1026 /* Set serial console device */
1027 if (config->console_tty < ATMEL_MAX_UART)
1028 atmel_default_console_device = at91_uarts[config->console_tty];
1029 if (!atmel_default_console_device)
1030 printk(KERN_INFO "AT91: No default serial console defined.\n");
1031}
1032
1033void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 993void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1034{ 994{
1035 struct platform_device *pdev; 995 struct platform_device *pdev;
@@ -1068,8 +1028,6 @@ void __init at91_set_serial_console(unsigned portnr)
1068{ 1028{
1069 if (portnr < ATMEL_MAX_UART) 1029 if (portnr < ATMEL_MAX_UART)
1070 atmel_default_console_device = at91_uarts[portnr]; 1030 atmel_default_console_device = at91_uarts[portnr];
1071 if (!atmel_default_console_device)
1072 printk(KERN_INFO "AT91: No default serial console defined.\n");
1073} 1031}
1074 1032
1075void __init at91_add_device_serial(void) 1033void __init at91_add_device_serial(void)
@@ -1080,9 +1038,11 @@ void __init at91_add_device_serial(void)
1080 if (at91_uarts[i]) 1038 if (at91_uarts[i])
1081 platform_device_register(at91_uarts[i]); 1039 platform_device_register(at91_uarts[i]);
1082 } 1040 }
1041
1042 if (!atmel_default_console_device)
1043 printk(KERN_INFO "AT91: No default serial console defined.\n");
1083} 1044}
1084#else 1045#else
1085void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
1086void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} 1046void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
1087void __init at91_set_serial_console(unsigned portnr) {} 1047void __init at91_set_serial_console(unsigned portnr) {}
1088void __init at91_add_device_serial(void) {} 1048void __init at91_add_device_serial(void) {}