diff options
Diffstat (limited to 'arch/arm/mach-mx2/serial.c')
-rw-r--r-- | arch/arm/mach-mx2/serial.c | 51 |
1 files changed, 6 insertions, 45 deletions
diff --git a/arch/arm/mach-mx2/serial.c b/arch/arm/mach-mx2/serial.c index e31fd44f7941..16debc296dad 100644 --- a/arch/arm/mach-mx2/serial.c +++ b/arch/arm/mach-mx2/serial.c | |||
@@ -35,7 +35,7 @@ static struct resource uart0[] = { | |||
35 | }, | 35 | }, |
36 | }; | 36 | }; |
37 | 37 | ||
38 | static struct platform_device mxc_uart_device0 = { | 38 | struct platform_device mxc_uart_device0 = { |
39 | .name = "imx-uart", | 39 | .name = "imx-uart", |
40 | .id = 0, | 40 | .id = 0, |
41 | .resource = uart0, | 41 | .resource = uart0, |
@@ -54,7 +54,7 @@ static struct resource uart1[] = { | |||
54 | }, | 54 | }, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | static struct platform_device mxc_uart_device1 = { | 57 | struct platform_device mxc_uart_device1 = { |
58 | .name = "imx-uart", | 58 | .name = "imx-uart", |
59 | .id = 1, | 59 | .id = 1, |
60 | .resource = uart1, | 60 | .resource = uart1, |
@@ -73,7 +73,7 @@ static struct resource uart2[] = { | |||
73 | }, | 73 | }, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static struct platform_device mxc_uart_device2 = { | 76 | struct platform_device mxc_uart_device2 = { |
77 | .name = "imx-uart", | 77 | .name = "imx-uart", |
78 | .id = 2, | 78 | .id = 2, |
79 | .resource = uart2, | 79 | .resource = uart2, |
@@ -92,7 +92,7 @@ static struct resource uart3[] = { | |||
92 | }, | 92 | }, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static struct platform_device mxc_uart_device3 = { | 95 | struct platform_device mxc_uart_device3 = { |
96 | .name = "imx-uart", | 96 | .name = "imx-uart", |
97 | .id = 3, | 97 | .id = 3, |
98 | .resource = uart3, | 98 | .resource = uart3, |
@@ -111,7 +111,7 @@ static struct resource uart4[] = { | |||
111 | }, | 111 | }, |
112 | }; | 112 | }; |
113 | 113 | ||
114 | static struct platform_device mxc_uart_device4 = { | 114 | struct platform_device mxc_uart_device4 = { |
115 | .name = "imx-uart", | 115 | .name = "imx-uart", |
116 | .id = 4, | 116 | .id = 4, |
117 | .resource = uart4, | 117 | .resource = uart4, |
@@ -130,48 +130,9 @@ static struct resource uart5[] = { | |||
130 | }, | 130 | }, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static struct platform_device mxc_uart_device5 = { | 133 | struct platform_device mxc_uart_device5 = { |
134 | .name = "imx-uart", | 134 | .name = "imx-uart", |
135 | .id = 5, | 135 | .id = 5, |
136 | .resource = uart5, | 136 | .resource = uart5, |
137 | .num_resources = ARRAY_SIZE(uart5), | 137 | .num_resources = ARRAY_SIZE(uart5), |
138 | }; | 138 | }; |
139 | |||
140 | /* | ||
141 | * Register only those UARTs that physically exists | ||
142 | */ | ||
143 | int __init imx_init_uart(int uart_no, struct imxuart_platform_data *pdata) | ||
144 | { | ||
145 | switch (uart_no) { | ||
146 | case 0: | ||
147 | mxc_uart_device0.dev.platform_data = pdata; | ||
148 | platform_device_register(&mxc_uart_device0); | ||
149 | break; | ||
150 | case 1: | ||
151 | mxc_uart_device1.dev.platform_data = pdata; | ||
152 | platform_device_register(&mxc_uart_device1); | ||
153 | break; | ||
154 | #ifndef CONFIG_MXC_IRDA | ||
155 | case 2: | ||
156 | mxc_uart_device2.dev.platform_data = pdata; | ||
157 | platform_device_register(&mxc_uart_device2); | ||
158 | break; | ||
159 | #endif | ||
160 | case 3: | ||
161 | mxc_uart_device3.dev.platform_data = pdata; | ||
162 | platform_device_register(&mxc_uart_device3); | ||
163 | break; | ||
164 | case 4: | ||
165 | mxc_uart_device4.dev.platform_data = pdata; | ||
166 | platform_device_register(&mxc_uart_device4); | ||
167 | break; | ||
168 | case 5: | ||
169 | mxc_uart_device5.dev.platform_data = pdata; | ||
170 | platform_device_register(&mxc_uart_device5); | ||
171 | break; | ||
172 | default: | ||
173 | return -ENODEV; | ||
174 | } | ||
175 | |||
176 | return 0; | ||
177 | } | ||