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/at91sam9rl_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/at91sam9rl_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 892262a71d01..dbb9a5fc2090 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -593,9 +593,6 @@ static inline void configure_ssc1_pins(unsigned pins) | |||
593 | } | 593 | } |
594 | 594 | ||
595 | /* | 595 | /* |
596 | * Return the device node so that board init code can use it as the | ||
597 | * parent for the device node reflecting how it's used on this board. | ||
598 | * | ||
599 | * SSC controllers are accessed through library code, instead of any | 596 | * SSC controllers are accessed through library code, instead of any |
600 | * kind of all-singing/all-dancing driver. For example one could be | 597 | * kind of all-singing/all-dancing driver. For example one could be |
601 | * used by a particular I2S audio codec's driver, while another one | 598 | * used by a particular I2S audio codec's driver, while another one |
@@ -856,54 +853,9 @@ static inline void configure_usart3_pins(unsigned pins) | |||
856 | at91_set_B_periph(AT91_PIN_PD3, 0); /* CTS3 */ | 853 | at91_set_B_periph(AT91_PIN_PD3, 0); /* CTS3 */ |
857 | } | 854 | } |
858 | 855 | ||
859 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 856 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
860 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 857 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
861 | 858 | ||
862 | void __init __deprecated at91_init_serial(struct at91_uart_config *config) | ||
863 | { | ||
864 | int i; | ||
865 | |||
866 | /* Fill in list of supported UARTs */ | ||
867 | for (i = 0; i < config->nr_tty; i++) { | ||
868 | switch (config->tty_map[i]) { | ||
869 | case 0: | ||
870 | configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
871 | at91_uarts[i] = &at91sam9rl_uart0_device; | ||
872 | at91_clock_associate("usart0_clk", &at91sam9rl_uart0_device.dev, "usart"); | ||
873 | break; | ||
874 | case 1: | ||
875 | configure_usart1_pins(0); | ||
876 | at91_uarts[i] = &at91sam9rl_uart1_device; | ||
877 | at91_clock_associate("usart1_clk", &at91sam9rl_uart1_device.dev, "usart"); | ||
878 | break; | ||
879 | case 2: | ||
880 | configure_usart2_pins(0); | ||
881 | at91_uarts[i] = &at91sam9rl_uart2_device; | ||
882 | at91_clock_associate("usart2_clk", &at91sam9rl_uart2_device.dev, "usart"); | ||
883 | break; | ||
884 | case 3: | ||
885 | configure_usart3_pins(0); | ||
886 | at91_uarts[i] = &at91sam9rl_uart3_device; | ||
887 | at91_clock_associate("usart3_clk", &at91sam9rl_uart3_device.dev, "usart"); | ||
888 | break; | ||
889 | case 4: | ||
890 | configure_dbgu_pins(); | ||
891 | at91_uarts[i] = &at91sam9rl_dbgu_device; | ||
892 | at91_clock_associate("mck", &at91sam9rl_dbgu_device.dev, "usart"); | ||
893 | break; | ||
894 | default: | ||
895 | continue; | ||
896 | } | ||
897 | at91_uarts[i]->id = i; /* update ID number to mapped ID */ | ||
898 | } | ||
899 | |||
900 | /* Set serial console device */ | ||
901 | if (config->console_tty < ATMEL_MAX_UART) | ||
902 | atmel_default_console_device = at91_uarts[config->console_tty]; | ||
903 | if (!atmel_default_console_device) | ||
904 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
905 | } | ||
906 | |||
907 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 859 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
908 | { | 860 | { |
909 | struct platform_device *pdev; | 861 | struct platform_device *pdev; |
@@ -947,8 +899,6 @@ void __init at91_set_serial_console(unsigned portnr) | |||
947 | { | 899 | { |
948 | if (portnr < ATMEL_MAX_UART) | 900 | if (portnr < ATMEL_MAX_UART) |
949 | atmel_default_console_device = at91_uarts[portnr]; | 901 | atmel_default_console_device = at91_uarts[portnr]; |
950 | if (!atmel_default_console_device) | ||
951 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
952 | } | 902 | } |
953 | 903 | ||
954 | void __init at91_add_device_serial(void) | 904 | void __init at91_add_device_serial(void) |
@@ -959,9 +909,11 @@ void __init at91_add_device_serial(void) | |||
959 | if (at91_uarts[i]) | 909 | if (at91_uarts[i]) |
960 | platform_device_register(at91_uarts[i]); | 910 | platform_device_register(at91_uarts[i]); |
961 | } | 911 | } |
912 | |||
913 | if (!atmel_default_console_device) | ||
914 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
962 | } | 915 | } |
963 | #else | 916 | #else |
964 | void __init __deprecated at91_init_serial(struct at91_uart_config *config) {} | ||
965 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} | 917 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} |
966 | void __init at91_set_serial_console(unsigned portnr) {} | 918 | void __init at91_set_serial_console(unsigned portnr) {} |
967 | void __init at91_add_device_serial(void) {} | 919 | void __init at91_add_device_serial(void) {} |