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/at91sam9263_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/at91sam9263_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index c81842c02706..b6454c525962 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -975,9 +975,6 @@ static inline void configure_ssc1_pins(unsigned pins) | |||
975 | } | 975 | } |
976 | 976 | ||
977 | /* | 977 | /* |
978 | * Return the device node so that board init code can use it as the | ||
979 | * parent for the device node reflecting how it's used on this board. | ||
980 | * | ||
981 | * SSC controllers are accessed through library code, instead of any | 978 | * SSC controllers are accessed through library code, instead of any |
982 | * kind of all-singing/all-dancing driver. For example one could be | 979 | * kind of all-singing/all-dancing driver. For example one could be |
983 | * used by a particular I2S audio codec's driver, while another one | 980 | * used by a particular I2S audio codec's driver, while another one |
@@ -1188,49 +1185,9 @@ static inline void configure_usart2_pins(unsigned pins) | |||
1188 | at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */ | 1185 | at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */ |
1189 | } | 1186 | } |
1190 | 1187 | ||
1191 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 1188 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
1192 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 1189 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
1193 | 1190 | ||
1194 | void __init __deprecated at91_init_serial(struct at91_uart_config *config) | ||
1195 | { | ||
1196 | int i; | ||
1197 | |||
1198 | /* Fill in list of supported UARTs */ | ||
1199 | for (i = 0; i < config->nr_tty; i++) { | ||
1200 | switch (config->tty_map[i]) { | ||
1201 | case 0: | ||
1202 | configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
1203 | at91_uarts[i] = &at91sam9263_uart0_device; | ||
1204 | at91_clock_associate("usart0_clk", &at91sam9263_uart0_device.dev, "usart"); | ||
1205 | break; | ||
1206 | case 1: | ||
1207 | configure_usart1_pins(ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
1208 | at91_uarts[i] = &at91sam9263_uart1_device; | ||
1209 | at91_clock_associate("usart1_clk", &at91sam9263_uart1_device.dev, "usart"); | ||
1210 | break; | ||
1211 | case 2: | ||
1212 | configure_usart2_pins(ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
1213 | at91_uarts[i] = &at91sam9263_uart2_device; | ||
1214 | at91_clock_associate("usart2_clk", &at91sam9263_uart2_device.dev, "usart"); | ||
1215 | break; | ||
1216 | case 3: | ||
1217 | configure_dbgu_pins(); | ||
1218 | at91_uarts[i] = &at91sam9263_dbgu_device; | ||
1219 | at91_clock_associate("mck", &at91sam9263_dbgu_device.dev, "usart"); | ||
1220 | break; | ||
1221 | default: | ||
1222 | continue; | ||
1223 | } | ||
1224 | at91_uarts[i]->id = i; /* update ID number to mapped ID */ | ||
1225 | } | ||
1226 | |||
1227 | /* Set serial console device */ | ||
1228 | if (config->console_tty < ATMEL_MAX_UART) | ||
1229 | atmel_default_console_device = at91_uarts[config->console_tty]; | ||
1230 | if (!atmel_default_console_device) | ||
1231 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
1232 | } | ||
1233 | |||
1234 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1191 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1235 | { | 1192 | { |
1236 | struct platform_device *pdev; | 1193 | struct platform_device *pdev; |
@@ -1269,8 +1226,6 @@ void __init at91_set_serial_console(unsigned portnr) | |||
1269 | { | 1226 | { |
1270 | if (portnr < ATMEL_MAX_UART) | 1227 | if (portnr < ATMEL_MAX_UART) |
1271 | atmel_default_console_device = at91_uarts[portnr]; | 1228 | atmel_default_console_device = at91_uarts[portnr]; |
1272 | if (!atmel_default_console_device) | ||
1273 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
1274 | } | 1229 | } |
1275 | 1230 | ||
1276 | void __init at91_add_device_serial(void) | 1231 | void __init at91_add_device_serial(void) |
@@ -1281,9 +1236,11 @@ void __init at91_add_device_serial(void) | |||
1281 | if (at91_uarts[i]) | 1236 | if (at91_uarts[i]) |
1282 | platform_device_register(at91_uarts[i]); | 1237 | platform_device_register(at91_uarts[i]); |
1283 | } | 1238 | } |
1239 | |||
1240 | if (!atmel_default_console_device) | ||
1241 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
1284 | } | 1242 | } |
1285 | #else | 1243 | #else |
1286 | void __init at91_init_serial(struct at91_uart_config *config) {} | ||
1287 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} | 1244 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} |
1288 | void __init at91_set_serial_console(unsigned portnr) {} | 1245 | void __init at91_set_serial_console(unsigned portnr) {} |
1289 | void __init at91_add_device_serial(void) {} | 1246 | void __init at91_add_device_serial(void) {} |