diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-09-09 04:19:41 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-09-09 04:19:41 -0400 |
commit | 5cf0942123bcacf8af8922eaf3fef70bce6078e6 (patch) | |
tree | dab835e2c2417e4e02071e141dd5c6776ef29e25 /arch/arm/mach-mx3/devices.c | |
parent | 282b13d066927aeba7137ce3c03d2ee69b8d4940 (diff) |
i.MX3: make SoC devices globally available
Make SoC devices globally available to boards rather than using
a device specific init function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/devices.c')
-rw-r--r-- | arch/arm/mach-mx3/devices.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index e08c6a8ac56b..a6bdcc07f3c9 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -36,7 +36,7 @@ static struct resource uart0[] = { | |||
36 | }, | 36 | }, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static struct platform_device mxc_uart_device0 = { | 39 | struct platform_device mxc_uart_device0 = { |
40 | .name = "imx-uart", | 40 | .name = "imx-uart", |
41 | .id = 0, | 41 | .id = 0, |
42 | .resource = uart0, | 42 | .resource = uart0, |
@@ -55,7 +55,7 @@ static struct resource uart1[] = { | |||
55 | }, | 55 | }, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static struct platform_device mxc_uart_device1 = { | 58 | struct platform_device mxc_uart_device1 = { |
59 | .name = "imx-uart", | 59 | .name = "imx-uart", |
60 | .id = 1, | 60 | .id = 1, |
61 | .resource = uart1, | 61 | .resource = uart1, |
@@ -74,7 +74,7 @@ static struct resource uart2[] = { | |||
74 | }, | 74 | }, |
75 | }; | 75 | }; |
76 | 76 | ||
77 | static struct platform_device mxc_uart_device2 = { | 77 | struct platform_device mxc_uart_device2 = { |
78 | .name = "imx-uart", | 78 | .name = "imx-uart", |
79 | .id = 2, | 79 | .id = 2, |
80 | .resource = uart2, | 80 | .resource = uart2, |
@@ -93,7 +93,7 @@ static struct resource uart3[] = { | |||
93 | }, | 93 | }, |
94 | }; | 94 | }; |
95 | 95 | ||
96 | static struct platform_device mxc_uart_device3 = { | 96 | struct platform_device mxc_uart_device3 = { |
97 | .name = "imx-uart", | 97 | .name = "imx-uart", |
98 | .id = 3, | 98 | .id = 3, |
99 | .resource = uart3, | 99 | .resource = uart3, |
@@ -112,46 +112,13 @@ static struct resource uart4[] = { | |||
112 | }, | 112 | }, |
113 | }; | 113 | }; |
114 | 114 | ||
115 | static struct platform_device mxc_uart_device4 = { | 115 | struct platform_device mxc_uart_device4 = { |
116 | .name = "imx-uart", | 116 | .name = "imx-uart", |
117 | .id = 4, | 117 | .id = 4, |
118 | .resource = uart4, | 118 | .resource = uart4, |
119 | .num_resources = ARRAY_SIZE(uart4), | 119 | .num_resources = ARRAY_SIZE(uart4), |
120 | }; | 120 | }; |
121 | 121 | ||
122 | /* | ||
123 | * Register only those UARTs that physically exist | ||
124 | */ | ||
125 | int __init imx_init_uart(int uart_no, struct imxuart_platform_data *pdata) | ||
126 | { | ||
127 | switch (uart_no) { | ||
128 | case 0: | ||
129 | mxc_uart_device0.dev.platform_data = pdata; | ||
130 | platform_device_register(&mxc_uart_device0); | ||
131 | break; | ||
132 | case 1: | ||
133 | mxc_uart_device1.dev.platform_data = pdata; | ||
134 | platform_device_register(&mxc_uart_device1); | ||
135 | break; | ||
136 | case 2: | ||
137 | mxc_uart_device2.dev.platform_data = pdata; | ||
138 | platform_device_register(&mxc_uart_device2); | ||
139 | break; | ||
140 | case 3: | ||
141 | mxc_uart_device3.dev.platform_data = pdata; | ||
142 | platform_device_register(&mxc_uart_device3); | ||
143 | break; | ||
144 | case 4: | ||
145 | mxc_uart_device4.dev.platform_data = pdata; | ||
146 | platform_device_register(&mxc_uart_device4); | ||
147 | break; | ||
148 | default: | ||
149 | return -ENODEV; | ||
150 | } | ||
151 | |||
152 | return 0; | ||
153 | } | ||
154 | |||
155 | /* GPIO port description */ | 122 | /* GPIO port description */ |
156 | static struct mxc_gpio_port imx_gpio_ports[] = { | 123 | static struct mxc_gpio_port imx_gpio_ports[] = { |
157 | [0] = { | 124 | [0] = { |