signals: use __group_complete_signal() for the specific signals too
[linux-2.6/mini2440.git] / arch / arm / mach-pxa / devices.c
blobd6c05b6eab359af09d97051bec813ccf67d8e61b
1 #include <linux/module.h>
2 #include <linux/kernel.h>
3 #include <linux/init.h>
4 #include <linux/platform_device.h>
5 #include <linux/dma-mapping.h>
7 #include <asm/arch/gpio.h>
8 #include <asm/arch/udc.h>
9 #include <asm/arch/pxafb.h>
10 #include <asm/arch/mmc.h>
11 #include <asm/arch/irda.h>
12 #include <asm/arch/i2c.h>
13 #include <asm/arch/ohci.h>
14 #include <asm/arch/pxa27x_keypad.h>
15 #include <asm/arch/camera.h>
17 #include "devices.h"
19 void __init pxa_register_device(struct platform_device *dev, void *data)
21 int ret;
23 dev->dev.platform_data = data;
25 ret = platform_device_register(dev);
26 if (ret)
27 dev_err(&dev->dev, "unable to register device: %d\n", ret);
30 static struct resource pxamci_resources[] = {
31 [0] = {
32 .start = 0x41100000,
33 .end = 0x41100fff,
34 .flags = IORESOURCE_MEM,
36 [1] = {
37 .start = IRQ_MMC,
38 .end = IRQ_MMC,
39 .flags = IORESOURCE_IRQ,
41 [2] = {
42 .start = 21,
43 .end = 21,
44 .flags = IORESOURCE_DMA,
46 [3] = {
47 .start = 22,
48 .end = 22,
49 .flags = IORESOURCE_DMA,
53 static u64 pxamci_dmamask = 0xffffffffUL;
55 struct platform_device pxa_device_mci = {
56 .name = "pxa2xx-mci",
57 .id = 0,
58 .dev = {
59 .dma_mask = &pxamci_dmamask,
60 .coherent_dma_mask = 0xffffffff,
62 .num_resources = ARRAY_SIZE(pxamci_resources),
63 .resource = pxamci_resources,
66 void __init pxa_set_mci_info(struct pxamci_platform_data *info)
68 pxa_register_device(&pxa_device_mci, info);
72 static struct pxa2xx_udc_mach_info pxa_udc_info;
74 void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
76 memcpy(&pxa_udc_info, info, sizeof *info);
79 static struct resource pxa2xx_udc_resources[] = {
80 [0] = {
81 .start = 0x40600000,
82 .end = 0x4060ffff,
83 .flags = IORESOURCE_MEM,
85 [1] = {
86 .start = IRQ_USB,
87 .end = IRQ_USB,
88 .flags = IORESOURCE_IRQ,
92 static u64 udc_dma_mask = ~(u32)0;
94 struct platform_device pxa_device_udc = {
95 .name = "pxa2xx-udc",
96 .id = -1,
97 .resource = pxa2xx_udc_resources,
98 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
99 .dev = {
100 .platform_data = &pxa_udc_info,
101 .dma_mask = &udc_dma_mask,
105 static struct resource pxafb_resources[] = {
106 [0] = {
107 .start = 0x44000000,
108 .end = 0x4400ffff,
109 .flags = IORESOURCE_MEM,
111 [1] = {
112 .start = IRQ_LCD,
113 .end = IRQ_LCD,
114 .flags = IORESOURCE_IRQ,
118 static u64 fb_dma_mask = ~(u64)0;
120 struct platform_device pxa_device_fb = {
121 .name = "pxa2xx-fb",
122 .id = -1,
123 .dev = {
124 .dma_mask = &fb_dma_mask,
125 .coherent_dma_mask = 0xffffffff,
127 .num_resources = ARRAY_SIZE(pxafb_resources),
128 .resource = pxafb_resources,
131 void __init set_pxa_fb_info(struct pxafb_mach_info *info)
133 pxa_register_device(&pxa_device_fb, info);
136 void __init set_pxa_fb_parent(struct device *parent_dev)
138 pxa_device_fb.dev.parent = parent_dev;
141 static struct resource pxa_resource_ffuart[] = {
143 .start = __PREG(FFUART),
144 .end = __PREG(FFUART) + 35,
145 .flags = IORESOURCE_MEM,
146 }, {
147 .start = IRQ_FFUART,
148 .end = IRQ_FFUART,
149 .flags = IORESOURCE_IRQ,
153 struct platform_device pxa_device_ffuart= {
154 .name = "pxa2xx-uart",
155 .id = 0,
156 .resource = pxa_resource_ffuart,
157 .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
160 static struct resource pxa_resource_btuart[] = {
162 .start = __PREG(BTUART),
163 .end = __PREG(BTUART) + 35,
164 .flags = IORESOURCE_MEM,
165 }, {
166 .start = IRQ_BTUART,
167 .end = IRQ_BTUART,
168 .flags = IORESOURCE_IRQ,
172 struct platform_device pxa_device_btuart = {
173 .name = "pxa2xx-uart",
174 .id = 1,
175 .resource = pxa_resource_btuart,
176 .num_resources = ARRAY_SIZE(pxa_resource_btuart),
179 static struct resource pxa_resource_stuart[] = {
181 .start = __PREG(STUART),
182 .end = __PREG(STUART) + 35,
183 .flags = IORESOURCE_MEM,
184 }, {
185 .start = IRQ_STUART,
186 .end = IRQ_STUART,
187 .flags = IORESOURCE_IRQ,
191 struct platform_device pxa_device_stuart = {
192 .name = "pxa2xx-uart",
193 .id = 2,
194 .resource = pxa_resource_stuart,
195 .num_resources = ARRAY_SIZE(pxa_resource_stuart),
198 static struct resource pxa_resource_hwuart[] = {
200 .start = __PREG(HWUART),
201 .end = __PREG(HWUART) + 47,
202 .flags = IORESOURCE_MEM,
203 }, {
204 .start = IRQ_HWUART,
205 .end = IRQ_HWUART,
206 .flags = IORESOURCE_IRQ,
210 struct platform_device pxa_device_hwuart = {
211 .name = "pxa2xx-uart",
212 .id = 3,
213 .resource = pxa_resource_hwuart,
214 .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
217 static struct resource pxai2c_resources[] = {
219 .start = 0x40301680,
220 .end = 0x403016a3,
221 .flags = IORESOURCE_MEM,
222 }, {
223 .start = IRQ_I2C,
224 .end = IRQ_I2C,
225 .flags = IORESOURCE_IRQ,
229 struct platform_device pxa_device_i2c = {
230 .name = "pxa2xx-i2c",
231 .id = 0,
232 .resource = pxai2c_resources,
233 .num_resources = ARRAY_SIZE(pxai2c_resources),
236 void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
238 pxa_register_device(&pxa_device_i2c, info);
241 static struct resource pxai2s_resources[] = {
243 .start = 0x40400000,
244 .end = 0x40400083,
245 .flags = IORESOURCE_MEM,
246 }, {
247 .start = IRQ_I2S,
248 .end = IRQ_I2S,
249 .flags = IORESOURCE_IRQ,
253 struct platform_device pxa_device_i2s = {
254 .name = "pxa2xx-i2s",
255 .id = -1,
256 .resource = pxai2s_resources,
257 .num_resources = ARRAY_SIZE(pxai2s_resources),
260 static u64 pxaficp_dmamask = ~(u32)0;
262 struct platform_device pxa_device_ficp = {
263 .name = "pxa2xx-ir",
264 .id = -1,
265 .dev = {
266 .dma_mask = &pxaficp_dmamask,
267 .coherent_dma_mask = 0xffffffff,
271 void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
273 pxa_register_device(&pxa_device_ficp, info);
276 struct platform_device pxa_device_rtc = {
277 .name = "sa1100-rtc",
278 .id = -1,
281 #ifdef CONFIG_PXA25x
283 static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
285 static struct resource pxa25x_resource_ssp[] = {
286 [0] = {
287 .start = 0x41000000,
288 .end = 0x4100001f,
289 .flags = IORESOURCE_MEM,
291 [1] = {
292 .start = IRQ_SSP,
293 .end = IRQ_SSP,
294 .flags = IORESOURCE_IRQ,
296 [2] = {
297 /* DRCMR for RX */
298 .start = 13,
299 .end = 13,
300 .flags = IORESOURCE_DMA,
302 [3] = {
303 /* DRCMR for TX */
304 .start = 14,
305 .end = 14,
306 .flags = IORESOURCE_DMA,
310 struct platform_device pxa25x_device_ssp = {
311 .name = "pxa25x-ssp",
312 .id = 0,
313 .dev = {
314 .dma_mask = &pxa25x_ssp_dma_mask,
315 .coherent_dma_mask = DMA_BIT_MASK(32),
317 .resource = pxa25x_resource_ssp,
318 .num_resources = ARRAY_SIZE(pxa25x_resource_ssp),
321 static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
323 static struct resource pxa25x_resource_nssp[] = {
324 [0] = {
325 .start = 0x41400000,
326 .end = 0x4140002f,
327 .flags = IORESOURCE_MEM,
329 [1] = {
330 .start = IRQ_NSSP,
331 .end = IRQ_NSSP,
332 .flags = IORESOURCE_IRQ,
334 [2] = {
335 /* DRCMR for RX */
336 .start = 15,
337 .end = 15,
338 .flags = IORESOURCE_DMA,
340 [3] = {
341 /* DRCMR for TX */
342 .start = 16,
343 .end = 16,
344 .flags = IORESOURCE_DMA,
348 struct platform_device pxa25x_device_nssp = {
349 .name = "pxa25x-nssp",
350 .id = 1,
351 .dev = {
352 .dma_mask = &pxa25x_nssp_dma_mask,
353 .coherent_dma_mask = DMA_BIT_MASK(32),
355 .resource = pxa25x_resource_nssp,
356 .num_resources = ARRAY_SIZE(pxa25x_resource_nssp),
359 static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
361 static struct resource pxa25x_resource_assp[] = {
362 [0] = {
363 .start = 0x41500000,
364 .end = 0x4150002f,
365 .flags = IORESOURCE_MEM,
367 [1] = {
368 .start = IRQ_ASSP,
369 .end = IRQ_ASSP,
370 .flags = IORESOURCE_IRQ,
372 [2] = {
373 /* DRCMR for RX */
374 .start = 23,
375 .end = 23,
376 .flags = IORESOURCE_DMA,
378 [3] = {
379 /* DRCMR for TX */
380 .start = 24,
381 .end = 24,
382 .flags = IORESOURCE_DMA,
386 struct platform_device pxa25x_device_assp = {
387 /* ASSP is basically equivalent to NSSP */
388 .name = "pxa25x-nssp",
389 .id = 2,
390 .dev = {
391 .dma_mask = &pxa25x_assp_dma_mask,
392 .coherent_dma_mask = DMA_BIT_MASK(32),
394 .resource = pxa25x_resource_assp,
395 .num_resources = ARRAY_SIZE(pxa25x_resource_assp),
397 #endif /* CONFIG_PXA25x */
399 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
401 static struct resource pxa27x_resource_keypad[] = {
402 [0] = {
403 .start = 0x41500000,
404 .end = 0x4150004c,
405 .flags = IORESOURCE_MEM,
407 [1] = {
408 .start = IRQ_KEYPAD,
409 .end = IRQ_KEYPAD,
410 .flags = IORESOURCE_IRQ,
414 struct platform_device pxa27x_device_keypad = {
415 .name = "pxa27x-keypad",
416 .id = -1,
417 .resource = pxa27x_resource_keypad,
418 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad),
421 void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
423 pxa_register_device(&pxa27x_device_keypad, info);
426 static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
428 static struct resource pxa27x_resource_ohci[] = {
429 [0] = {
430 .start = 0x4C000000,
431 .end = 0x4C00ff6f,
432 .flags = IORESOURCE_MEM,
434 [1] = {
435 .start = IRQ_USBH1,
436 .end = IRQ_USBH1,
437 .flags = IORESOURCE_IRQ,
441 struct platform_device pxa27x_device_ohci = {
442 .name = "pxa27x-ohci",
443 .id = -1,
444 .dev = {
445 .dma_mask = &pxa27x_ohci_dma_mask,
446 .coherent_dma_mask = DMA_BIT_MASK(32),
448 .num_resources = ARRAY_SIZE(pxa27x_resource_ohci),
449 .resource = pxa27x_resource_ohci,
452 void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
454 pxa_register_device(&pxa27x_device_ohci, info);
457 static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
459 static struct resource pxa27x_resource_ssp1[] = {
460 [0] = {
461 .start = 0x41000000,
462 .end = 0x4100003f,
463 .flags = IORESOURCE_MEM,
465 [1] = {
466 .start = IRQ_SSP,
467 .end = IRQ_SSP,
468 .flags = IORESOURCE_IRQ,
470 [2] = {
471 /* DRCMR for RX */
472 .start = 13,
473 .end = 13,
474 .flags = IORESOURCE_DMA,
476 [3] = {
477 /* DRCMR for TX */
478 .start = 14,
479 .end = 14,
480 .flags = IORESOURCE_DMA,
484 struct platform_device pxa27x_device_ssp1 = {
485 .name = "pxa27x-ssp",
486 .id = 0,
487 .dev = {
488 .dma_mask = &pxa27x_ssp1_dma_mask,
489 .coherent_dma_mask = DMA_BIT_MASK(32),
491 .resource = pxa27x_resource_ssp1,
492 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
495 static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
497 static struct resource pxa27x_resource_ssp2[] = {
498 [0] = {
499 .start = 0x41700000,
500 .end = 0x4170003f,
501 .flags = IORESOURCE_MEM,
503 [1] = {
504 .start = IRQ_SSP2,
505 .end = IRQ_SSP2,
506 .flags = IORESOURCE_IRQ,
508 [2] = {
509 /* DRCMR for RX */
510 .start = 15,
511 .end = 15,
512 .flags = IORESOURCE_DMA,
514 [3] = {
515 /* DRCMR for TX */
516 .start = 16,
517 .end = 16,
518 .flags = IORESOURCE_DMA,
522 struct platform_device pxa27x_device_ssp2 = {
523 .name = "pxa27x-ssp",
524 .id = 1,
525 .dev = {
526 .dma_mask = &pxa27x_ssp2_dma_mask,
527 .coherent_dma_mask = DMA_BIT_MASK(32),
529 .resource = pxa27x_resource_ssp2,
530 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
533 static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
535 static struct resource pxa27x_resource_ssp3[] = {
536 [0] = {
537 .start = 0x41900000,
538 .end = 0x4190003f,
539 .flags = IORESOURCE_MEM,
541 [1] = {
542 .start = IRQ_SSP3,
543 .end = IRQ_SSP3,
544 .flags = IORESOURCE_IRQ,
546 [2] = {
547 /* DRCMR for RX */
548 .start = 66,
549 .end = 66,
550 .flags = IORESOURCE_DMA,
552 [3] = {
553 /* DRCMR for TX */
554 .start = 67,
555 .end = 67,
556 .flags = IORESOURCE_DMA,
560 struct platform_device pxa27x_device_ssp3 = {
561 .name = "pxa27x-ssp",
562 .id = 2,
563 .dev = {
564 .dma_mask = &pxa27x_ssp3_dma_mask,
565 .coherent_dma_mask = DMA_BIT_MASK(32),
567 .resource = pxa27x_resource_ssp3,
568 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
571 static struct resource pxa27x_resource_camera[] = {
572 [0] = {
573 .start = 0x50000000,
574 .end = 0x50000fff,
575 .flags = IORESOURCE_MEM,
577 [1] = {
578 .start = IRQ_CAMERA,
579 .end = IRQ_CAMERA,
580 .flags = IORESOURCE_IRQ,
584 static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
586 static struct platform_device pxa27x_device_camera = {
587 .name = "pxa27x-camera",
588 .id = 0, /* This is used to put cameras on this interface */
589 .dev = {
590 .dma_mask = &pxa27x_dma_mask_camera,
591 .coherent_dma_mask = 0xffffffff,
593 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
594 .resource = pxa27x_resource_camera,
597 void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
599 pxa_register_device(&pxa27x_device_camera, info);
601 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
603 #ifdef CONFIG_PXA3xx
604 static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
606 static struct resource pxa3xx_resource_ssp4[] = {
607 [0] = {
608 .start = 0x41a00000,
609 .end = 0x41a0003f,
610 .flags = IORESOURCE_MEM,
612 [1] = {
613 .start = IRQ_SSP4,
614 .end = IRQ_SSP4,
615 .flags = IORESOURCE_IRQ,
617 [2] = {
618 /* DRCMR for RX */
619 .start = 2,
620 .end = 2,
621 .flags = IORESOURCE_DMA,
623 [3] = {
624 /* DRCMR for TX */
625 .start = 3,
626 .end = 3,
627 .flags = IORESOURCE_DMA,
631 struct platform_device pxa3xx_device_ssp4 = {
632 /* PXA3xx SSP is basically equivalent to PXA27x */
633 .name = "pxa27x-ssp",
634 .id = 3,
635 .dev = {
636 .dma_mask = &pxa3xx_ssp4_dma_mask,
637 .coherent_dma_mask = DMA_BIT_MASK(32),
639 .resource = pxa3xx_resource_ssp4,
640 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
643 static struct resource pxa3xx_resources_mci2[] = {
644 [0] = {
645 .start = 0x42000000,
646 .end = 0x42000fff,
647 .flags = IORESOURCE_MEM,
649 [1] = {
650 .start = IRQ_MMC2,
651 .end = IRQ_MMC2,
652 .flags = IORESOURCE_IRQ,
654 [2] = {
655 .start = 93,
656 .end = 93,
657 .flags = IORESOURCE_DMA,
659 [3] = {
660 .start = 94,
661 .end = 94,
662 .flags = IORESOURCE_DMA,
666 struct platform_device pxa3xx_device_mci2 = {
667 .name = "pxa2xx-mci",
668 .id = 1,
669 .dev = {
670 .dma_mask = &pxamci_dmamask,
671 .coherent_dma_mask = 0xffffffff,
673 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci2),
674 .resource = pxa3xx_resources_mci2,
677 void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info)
679 pxa_register_device(&pxa3xx_device_mci2, info);
682 static struct resource pxa3xx_resources_mci3[] = {
683 [0] = {
684 .start = 0x42500000,
685 .end = 0x42500fff,
686 .flags = IORESOURCE_MEM,
688 [1] = {
689 .start = IRQ_MMC3,
690 .end = IRQ_MMC3,
691 .flags = IORESOURCE_IRQ,
693 [2] = {
694 .start = 100,
695 .end = 100,
696 .flags = IORESOURCE_DMA,
698 [3] = {
699 .start = 101,
700 .end = 101,
701 .flags = IORESOURCE_DMA,
705 struct platform_device pxa3xx_device_mci3 = {
706 .name = "pxa2xx-mci",
707 .id = 2,
708 .dev = {
709 .dma_mask = &pxamci_dmamask,
710 .coherent_dma_mask = 0xffffffff,
712 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci3),
713 .resource = pxa3xx_resources_mci3,
716 void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
718 pxa_register_device(&pxa3xx_device_mci3, info);
721 #endif /* CONFIG_PXA3xx */