diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-04-15 16:16:38 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-17 10:55:52 -0400 |
commit | 11aadac4f6adc032cfd1e41c348a7a568819ed94 (patch) | |
tree | d9e5523c4ea62cd82f25325a1cd387d538daf26c /arch/arm/mach-at91/at91sam9260_devices.c | |
parent | 2f036ac63ebfa3fc618a1f22324ef9297c5b7d05 (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/at91sam9260_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 63 |
1 files changed, 4 insertions, 59 deletions
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 20ac09c02312..393a32aefce5 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -1051,64 +1051,9 @@ static inline void configure_usart5_pins(void) | |||
1051 | at91_set_A_periph(AT91_PIN_PB13, 0); /* RXD5 */ | 1051 | at91_set_A_periph(AT91_PIN_PB13, 0); /* RXD5 */ |
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 1054 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
1055 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 1055 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
1056 | 1056 | ||
1057 | void __init __deprecated at91_init_serial(struct at91_uart_config *config) | ||
1058 | { | ||
1059 | int i; | ||
1060 | |||
1061 | /* Fill in list of supported UARTs */ | ||
1062 | for (i = 0; i < config->nr_tty; i++) { | ||
1063 | switch (config->tty_map[i]) { | ||
1064 | case 0: | ||
1065 | configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS | ATMEL_UART_DSR | ATMEL_UART_DTR | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
1066 | at91_uarts[i] = &at91sam9260_uart0_device; | ||
1067 | at91_clock_associate("usart0_clk", &at91sam9260_uart0_device.dev, "usart"); | ||
1068 | break; | ||
1069 | case 1: | ||
1070 | configure_usart1_pins(ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
1071 | at91_uarts[i] = &at91sam9260_uart1_device; | ||
1072 | at91_clock_associate("usart1_clk", &at91sam9260_uart1_device.dev, "usart"); | ||
1073 | break; | ||
1074 | case 2: | ||
1075 | configure_usart2_pins(0); | ||
1076 | at91_uarts[i] = &at91sam9260_uart2_device; | ||
1077 | at91_clock_associate("usart2_clk", &at91sam9260_uart2_device.dev, "usart"); | ||
1078 | break; | ||
1079 | case 3: | ||
1080 | configure_usart3_pins(0); | ||
1081 | at91_uarts[i] = &at91sam9260_uart3_device; | ||
1082 | at91_clock_associate("usart3_clk", &at91sam9260_uart3_device.dev, "usart"); | ||
1083 | break; | ||
1084 | case 4: | ||
1085 | configure_usart4_pins(); | ||
1086 | at91_uarts[i] = &at91sam9260_uart4_device; | ||
1087 | at91_clock_associate("usart4_clk", &at91sam9260_uart4_device.dev, "usart"); | ||
1088 | break; | ||
1089 | case 5: | ||
1090 | configure_usart5_pins(); | ||
1091 | at91_uarts[i] = &at91sam9260_uart5_device; | ||
1092 | at91_clock_associate("usart5_clk", &at91sam9260_uart5_device.dev, "usart"); | ||
1093 | break; | ||
1094 | case 6: | ||
1095 | configure_dbgu_pins(); | ||
1096 | at91_uarts[i] = &at91sam9260_dbgu_device; | ||
1097 | at91_clock_associate("mck", &at91sam9260_dbgu_device.dev, "usart"); | ||
1098 | break; | ||
1099 | default: | ||
1100 | continue; | ||
1101 | } | ||
1102 | at91_uarts[i]->id = i; /* update ID number to mapped ID */ | ||
1103 | } | ||
1104 | |||
1105 | /* Set serial console device */ | ||
1106 | if (config->console_tty < ATMEL_MAX_UART) | ||
1107 | atmel_default_console_device = at91_uarts[config->console_tty]; | ||
1108 | if (!atmel_default_console_device) | ||
1109 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
1110 | } | ||
1111 | |||
1112 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1057 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1113 | { | 1058 | { |
1114 | struct platform_device *pdev; | 1059 | struct platform_device *pdev; |
@@ -1162,8 +1107,6 @@ void __init at91_set_serial_console(unsigned portnr) | |||
1162 | { | 1107 | { |
1163 | if (portnr < ATMEL_MAX_UART) | 1108 | if (portnr < ATMEL_MAX_UART) |
1164 | atmel_default_console_device = at91_uarts[portnr]; | 1109 | atmel_default_console_device = at91_uarts[portnr]; |
1165 | if (!atmel_default_console_device) | ||
1166 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
1167 | } | 1110 | } |
1168 | 1111 | ||
1169 | void __init at91_add_device_serial(void) | 1112 | void __init at91_add_device_serial(void) |
@@ -1174,9 +1117,11 @@ void __init at91_add_device_serial(void) | |||
1174 | if (at91_uarts[i]) | 1117 | if (at91_uarts[i]) |
1175 | platform_device_register(at91_uarts[i]); | 1118 | platform_device_register(at91_uarts[i]); |
1176 | } | 1119 | } |
1120 | |||
1121 | if (!atmel_default_console_device) | ||
1122 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
1177 | } | 1123 | } |
1178 | #else | 1124 | #else |
1179 | void __init __deprecated at91_init_serial(struct at91_uart_config *config) {} | ||
1180 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} | 1125 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} |
1181 | void __init at91_set_serial_console(unsigned portnr) {} | 1126 | void __init at91_set_serial_console(unsigned portnr) {} |
1182 | void __init at91_add_device_serial(void) {} | 1127 | void __init at91_add_device_serial(void) {} |