GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / mach-mx25 / devices.c
blob3468eb15b2367fd1a4c197bf76d3b59af4b3372a
1 /*
2 * Copyright 2009 Sascha Hauer, <kernel@pengutronix.de>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
19 #include <linux/platform_device.h>
20 #include <linux/dma-mapping.h>
21 #include <linux/gpio.h>
22 #include <mach/mx25.h>
23 #include <mach/irqs.h>
25 static u64 otg_dmamask = DMA_BIT_MASK(32);
27 static struct resource mxc_otg_resources[] = {
29 .start = MX25_OTG_BASE_ADDR,
30 .end = MX25_OTG_BASE_ADDR + 0x1ff,
31 .flags = IORESOURCE_MEM,
32 }, {
33 .start = 37,
34 .end = 37,
35 .flags = IORESOURCE_IRQ,
39 struct platform_device mxc_otg = {
40 .name = "mxc-ehci",
41 .id = 0,
42 .dev = {
43 .coherent_dma_mask = 0xffffffff,
44 .dma_mask = &otg_dmamask,
46 .resource = mxc_otg_resources,
47 .num_resources = ARRAY_SIZE(mxc_otg_resources),
50 /* OTG gadget device */
51 struct platform_device otg_udc_device = {
52 .name = "fsl-usb2-udc",
53 .id = -1,
54 .dev = {
55 .dma_mask = &otg_dmamask,
56 .coherent_dma_mask = 0xffffffff,
58 .resource = mxc_otg_resources,
59 .num_resources = ARRAY_SIZE(mxc_otg_resources),
62 static u64 usbh2_dmamask = DMA_BIT_MASK(32);
64 static struct resource mxc_usbh2_resources[] = {
66 .start = MX25_OTG_BASE_ADDR + 0x400,
67 .end = MX25_OTG_BASE_ADDR + 0x5ff,
68 .flags = IORESOURCE_MEM,
69 }, {
70 .start = 35,
71 .end = 35,
72 .flags = IORESOURCE_IRQ,
76 struct platform_device mxc_usbh2 = {
77 .name = "mxc-ehci",
78 .id = 1,
79 .dev = {
80 .coherent_dma_mask = 0xffffffff,
81 .dma_mask = &usbh2_dmamask,
83 .resource = mxc_usbh2_resources,
84 .num_resources = ARRAY_SIZE(mxc_usbh2_resources),
87 static struct resource mxc_pwm_resources0[] = {
89 .start = 0x53fe0000,
90 .end = 0x53fe3fff,
91 .flags = IORESOURCE_MEM,
92 }, {
93 .start = 26,
94 .end = 26,
95 .flags = IORESOURCE_IRQ,
99 struct platform_device mxc_pwm_device0 = {
100 .name = "mxc_pwm",
101 .id = 0,
102 .num_resources = ARRAY_SIZE(mxc_pwm_resources0),
103 .resource = mxc_pwm_resources0,
106 static struct resource mxc_pwm_resources1[] = {
108 .start = 0x53fa0000,
109 .end = 0x53fa3fff,
110 .flags = IORESOURCE_MEM,
111 }, {
112 .start = 36,
113 .end = 36,
114 .flags = IORESOURCE_IRQ,
118 struct platform_device mxc_pwm_device1 = {
119 .name = "mxc_pwm",
120 .id = 1,
121 .num_resources = ARRAY_SIZE(mxc_pwm_resources1),
122 .resource = mxc_pwm_resources1,
125 static struct resource mxc_pwm_resources2[] = {
127 .start = 0x53fa8000,
128 .end = 0x53fabfff,
129 .flags = IORESOURCE_MEM,
130 }, {
131 .start = 41,
132 .end = 41,
133 .flags = IORESOURCE_IRQ,
137 struct platform_device mxc_pwm_device2 = {
138 .name = "mxc_pwm",
139 .id = 2,
140 .num_resources = ARRAY_SIZE(mxc_pwm_resources2),
141 .resource = mxc_pwm_resources2,
144 static struct resource mxc_keypad_resources[] = {
146 .start = 0x43fa8000,
147 .end = 0x43fabfff,
148 .flags = IORESOURCE_MEM,
149 }, {
150 .start = 24,
151 .end = 24,
152 .flags = IORESOURCE_IRQ,
156 struct platform_device mxc_keypad_device = {
157 .name = "mxc-keypad",
158 .id = -1,
159 .num_resources = ARRAY_SIZE(mxc_keypad_resources),
160 .resource = mxc_keypad_resources,
163 static struct resource mxc_pwm_resources3[] = {
165 .start = 0x53fc8000,
166 .end = 0x53fcbfff,
167 .flags = IORESOURCE_MEM,
168 }, {
169 .start = 42,
170 .end = 42,
171 .flags = IORESOURCE_IRQ,
175 struct platform_device mxc_pwm_device3 = {
176 .name = "mxc_pwm",
177 .id = 3,
178 .num_resources = ARRAY_SIZE(mxc_pwm_resources3),
179 .resource = mxc_pwm_resources3,
182 static struct mxc_gpio_port imx_gpio_ports[] = {
184 .chip.label = "gpio-0",
185 .base = (void __iomem *)MX25_GPIO1_BASE_ADDR_VIRT,
186 .irq = 52,
187 .virtual_irq_start = MXC_GPIO_IRQ_START,
188 }, {
189 .chip.label = "gpio-1",
190 .base = (void __iomem *)MX25_GPIO2_BASE_ADDR_VIRT,
191 .irq = 51,
192 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
193 }, {
194 .chip.label = "gpio-2",
195 .base = (void __iomem *)MX25_GPIO3_BASE_ADDR_VIRT,
196 .irq = 16,
197 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
198 }, {
199 .chip.label = "gpio-3",
200 .base = (void __iomem *)MX25_GPIO4_BASE_ADDR_VIRT,
201 .irq = 23,
202 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
206 int __init imx25_register_gpios(void)
208 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
211 static struct resource mx25_fec_resources[] = {
213 .start = MX25_FEC_BASE_ADDR,
214 .end = MX25_FEC_BASE_ADDR + 0xfff,
215 .flags = IORESOURCE_MEM,
218 .start = MX25_INT_FEC,
219 .end = MX25_INT_FEC,
220 .flags = IORESOURCE_IRQ,
224 struct platform_device mx25_fec_device = {
225 .name = "fec",
226 .id = 0,
227 .num_resources = ARRAY_SIZE(mx25_fec_resources),
228 .resource = mx25_fec_resources,
231 static struct resource mx25_rtc_resources[] = {
233 .start = MX25_DRYICE_BASE_ADDR,
234 .end = MX25_DRYICE_BASE_ADDR + 0x40,
235 .flags = IORESOURCE_MEM,
238 .start = MX25_INT_DRYICE,
239 .flags = IORESOURCE_IRQ
243 struct platform_device mx25_rtc_device = {
244 .name = "imxdi_rtc",
245 .id = 0,
246 .num_resources = ARRAY_SIZE(mx25_rtc_resources),
247 .resource = mx25_rtc_resources,
250 static struct resource mx25_fb_resources[] = {
252 .start = MX25_LCDC_BASE_ADDR,
253 .end = MX25_LCDC_BASE_ADDR + 0xfff,
254 .flags = IORESOURCE_MEM,
257 .start = MX25_INT_LCDC,
258 .end = MX25_INT_LCDC,
259 .flags = IORESOURCE_IRQ,
263 struct platform_device mx25_fb_device = {
264 .name = "imx-fb",
265 .id = 0,
266 .resource = mx25_fb_resources,
267 .num_resources = ARRAY_SIZE(mx25_fb_resources),
268 .dev = {
269 .coherent_dma_mask = 0xFFFFFFFF,
273 static struct resource mxc_wdt_resources[] = {
275 .start = MX25_WDOG_BASE_ADDR,
276 .end = MX25_WDOG_BASE_ADDR + SZ_16K - 1,
277 .flags = IORESOURCE_MEM,
281 struct platform_device mxc_wdt = {
282 .name = "imx2-wdt",
283 .id = 0,
284 .num_resources = ARRAY_SIZE(mxc_wdt_resources),
285 .resource = mxc_wdt_resources,
288 static struct resource mx25_kpp_resources[] = {
290 .start = MX25_KPP_BASE_ADDR,
291 .end = MX25_KPP_BASE_ADDR + 0xf,
292 .flags = IORESOURCE_MEM,
295 .start = MX25_INT_KPP,
296 .end = MX25_INT_KPP,
297 .flags = IORESOURCE_IRQ,
301 struct platform_device mx25_kpp_device = {
302 .name = "imx-keypad",
303 .id = -1,
304 .num_resources = ARRAY_SIZE(mx25_kpp_resources),
305 .resource = mx25_kpp_resources,
308 static struct resource imx_ssi_resources0[] = {
310 .start = MX25_SSI1_BASE_ADDR,
311 .end = MX25_SSI1_BASE_ADDR + 0x3fff,
312 .flags = IORESOURCE_MEM,
313 }, {
314 .start = MX25_INT_SSI1,
315 .end = MX25_INT_SSI1,
316 .flags = IORESOURCE_IRQ,
320 static struct resource imx_ssi_resources1[] = {
322 .start = MX25_SSI2_BASE_ADDR,
323 .end = MX25_SSI2_BASE_ADDR + 0x3fff,
324 .flags = IORESOURCE_MEM
325 }, {
326 .start = MX25_INT_SSI2,
327 .end = MX25_INT_SSI2,
328 .flags = IORESOURCE_IRQ,
332 struct platform_device imx_ssi_device0 = {
333 .name = "imx-ssi",
334 .id = 0,
335 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
336 .resource = imx_ssi_resources0,
339 struct platform_device imx_ssi_device1 = {
340 .name = "imx-ssi",
341 .id = 1,
342 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
343 .resource = imx_ssi_resources1,
346 static struct resource mx25_csi_resources[] = {
348 .start = MX25_CSI_BASE_ADDR,
349 .end = MX25_CSI_BASE_ADDR + 0xfff,
350 .flags = IORESOURCE_MEM,
353 .start = MX25_INT_CSI,
354 .flags = IORESOURCE_IRQ
358 struct platform_device mx25_csi_device = {
359 .name = "mx2-camera",
360 .id = 0,
361 .num_resources = ARRAY_SIZE(mx25_csi_resources),
362 .resource = mx25_csi_resources,
363 .dev = {
364 .coherent_dma_mask = 0xffffffff,