1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/module.h>
3 #include <linux/kernel.h>
4 #include <linux/init.h>
5 #include <linux/platform_device.h>
6 #include <linux/clkdev.h>
7 #include <linux/clk-provider.h>
8 #include <linux/dma-mapping.h>
9 #include <linux/dmaengine.h>
10 #include <linux/spi/pxa2xx_spi.h>
11 #include <linux/platform_data/i2c-pxa.h>
14 #include <linux/platform_data/usb-pxa3xx-ulpi.h>
15 #include <linux/platform_data/video-pxafb.h>
16 #include <linux/platform_data/mmc-pxamci.h>
17 #include <linux/platform_data/irda-pxaficp.h>
18 #include <mach/irqs.h>
19 #include <linux/platform_data/usb-ohci-pxa27x.h>
20 #include <linux/platform_data/keypad-pxa27x.h>
21 #include <linux/platform_data/media/camera-pxa.h>
22 #include <mach/audio.h>
23 #include <mach/hardware.h>
24 #include <linux/platform_data/mmp_dma.h>
25 #include <linux/platform_data/mtd-nand-pxa3xx.h>
30 void __init pxa_register_device(struct platform_device *dev, void *data)
34 dev->dev.platform_data = data;
36 ret = platform_device_register(dev);
38 dev_err(&dev->dev, "unable to register device: %d\n", ret);
41 static struct resource pxa_resource_pmu = {
44 .flags = IORESOURCE_IRQ,
47 struct platform_device pxa_device_pmu = {
50 .resource = &pxa_resource_pmu,
54 static struct resource pxamci_resources[] = {
58 .flags = IORESOURCE_MEM,
63 .flags = IORESOURCE_IRQ,
67 static u64 pxamci_dmamask = 0xffffffffUL;
69 struct platform_device pxa_device_mci = {
73 .dma_mask = &pxamci_dmamask,
74 .coherent_dma_mask = 0xffffffff,
76 .num_resources = ARRAY_SIZE(pxamci_resources),
77 .resource = pxamci_resources,
80 void __init pxa_set_mci_info(struct pxamci_platform_data *info)
82 pxa_register_device(&pxa_device_mci, info);
86 static struct pxa2xx_udc_mach_info pxa_udc_info = {
90 void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
92 memcpy(&pxa_udc_info, info, sizeof *info);
95 static struct resource pxa2xx_udc_resources[] = {
99 .flags = IORESOURCE_MEM,
104 .flags = IORESOURCE_IRQ,
108 static u64 udc_dma_mask = ~(u32)0;
110 struct platform_device pxa25x_device_udc = {
111 .name = "pxa25x-udc",
113 .resource = pxa2xx_udc_resources,
114 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
116 .platform_data = &pxa_udc_info,
117 .dma_mask = &udc_dma_mask,
121 struct platform_device pxa27x_device_udc = {
122 .name = "pxa27x-udc",
124 .resource = pxa2xx_udc_resources,
125 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
127 .platform_data = &pxa_udc_info,
128 .dma_mask = &udc_dma_mask,
133 static struct resource pxa3xx_u2d_resources[] = {
137 .flags = IORESOURCE_MEM,
142 .flags = IORESOURCE_IRQ,
146 struct platform_device pxa3xx_device_u2d = {
147 .name = "pxa3xx-u2d",
149 .resource = pxa3xx_u2d_resources,
150 .num_resources = ARRAY_SIZE(pxa3xx_u2d_resources),
153 void __init pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info)
155 pxa_register_device(&pxa3xx_device_u2d, info);
157 #endif /* CONFIG_PXA3xx */
159 static struct resource pxafb_resources[] = {
163 .flags = IORESOURCE_MEM,
168 .flags = IORESOURCE_IRQ,
172 static u64 fb_dma_mask = ~(u64)0;
174 struct platform_device pxa_device_fb = {
178 .dma_mask = &fb_dma_mask,
179 .coherent_dma_mask = 0xffffffff,
181 .num_resources = ARRAY_SIZE(pxafb_resources),
182 .resource = pxafb_resources,
185 void __init pxa_set_fb_info(struct device *parent, struct pxafb_mach_info *info)
187 pxa_device_fb.dev.parent = parent;
188 pxa_register_device(&pxa_device_fb, info);
191 static struct resource pxa_resource_ffuart[] = {
195 .flags = IORESOURCE_MEM,
199 .flags = IORESOURCE_IRQ,
203 struct platform_device pxa_device_ffuart = {
204 .name = "pxa2xx-uart",
206 .resource = pxa_resource_ffuart,
207 .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
210 void __init pxa_set_ffuart_info(void *info)
212 pxa_register_device(&pxa_device_ffuart, info);
215 static struct resource pxa_resource_btuart[] = {
219 .flags = IORESOURCE_MEM,
223 .flags = IORESOURCE_IRQ,
227 struct platform_device pxa_device_btuart = {
228 .name = "pxa2xx-uart",
230 .resource = pxa_resource_btuart,
231 .num_resources = ARRAY_SIZE(pxa_resource_btuart),
234 void __init pxa_set_btuart_info(void *info)
236 pxa_register_device(&pxa_device_btuart, info);
239 static struct resource pxa_resource_stuart[] = {
243 .flags = IORESOURCE_MEM,
247 .flags = IORESOURCE_IRQ,
251 struct platform_device pxa_device_stuart = {
252 .name = "pxa2xx-uart",
254 .resource = pxa_resource_stuart,
255 .num_resources = ARRAY_SIZE(pxa_resource_stuart),
258 void __init pxa_set_stuart_info(void *info)
260 pxa_register_device(&pxa_device_stuart, info);
263 static struct resource pxa_resource_hwuart[] = {
267 .flags = IORESOURCE_MEM,
271 .flags = IORESOURCE_IRQ,
275 struct platform_device pxa_device_hwuart = {
276 .name = "pxa2xx-uart",
278 .resource = pxa_resource_hwuart,
279 .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
282 void __init pxa_set_hwuart_info(void *info)
285 pxa_register_device(&pxa_device_hwuart, info);
287 pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware");
290 static struct resource pxai2c_resources[] = {
294 .flags = IORESOURCE_MEM,
298 .flags = IORESOURCE_IRQ,
302 struct platform_device pxa_device_i2c = {
303 .name = "pxa2xx-i2c",
305 .resource = pxai2c_resources,
306 .num_resources = ARRAY_SIZE(pxai2c_resources),
309 void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
311 pxa_register_device(&pxa_device_i2c, info);
315 static struct resource pxa27x_resources_i2c_power[] = {
319 .flags = IORESOURCE_MEM,
323 .flags = IORESOURCE_IRQ,
327 struct platform_device pxa27x_device_i2c_power = {
328 .name = "pxa2xx-i2c",
330 .resource = pxa27x_resources_i2c_power,
331 .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power),
335 static struct resource pxai2s_resources[] = {
339 .flags = IORESOURCE_MEM,
343 .flags = IORESOURCE_IRQ,
347 struct platform_device pxa_device_i2s = {
348 .name = "pxa2xx-i2s",
350 .resource = pxai2s_resources,
351 .num_resources = ARRAY_SIZE(pxai2s_resources),
354 struct platform_device pxa_device_asoc_ssp1 = {
355 .name = "pxa-ssp-dai",
359 struct platform_device pxa_device_asoc_ssp2= {
360 .name = "pxa-ssp-dai",
364 struct platform_device pxa_device_asoc_ssp3 = {
365 .name = "pxa-ssp-dai",
369 struct platform_device pxa_device_asoc_ssp4 = {
370 .name = "pxa-ssp-dai",
374 struct platform_device pxa_device_asoc_platform = {
375 .name = "pxa-pcm-audio",
379 static u64 pxaficp_dmamask = ~(u32)0;
381 static struct resource pxa_ir_resources[] = {
385 .flags = IORESOURCE_IRQ,
390 .flags = IORESOURCE_IRQ,
395 .flags = IORESOURCE_MEM,
400 .flags = IORESOURCE_MEM,
404 struct platform_device pxa_device_ficp = {
407 .num_resources = ARRAY_SIZE(pxa_ir_resources),
408 .resource = pxa_ir_resources,
410 .dma_mask = &pxaficp_dmamask,
411 .coherent_dma_mask = 0xffffffff,
415 void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
417 pxa_register_device(&pxa_device_ficp, info);
420 static struct resource pxa_rtc_resources[] = {
423 .end = 0x40900000 + 0x3b,
424 .flags = IORESOURCE_MEM,
430 .flags = IORESOURCE_IRQ,
433 .start = IRQ_RTCAlrm,
436 .flags = IORESOURCE_IRQ,
440 struct platform_device pxa_device_rtc = {
443 .num_resources = ARRAY_SIZE(pxa_rtc_resources),
444 .resource = pxa_rtc_resources,
447 struct platform_device sa1100_device_rtc = {
448 .name = "sa1100-rtc",
450 .num_resources = ARRAY_SIZE(pxa_rtc_resources),
451 .resource = pxa_rtc_resources,
454 static struct resource pxa_ac97_resources[] = {
457 .end = 0x40500000 + 0xfff,
458 .flags = IORESOURCE_MEM,
463 .flags = IORESOURCE_IRQ,
467 static u64 pxa_ac97_dmamask = 0xffffffffUL;
469 struct platform_device pxa_device_ac97 = {
470 .name = "pxa2xx-ac97",
473 .dma_mask = &pxa_ac97_dmamask,
474 .coherent_dma_mask = 0xffffffff,
476 .num_resources = ARRAY_SIZE(pxa_ac97_resources),
477 .resource = pxa_ac97_resources,
480 void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops)
484 ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:0", "AC97CLK",
485 &pxa_device_ac97.dev);
487 pr_err("PXA AC97 clock1 alias error: %d\n", ret);
489 ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:1", "AC97CLK",
490 &pxa_device_ac97.dev);
492 pr_err("PXA AC97 clock2 alias error: %d\n", ret);
494 pxa_register_device(&pxa_device_ac97, ops);
499 static struct resource pxa25x_resource_pwm0[] = {
503 .flags = IORESOURCE_MEM,
507 struct platform_device pxa25x_device_pwm0 = {
508 .name = "pxa25x-pwm",
510 .resource = pxa25x_resource_pwm0,
511 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0),
514 static struct resource pxa25x_resource_pwm1[] = {
518 .flags = IORESOURCE_MEM,
522 struct platform_device pxa25x_device_pwm1 = {
523 .name = "pxa25x-pwm",
525 .resource = pxa25x_resource_pwm1,
526 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1),
529 static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
531 static struct resource pxa25x_resource_ssp[] = {
535 .flags = IORESOURCE_MEM,
540 .flags = IORESOURCE_IRQ,
544 struct platform_device pxa25x_device_ssp = {
545 .name = "pxa25x-ssp",
548 .dma_mask = &pxa25x_ssp_dma_mask,
549 .coherent_dma_mask = DMA_BIT_MASK(32),
551 .resource = pxa25x_resource_ssp,
552 .num_resources = ARRAY_SIZE(pxa25x_resource_ssp),
555 static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
557 static struct resource pxa25x_resource_nssp[] = {
561 .flags = IORESOURCE_MEM,
566 .flags = IORESOURCE_IRQ,
570 struct platform_device pxa25x_device_nssp = {
571 .name = "pxa25x-nssp",
574 .dma_mask = &pxa25x_nssp_dma_mask,
575 .coherent_dma_mask = DMA_BIT_MASK(32),
577 .resource = pxa25x_resource_nssp,
578 .num_resources = ARRAY_SIZE(pxa25x_resource_nssp),
581 static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
583 static struct resource pxa25x_resource_assp[] = {
587 .flags = IORESOURCE_MEM,
592 .flags = IORESOURCE_IRQ,
596 struct platform_device pxa25x_device_assp = {
597 /* ASSP is basically equivalent to NSSP */
598 .name = "pxa25x-nssp",
601 .dma_mask = &pxa25x_assp_dma_mask,
602 .coherent_dma_mask = DMA_BIT_MASK(32),
604 .resource = pxa25x_resource_assp,
605 .num_resources = ARRAY_SIZE(pxa25x_resource_assp),
607 #endif /* CONFIG_PXA25x */
609 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
610 static struct resource pxa27x_resource_camera[] = {
614 .flags = IORESOURCE_MEM,
619 .flags = IORESOURCE_IRQ,
623 static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
625 static struct platform_device pxa27x_device_camera = {
626 .name = "pxa27x-camera",
627 .id = 0, /* This is used to put cameras on this interface */
629 .dma_mask = &pxa27x_dma_mask_camera,
630 .coherent_dma_mask = 0xffffffff,
632 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
633 .resource = pxa27x_resource_camera,
636 void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
640 /* Register a fixed-rate clock for camera sensors. */
641 mclk = clk_register_fixed_rate(NULL, "pxa_camera_clk", NULL, 0,
642 info->mclk_10khz * 10000);
644 clkdev_create(mclk, "mclk", NULL);
645 pxa_register_device(&pxa27x_device_camera, info);
648 static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
650 static struct resource pxa27x_resource_ohci[] = {
654 .flags = IORESOURCE_MEM,
659 .flags = IORESOURCE_IRQ,
663 struct platform_device pxa27x_device_ohci = {
664 .name = "pxa27x-ohci",
667 .dma_mask = &pxa27x_ohci_dma_mask,
668 .coherent_dma_mask = DMA_BIT_MASK(32),
670 .num_resources = ARRAY_SIZE(pxa27x_resource_ohci),
671 .resource = pxa27x_resource_ohci,
674 void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
676 pxa_register_device(&pxa27x_device_ohci, info);
678 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
680 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
681 static struct resource pxa27x_resource_keypad[] = {
685 .flags = IORESOURCE_MEM,
690 .flags = IORESOURCE_IRQ,
694 struct platform_device pxa27x_device_keypad = {
695 .name = "pxa27x-keypad",
697 .resource = pxa27x_resource_keypad,
698 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad),
701 void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
703 pxa_register_device(&pxa27x_device_keypad, info);
706 static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
708 static struct resource pxa27x_resource_ssp1[] = {
712 .flags = IORESOURCE_MEM,
717 .flags = IORESOURCE_IRQ,
721 struct platform_device pxa27x_device_ssp1 = {
722 .name = "pxa27x-ssp",
725 .dma_mask = &pxa27x_ssp1_dma_mask,
726 .coherent_dma_mask = DMA_BIT_MASK(32),
728 .resource = pxa27x_resource_ssp1,
729 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
732 static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
734 static struct resource pxa27x_resource_ssp2[] = {
738 .flags = IORESOURCE_MEM,
743 .flags = IORESOURCE_IRQ,
747 struct platform_device pxa27x_device_ssp2 = {
748 .name = "pxa27x-ssp",
751 .dma_mask = &pxa27x_ssp2_dma_mask,
752 .coherent_dma_mask = DMA_BIT_MASK(32),
754 .resource = pxa27x_resource_ssp2,
755 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
758 static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
760 static struct resource pxa27x_resource_ssp3[] = {
764 .flags = IORESOURCE_MEM,
769 .flags = IORESOURCE_IRQ,
773 struct platform_device pxa27x_device_ssp3 = {
774 .name = "pxa27x-ssp",
777 .dma_mask = &pxa27x_ssp3_dma_mask,
778 .coherent_dma_mask = DMA_BIT_MASK(32),
780 .resource = pxa27x_resource_ssp3,
781 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
784 static struct resource pxa27x_resource_pwm0[] = {
788 .flags = IORESOURCE_MEM,
792 struct platform_device pxa27x_device_pwm0 = {
793 .name = "pxa27x-pwm",
795 .resource = pxa27x_resource_pwm0,
796 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0),
799 static struct resource pxa27x_resource_pwm1[] = {
803 .flags = IORESOURCE_MEM,
807 struct platform_device pxa27x_device_pwm1 = {
808 .name = "pxa27x-pwm",
810 .resource = pxa27x_resource_pwm1,
811 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1),
813 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
816 static struct resource pxa3xx_resources_mci2[] = {
820 .flags = IORESOURCE_MEM,
825 .flags = IORESOURCE_IRQ,
829 struct platform_device pxa3xx_device_mci2 = {
830 .name = "pxa2xx-mci",
833 .dma_mask = &pxamci_dmamask,
834 .coherent_dma_mask = 0xffffffff,
836 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci2),
837 .resource = pxa3xx_resources_mci2,
840 void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info)
842 pxa_register_device(&pxa3xx_device_mci2, info);
845 static struct resource pxa3xx_resources_mci3[] = {
849 .flags = IORESOURCE_MEM,
854 .flags = IORESOURCE_IRQ,
858 struct platform_device pxa3xx_device_mci3 = {
859 .name = "pxa2xx-mci",
862 .dma_mask = &pxamci_dmamask,
863 .coherent_dma_mask = 0xffffffff,
865 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci3),
866 .resource = pxa3xx_resources_mci3,
869 void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
871 pxa_register_device(&pxa3xx_device_mci3, info);
874 static struct resource pxa3xx_resources_gcu[] = {
878 .flags = IORESOURCE_MEM,
883 .flags = IORESOURCE_IRQ,
887 static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32);
889 struct platform_device pxa3xx_device_gcu = {
890 .name = "pxa3xx-gcu",
892 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu),
893 .resource = pxa3xx_resources_gcu,
895 .dma_mask = &pxa3xx_gcu_dmamask,
896 .coherent_dma_mask = 0xffffffff,
900 #endif /* CONFIG_PXA3xx */
902 #if defined(CONFIG_PXA3xx)
903 static struct resource pxa3xx_resources_i2c_power[] = {
907 .flags = IORESOURCE_MEM,
911 .flags = IORESOURCE_IRQ,
915 struct platform_device pxa3xx_device_i2c_power = {
916 .name = "pxa3xx-pwri2c",
918 .resource = pxa3xx_resources_i2c_power,
919 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power),
922 static struct resource pxa3xx_resources_nand[] = {
926 .flags = IORESOURCE_MEM,
931 .flags = IORESOURCE_IRQ,
935 static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
937 struct platform_device pxa3xx_device_nand = {
938 .name = "pxa3xx-nand",
941 .dma_mask = &pxa3xx_nand_dma_mask,
942 .coherent_dma_mask = DMA_BIT_MASK(32),
944 .num_resources = ARRAY_SIZE(pxa3xx_resources_nand),
945 .resource = pxa3xx_resources_nand,
948 void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
950 pxa_register_device(&pxa3xx_device_nand, info);
953 static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
955 static struct resource pxa3xx_resource_ssp4[] = {
959 .flags = IORESOURCE_MEM,
964 .flags = IORESOURCE_IRQ,
969 * PXA3xx SSP is basically equivalent to PXA27x.
970 * However, we need to register the device by the correct name in order to
971 * make the driver set the correct internal type, hence we provide specific
972 * platform_devices for each of them.
974 struct platform_device pxa3xx_device_ssp1 = {
975 .name = "pxa3xx-ssp",
978 .dma_mask = &pxa27x_ssp1_dma_mask,
979 .coherent_dma_mask = DMA_BIT_MASK(32),
981 .resource = pxa27x_resource_ssp1,
982 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
985 struct platform_device pxa3xx_device_ssp2 = {
986 .name = "pxa3xx-ssp",
989 .dma_mask = &pxa27x_ssp2_dma_mask,
990 .coherent_dma_mask = DMA_BIT_MASK(32),
992 .resource = pxa27x_resource_ssp2,
993 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
996 struct platform_device pxa3xx_device_ssp3 = {
997 .name = "pxa3xx-ssp",
1000 .dma_mask = &pxa27x_ssp3_dma_mask,
1001 .coherent_dma_mask = DMA_BIT_MASK(32),
1003 .resource = pxa27x_resource_ssp3,
1004 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
1007 struct platform_device pxa3xx_device_ssp4 = {
1008 .name = "pxa3xx-ssp",
1011 .dma_mask = &pxa3xx_ssp4_dma_mask,
1012 .coherent_dma_mask = DMA_BIT_MASK(32),
1014 .resource = pxa3xx_resource_ssp4,
1015 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
1017 #endif /* CONFIG_PXA3xx */
1019 struct resource pxa_resource_gpio[] = {
1021 .start = 0x40e00000,
1023 .flags = IORESOURCE_MEM,
1028 .flags = IORESOURCE_IRQ,
1033 .flags = IORESOURCE_IRQ,
1035 .start = IRQ_GPIO_2_x,
1036 .end = IRQ_GPIO_2_x,
1038 .flags = IORESOURCE_IRQ,
1042 struct platform_device pxa25x_device_gpio = {
1043 #ifdef CONFIG_CPU_PXA26x
1044 .name = "pxa26x-gpio",
1046 .name = "pxa25x-gpio",
1049 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1050 .resource = pxa_resource_gpio,
1053 struct platform_device pxa27x_device_gpio = {
1054 .name = "pxa27x-gpio",
1056 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1057 .resource = pxa_resource_gpio,
1060 struct platform_device pxa3xx_device_gpio = {
1061 .name = "pxa3xx-gpio",
1063 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1064 .resource = pxa_resource_gpio,
1067 struct platform_device pxa93x_device_gpio = {
1068 .name = "pxa93x-gpio",
1070 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1071 .resource = pxa_resource_gpio,
1074 /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
1075 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
1076 void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info)
1078 struct platform_device *pd;
1080 pd = platform_device_alloc("pxa2xx-spi", id);
1082 printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n",
1087 pd->dev.platform_data = info;
1088 platform_device_add(pd);
1091 static struct resource pxa_dma_resource[] = {
1093 .start = 0x40000000,
1095 .flags = IORESOURCE_MEM,
1100 .flags = IORESOURCE_IRQ,
1104 static u64 pxadma_dmamask = 0xffffffffUL;
1106 static struct platform_device pxa2xx_pxa_dma = {
1110 .dma_mask = &pxadma_dmamask,
1111 .coherent_dma_mask = 0xffffffff,
1113 .num_resources = ARRAY_SIZE(pxa_dma_resource),
1114 .resource = pxa_dma_resource,
1117 void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata)
1119 pxa_register_device(&pxa2xx_pxa_dma, dma_pdata);