diff options
author | Valentin Longchamp <valentin.longchamp@epfl.ch> | 2009-01-28 09:13:51 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-03-13 05:34:01 -0400 |
commit | bfbc6a1fc1d4d4ecbf73bcb7eefcd2a2ca5ddf2a (patch) | |
tree | 75cbc2ed75da08bab0f6f70ac1451ad440aabd85 /arch | |
parent | b7222631c3d0fd26e6d85dd78b1d0aa10dc64929 (diff) |
mx31moboard: use of new iomux implementation
This example takes advantage of the possibility to use tables of iomux
configs.
This is inspired from mx1-mx2 iomux code. It allows a better code
readability.
Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c index 3d2773e4bc81..f29c8782cffb 100644 --- a/arch/arm/mach-mx3/mx31moboard.c +++ b/arch/arm/mach-mx3/mx31moboard.c | |||
@@ -63,6 +63,25 @@ static struct platform_device *devices[] __initdata = { | |||
63 | &mx31moboard_flash, | 63 | &mx31moboard_flash, |
64 | }; | 64 | }; |
65 | 65 | ||
66 | static int mxc_uart0_pins[] = { | ||
67 | MX31_PIN_CTS1__CTS1, | ||
68 | MX31_PIN_RTS1__RTS1, | ||
69 | MX31_PIN_TXD1__TXD1, | ||
70 | MX31_PIN_RXD1__RXD1 | ||
71 | }; | ||
72 | static int mxc_uart1_pins[] = { | ||
73 | MX31_PIN_CTS2__CTS2, | ||
74 | MX31_PIN_RTS2__RTS2, | ||
75 | MX31_PIN_TXD2__TXD2, | ||
76 | MX31_PIN_RXD2__RXD2 | ||
77 | }; | ||
78 | static int mxc_uart4_pins[] = { | ||
79 | MX31_PIN_PC_RST__CTS5, | ||
80 | MX31_PIN_PC_VS2__RTS5, | ||
81 | MX31_PIN_PC_BVD2__TXD5, | ||
82 | MX31_PIN_PC_BVD1__RXD5 | ||
83 | }; | ||
84 | |||
66 | /* | 85 | /* |
67 | * Board specific initialization. | 86 | * Board specific initialization. |
68 | */ | 87 | */ |
@@ -70,25 +89,13 @@ static void __init mxc_board_init(void) | |||
70 | { | 89 | { |
71 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 90 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
72 | 91 | ||
73 | mxc_iomux_mode(MX31_PIN_CTS1__CTS1); | 92 | mxc_iomux_setup_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins), "uart0"); |
74 | mxc_iomux_mode(MX31_PIN_RTS1__RTS1); | ||
75 | mxc_iomux_mode(MX31_PIN_TXD1__TXD1); | ||
76 | mxc_iomux_mode(MX31_PIN_RXD1__RXD1); | ||
77 | |||
78 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 93 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
79 | 94 | ||
80 | mxc_iomux_mode(MX31_PIN_CTS2__CTS2); | 95 | mxc_iomux_setup_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins), "uart1"); |
81 | mxc_iomux_mode(MX31_PIN_RTS2__RTS2); | ||
82 | mxc_iomux_mode(MX31_PIN_TXD2__TXD2); | ||
83 | mxc_iomux_mode(MX31_PIN_RXD2__RXD2); | ||
84 | |||
85 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 96 | mxc_register_device(&mxc_uart_device1, &uart_pdata); |
86 | 97 | ||
87 | mxc_iomux_mode(MX31_PIN_PC_RST__CTS5); | 98 | mxc_iomux_setup_multiple_pins(mxc_uart4_pins, ARRAY_SIZE(mxc_uart4_pins), "uart4"); |
88 | mxc_iomux_mode(MX31_PIN_PC_VS2__RTS5); | ||
89 | mxc_iomux_mode(MX31_PIN_PC_BVD2__TXD5); | ||
90 | mxc_iomux_mode(MX31_PIN_PC_BVD1__RXD5); | ||
91 | |||
92 | mxc_register_device(&mxc_uart_device4, &uart_pdata); | 99 | mxc_register_device(&mxc_uart_device4, &uart_pdata); |
93 | } | 100 | } |
94 | 101 | ||