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/dma-mapping.h>
7 #include <linux/spi/pxa2xx_spi.h>
8 #include <linux/platform_data/i2c-pxa.h>
11 #include <linux/platform_data/usb-pxa3xx-ulpi.h>
12 #include <linux/platform_data/video-pxafb.h>
13 #include <linux/platform_data/mmc-pxamci.h>
14 #include <linux/platform_data/irda-pxaficp.h>
15 #include <mach/irqs.h>
16 #include <linux/platform_data/usb-ohci-pxa27x.h>
17 #include <linux/platform_data/keypad-pxa27x.h>
18 #include <linux/platform_data/media/camera-pxa.h>
19 #include <mach/audio.h>
20 #include <mach/hardware.h>
21 #include <linux/platform_data/mmp_dma.h>
22 #include <linux/platform_data/mtd-nand-pxa3xx.h>
27 void __init pxa_register_device(struct platform_device *dev, void *data)
31 dev->dev.platform_data = data;
33 ret = platform_device_register(dev);
35 dev_err(&dev->dev, "unable to register device: %d\n", ret);
38 static struct resource pxa_resource_pmu = {
41 .flags = IORESOURCE_IRQ,
44 struct platform_device pxa_device_pmu = {
47 .resource = &pxa_resource_pmu,
51 static struct resource pxamci_resources[] = {
55 .flags = IORESOURCE_MEM,
60 .flags = IORESOURCE_IRQ,
65 .flags = IORESOURCE_DMA,
70 .flags = IORESOURCE_DMA,
74 static u64 pxamci_dmamask = 0xffffffffUL;
76 struct platform_device pxa_device_mci = {
80 .dma_mask = &pxamci_dmamask,
81 .coherent_dma_mask = 0xffffffff,
83 .num_resources = ARRAY_SIZE(pxamci_resources),
84 .resource = pxamci_resources,
87 void __init pxa_set_mci_info(struct pxamci_platform_data *info)
89 pxa_register_device(&pxa_device_mci, info);
93 static struct pxa2xx_udc_mach_info pxa_udc_info = {
97 void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
99 memcpy(&pxa_udc_info, info, sizeof *info);
102 static struct resource pxa2xx_udc_resources[] = {
106 .flags = IORESOURCE_MEM,
111 .flags = IORESOURCE_IRQ,
115 static u64 udc_dma_mask = ~(u32)0;
117 struct platform_device pxa25x_device_udc = {
118 .name = "pxa25x-udc",
120 .resource = pxa2xx_udc_resources,
121 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
123 .platform_data = &pxa_udc_info,
124 .dma_mask = &udc_dma_mask,
128 struct platform_device pxa27x_device_udc = {
129 .name = "pxa27x-udc",
131 .resource = pxa2xx_udc_resources,
132 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
134 .platform_data = &pxa_udc_info,
135 .dma_mask = &udc_dma_mask,
140 static struct resource pxa3xx_u2d_resources[] = {
144 .flags = IORESOURCE_MEM,
149 .flags = IORESOURCE_IRQ,
153 struct platform_device pxa3xx_device_u2d = {
154 .name = "pxa3xx-u2d",
156 .resource = pxa3xx_u2d_resources,
157 .num_resources = ARRAY_SIZE(pxa3xx_u2d_resources),
160 void __init pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info)
162 pxa_register_device(&pxa3xx_device_u2d, info);
164 #endif /* CONFIG_PXA3xx */
166 static struct resource pxafb_resources[] = {
170 .flags = IORESOURCE_MEM,
175 .flags = IORESOURCE_IRQ,
179 static u64 fb_dma_mask = ~(u64)0;
181 struct platform_device pxa_device_fb = {
185 .dma_mask = &fb_dma_mask,
186 .coherent_dma_mask = 0xffffffff,
188 .num_resources = ARRAY_SIZE(pxafb_resources),
189 .resource = pxafb_resources,
192 void __init pxa_set_fb_info(struct device *parent, struct pxafb_mach_info *info)
194 pxa_device_fb.dev.parent = parent;
195 pxa_register_device(&pxa_device_fb, info);
198 static struct resource pxa_resource_ffuart[] = {
202 .flags = IORESOURCE_MEM,
206 .flags = IORESOURCE_IRQ,
210 struct platform_device pxa_device_ffuart = {
211 .name = "pxa2xx-uart",
213 .resource = pxa_resource_ffuart,
214 .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
217 void __init pxa_set_ffuart_info(void *info)
219 pxa_register_device(&pxa_device_ffuart, info);
222 static struct resource pxa_resource_btuart[] = {
226 .flags = IORESOURCE_MEM,
230 .flags = IORESOURCE_IRQ,
234 struct platform_device pxa_device_btuart = {
235 .name = "pxa2xx-uart",
237 .resource = pxa_resource_btuart,
238 .num_resources = ARRAY_SIZE(pxa_resource_btuart),
241 void __init pxa_set_btuart_info(void *info)
243 pxa_register_device(&pxa_device_btuart, info);
246 static struct resource pxa_resource_stuart[] = {
250 .flags = IORESOURCE_MEM,
254 .flags = IORESOURCE_IRQ,
258 struct platform_device pxa_device_stuart = {
259 .name = "pxa2xx-uart",
261 .resource = pxa_resource_stuart,
262 .num_resources = ARRAY_SIZE(pxa_resource_stuart),
265 void __init pxa_set_stuart_info(void *info)
267 pxa_register_device(&pxa_device_stuart, info);
270 static struct resource pxa_resource_hwuart[] = {
274 .flags = IORESOURCE_MEM,
278 .flags = IORESOURCE_IRQ,
282 struct platform_device pxa_device_hwuart = {
283 .name = "pxa2xx-uart",
285 .resource = pxa_resource_hwuart,
286 .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
289 void __init pxa_set_hwuart_info(void *info)
292 pxa_register_device(&pxa_device_hwuart, info);
294 pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware");
297 static struct resource pxai2c_resources[] = {
301 .flags = IORESOURCE_MEM,
305 .flags = IORESOURCE_IRQ,
309 struct platform_device pxa_device_i2c = {
310 .name = "pxa2xx-i2c",
312 .resource = pxai2c_resources,
313 .num_resources = ARRAY_SIZE(pxai2c_resources),
316 void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
318 pxa_register_device(&pxa_device_i2c, info);
322 static struct resource pxa27x_resources_i2c_power[] = {
326 .flags = IORESOURCE_MEM,
330 .flags = IORESOURCE_IRQ,
334 struct platform_device pxa27x_device_i2c_power = {
335 .name = "pxa2xx-i2c",
337 .resource = pxa27x_resources_i2c_power,
338 .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power),
342 static struct resource pxai2s_resources[] = {
346 .flags = IORESOURCE_MEM,
350 .flags = IORESOURCE_IRQ,
354 struct platform_device pxa_device_i2s = {
355 .name = "pxa2xx-i2s",
357 .resource = pxai2s_resources,
358 .num_resources = ARRAY_SIZE(pxai2s_resources),
361 struct platform_device pxa_device_asoc_ssp1 = {
362 .name = "pxa-ssp-dai",
366 struct platform_device pxa_device_asoc_ssp2= {
367 .name = "pxa-ssp-dai",
371 struct platform_device pxa_device_asoc_ssp3 = {
372 .name = "pxa-ssp-dai",
376 struct platform_device pxa_device_asoc_ssp4 = {
377 .name = "pxa-ssp-dai",
381 struct platform_device pxa_device_asoc_platform = {
382 .name = "pxa-pcm-audio",
386 static u64 pxaficp_dmamask = ~(u32)0;
388 static struct resource pxa_ir_resources[] = {
392 .flags = IORESOURCE_IRQ,
397 .flags = IORESOURCE_IRQ,
402 .flags = IORESOURCE_MEM,
407 .flags = IORESOURCE_MEM,
412 .flags = IORESOURCE_DMA,
417 .flags = IORESOURCE_DMA,
421 struct platform_device pxa_device_ficp = {
424 .num_resources = ARRAY_SIZE(pxa_ir_resources),
425 .resource = pxa_ir_resources,
427 .dma_mask = &pxaficp_dmamask,
428 .coherent_dma_mask = 0xffffffff,
432 void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
434 pxa_register_device(&pxa_device_ficp, info);
437 static struct resource pxa_rtc_resources[] = {
440 .end = 0x40900000 + 0x3b,
441 .flags = IORESOURCE_MEM,
447 .flags = IORESOURCE_IRQ,
450 .start = IRQ_RTCAlrm,
453 .flags = IORESOURCE_IRQ,
457 struct platform_device pxa_device_rtc = {
460 .num_resources = ARRAY_SIZE(pxa_rtc_resources),
461 .resource = pxa_rtc_resources,
464 struct platform_device sa1100_device_rtc = {
465 .name = "sa1100-rtc",
467 .num_resources = ARRAY_SIZE(pxa_rtc_resources),
468 .resource = pxa_rtc_resources,
471 static struct resource pxa_ac97_resources[] = {
474 .end = 0x40500000 + 0xfff,
475 .flags = IORESOURCE_MEM,
480 .flags = IORESOURCE_IRQ,
484 static u64 pxa_ac97_dmamask = 0xffffffffUL;
486 struct platform_device pxa_device_ac97 = {
487 .name = "pxa2xx-ac97",
490 .dma_mask = &pxa_ac97_dmamask,
491 .coherent_dma_mask = 0xffffffff,
493 .num_resources = ARRAY_SIZE(pxa_ac97_resources),
494 .resource = pxa_ac97_resources,
497 void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops)
499 pxa_register_device(&pxa_device_ac97, ops);
504 static struct resource pxa25x_resource_pwm0[] = {
508 .flags = IORESOURCE_MEM,
512 struct platform_device pxa25x_device_pwm0 = {
513 .name = "pxa25x-pwm",
515 .resource = pxa25x_resource_pwm0,
516 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0),
519 static struct resource pxa25x_resource_pwm1[] = {
523 .flags = IORESOURCE_MEM,
527 struct platform_device pxa25x_device_pwm1 = {
528 .name = "pxa25x-pwm",
530 .resource = pxa25x_resource_pwm1,
531 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1),
534 static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
536 static struct resource pxa25x_resource_ssp[] = {
540 .flags = IORESOURCE_MEM,
545 .flags = IORESOURCE_IRQ,
551 .flags = IORESOURCE_DMA,
557 .flags = IORESOURCE_DMA,
561 struct platform_device pxa25x_device_ssp = {
562 .name = "pxa25x-ssp",
565 .dma_mask = &pxa25x_ssp_dma_mask,
566 .coherent_dma_mask = DMA_BIT_MASK(32),
568 .resource = pxa25x_resource_ssp,
569 .num_resources = ARRAY_SIZE(pxa25x_resource_ssp),
572 static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
574 static struct resource pxa25x_resource_nssp[] = {
578 .flags = IORESOURCE_MEM,
583 .flags = IORESOURCE_IRQ,
589 .flags = IORESOURCE_DMA,
595 .flags = IORESOURCE_DMA,
599 struct platform_device pxa25x_device_nssp = {
600 .name = "pxa25x-nssp",
603 .dma_mask = &pxa25x_nssp_dma_mask,
604 .coherent_dma_mask = DMA_BIT_MASK(32),
606 .resource = pxa25x_resource_nssp,
607 .num_resources = ARRAY_SIZE(pxa25x_resource_nssp),
610 static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
612 static struct resource pxa25x_resource_assp[] = {
616 .flags = IORESOURCE_MEM,
621 .flags = IORESOURCE_IRQ,
627 .flags = IORESOURCE_DMA,
633 .flags = IORESOURCE_DMA,
637 struct platform_device pxa25x_device_assp = {
638 /* ASSP is basically equivalent to NSSP */
639 .name = "pxa25x-nssp",
642 .dma_mask = &pxa25x_assp_dma_mask,
643 .coherent_dma_mask = DMA_BIT_MASK(32),
645 .resource = pxa25x_resource_assp,
646 .num_resources = ARRAY_SIZE(pxa25x_resource_assp),
648 #endif /* CONFIG_PXA25x */
650 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
651 static struct resource pxa27x_resource_camera[] = {
655 .flags = IORESOURCE_MEM,
660 .flags = IORESOURCE_IRQ,
664 static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
666 static struct platform_device pxa27x_device_camera = {
667 .name = "pxa27x-camera",
668 .id = 0, /* This is used to put cameras on this interface */
670 .dma_mask = &pxa27x_dma_mask_camera,
671 .coherent_dma_mask = 0xffffffff,
673 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
674 .resource = pxa27x_resource_camera,
677 void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
679 pxa_register_device(&pxa27x_device_camera, info);
682 static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
684 static struct resource pxa27x_resource_ohci[] = {
688 .flags = IORESOURCE_MEM,
693 .flags = IORESOURCE_IRQ,
697 struct platform_device pxa27x_device_ohci = {
698 .name = "pxa27x-ohci",
701 .dma_mask = &pxa27x_ohci_dma_mask,
702 .coherent_dma_mask = DMA_BIT_MASK(32),
704 .num_resources = ARRAY_SIZE(pxa27x_resource_ohci),
705 .resource = pxa27x_resource_ohci,
708 void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
710 pxa_register_device(&pxa27x_device_ohci, info);
712 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
714 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
715 static struct resource pxa27x_resource_keypad[] = {
719 .flags = IORESOURCE_MEM,
724 .flags = IORESOURCE_IRQ,
728 struct platform_device pxa27x_device_keypad = {
729 .name = "pxa27x-keypad",
731 .resource = pxa27x_resource_keypad,
732 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad),
735 void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
737 pxa_register_device(&pxa27x_device_keypad, info);
740 static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
742 static struct resource pxa27x_resource_ssp1[] = {
746 .flags = IORESOURCE_MEM,
751 .flags = IORESOURCE_IRQ,
757 .flags = IORESOURCE_DMA,
763 .flags = IORESOURCE_DMA,
767 struct platform_device pxa27x_device_ssp1 = {
768 .name = "pxa27x-ssp",
771 .dma_mask = &pxa27x_ssp1_dma_mask,
772 .coherent_dma_mask = DMA_BIT_MASK(32),
774 .resource = pxa27x_resource_ssp1,
775 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
778 static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
780 static struct resource pxa27x_resource_ssp2[] = {
784 .flags = IORESOURCE_MEM,
789 .flags = IORESOURCE_IRQ,
795 .flags = IORESOURCE_DMA,
801 .flags = IORESOURCE_DMA,
805 struct platform_device pxa27x_device_ssp2 = {
806 .name = "pxa27x-ssp",
809 .dma_mask = &pxa27x_ssp2_dma_mask,
810 .coherent_dma_mask = DMA_BIT_MASK(32),
812 .resource = pxa27x_resource_ssp2,
813 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
816 static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
818 static struct resource pxa27x_resource_ssp3[] = {
822 .flags = IORESOURCE_MEM,
827 .flags = IORESOURCE_IRQ,
833 .flags = IORESOURCE_DMA,
839 .flags = IORESOURCE_DMA,
843 struct platform_device pxa27x_device_ssp3 = {
844 .name = "pxa27x-ssp",
847 .dma_mask = &pxa27x_ssp3_dma_mask,
848 .coherent_dma_mask = DMA_BIT_MASK(32),
850 .resource = pxa27x_resource_ssp3,
851 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
854 static struct resource pxa27x_resource_pwm0[] = {
858 .flags = IORESOURCE_MEM,
862 struct platform_device pxa27x_device_pwm0 = {
863 .name = "pxa27x-pwm",
865 .resource = pxa27x_resource_pwm0,
866 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0),
869 static struct resource pxa27x_resource_pwm1[] = {
873 .flags = IORESOURCE_MEM,
877 struct platform_device pxa27x_device_pwm1 = {
878 .name = "pxa27x-pwm",
880 .resource = pxa27x_resource_pwm1,
881 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1),
883 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
886 static struct resource pxa3xx_resources_mci2[] = {
890 .flags = IORESOURCE_MEM,
895 .flags = IORESOURCE_IRQ,
900 .flags = IORESOURCE_DMA,
905 .flags = IORESOURCE_DMA,
909 struct platform_device pxa3xx_device_mci2 = {
910 .name = "pxa2xx-mci",
913 .dma_mask = &pxamci_dmamask,
914 .coherent_dma_mask = 0xffffffff,
916 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci2),
917 .resource = pxa3xx_resources_mci2,
920 void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info)
922 pxa_register_device(&pxa3xx_device_mci2, info);
925 static struct resource pxa3xx_resources_mci3[] = {
929 .flags = IORESOURCE_MEM,
934 .flags = IORESOURCE_IRQ,
939 .flags = IORESOURCE_DMA,
944 .flags = IORESOURCE_DMA,
948 struct platform_device pxa3xx_device_mci3 = {
949 .name = "pxa2xx-mci",
952 .dma_mask = &pxamci_dmamask,
953 .coherent_dma_mask = 0xffffffff,
955 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci3),
956 .resource = pxa3xx_resources_mci3,
959 void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
961 pxa_register_device(&pxa3xx_device_mci3, info);
964 static struct resource pxa3xx_resources_gcu[] = {
968 .flags = IORESOURCE_MEM,
973 .flags = IORESOURCE_IRQ,
977 static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32);
979 struct platform_device pxa3xx_device_gcu = {
980 .name = "pxa3xx-gcu",
982 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu),
983 .resource = pxa3xx_resources_gcu,
985 .dma_mask = &pxa3xx_gcu_dmamask,
986 .coherent_dma_mask = 0xffffffff,
990 #endif /* CONFIG_PXA3xx */
992 #if defined(CONFIG_PXA3xx)
993 static struct resource pxa3xx_resources_i2c_power[] = {
997 .flags = IORESOURCE_MEM,
1001 .flags = IORESOURCE_IRQ,
1005 struct platform_device pxa3xx_device_i2c_power = {
1006 .name = "pxa3xx-pwri2c",
1008 .resource = pxa3xx_resources_i2c_power,
1009 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power),
1012 static struct resource pxa3xx_resources_nand[] = {
1014 .start = 0x43100000,
1016 .flags = IORESOURCE_MEM,
1021 .flags = IORESOURCE_IRQ,
1024 /* DRCMR for Data DMA */
1027 .flags = IORESOURCE_DMA,
1030 /* DRCMR for Command DMA */
1033 .flags = IORESOURCE_DMA,
1037 static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
1039 struct platform_device pxa3xx_device_nand = {
1040 .name = "pxa3xx-nand",
1043 .dma_mask = &pxa3xx_nand_dma_mask,
1044 .coherent_dma_mask = DMA_BIT_MASK(32),
1046 .num_resources = ARRAY_SIZE(pxa3xx_resources_nand),
1047 .resource = pxa3xx_resources_nand,
1050 void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
1052 pxa_register_device(&pxa3xx_device_nand, info);
1055 static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
1057 static struct resource pxa3xx_resource_ssp4[] = {
1059 .start = 0x41a00000,
1061 .flags = IORESOURCE_MEM,
1066 .flags = IORESOURCE_IRQ,
1072 .flags = IORESOURCE_DMA,
1078 .flags = IORESOURCE_DMA,
1083 * PXA3xx SSP is basically equivalent to PXA27x.
1084 * However, we need to register the device by the correct name in order to
1085 * make the driver set the correct internal type, hence we provide specific
1086 * platform_devices for each of them.
1088 struct platform_device pxa3xx_device_ssp1 = {
1089 .name = "pxa3xx-ssp",
1092 .dma_mask = &pxa27x_ssp1_dma_mask,
1093 .coherent_dma_mask = DMA_BIT_MASK(32),
1095 .resource = pxa27x_resource_ssp1,
1096 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
1099 struct platform_device pxa3xx_device_ssp2 = {
1100 .name = "pxa3xx-ssp",
1103 .dma_mask = &pxa27x_ssp2_dma_mask,
1104 .coherent_dma_mask = DMA_BIT_MASK(32),
1106 .resource = pxa27x_resource_ssp2,
1107 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
1110 struct platform_device pxa3xx_device_ssp3 = {
1111 .name = "pxa3xx-ssp",
1114 .dma_mask = &pxa27x_ssp3_dma_mask,
1115 .coherent_dma_mask = DMA_BIT_MASK(32),
1117 .resource = pxa27x_resource_ssp3,
1118 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
1121 struct platform_device pxa3xx_device_ssp4 = {
1122 .name = "pxa3xx-ssp",
1125 .dma_mask = &pxa3xx_ssp4_dma_mask,
1126 .coherent_dma_mask = DMA_BIT_MASK(32),
1128 .resource = pxa3xx_resource_ssp4,
1129 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
1131 #endif /* CONFIG_PXA3xx */
1133 struct resource pxa_resource_gpio[] = {
1135 .start = 0x40e00000,
1137 .flags = IORESOURCE_MEM,
1142 .flags = IORESOURCE_IRQ,
1147 .flags = IORESOURCE_IRQ,
1149 .start = IRQ_GPIO_2_x,
1150 .end = IRQ_GPIO_2_x,
1152 .flags = IORESOURCE_IRQ,
1156 struct platform_device pxa25x_device_gpio = {
1157 #ifdef CONFIG_CPU_PXA26x
1158 .name = "pxa26x-gpio",
1160 .name = "pxa25x-gpio",
1163 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1164 .resource = pxa_resource_gpio,
1167 struct platform_device pxa27x_device_gpio = {
1168 .name = "pxa27x-gpio",
1170 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1171 .resource = pxa_resource_gpio,
1174 struct platform_device pxa3xx_device_gpio = {
1175 .name = "pxa3xx-gpio",
1177 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1178 .resource = pxa_resource_gpio,
1181 struct platform_device pxa93x_device_gpio = {
1182 .name = "pxa93x-gpio",
1184 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1185 .resource = pxa_resource_gpio,
1188 /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
1189 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
1190 void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
1192 struct platform_device *pd;
1194 pd = platform_device_alloc("pxa2xx-spi", id);
1196 printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n",
1201 pd->dev.platform_data = info;
1202 platform_device_add(pd);
1205 static struct mmp_dma_platdata pxa_dma_pdata = {
1210 static struct resource pxa_dma_resource[] = {
1212 .start = 0x40000000,
1214 .flags = IORESOURCE_MEM,
1219 .flags = IORESOURCE_IRQ,
1223 static u64 pxadma_dmamask = 0xffffffffUL;
1225 static struct platform_device pxa2xx_pxa_dma = {
1229 .dma_mask = &pxadma_dmamask,
1230 .coherent_dma_mask = 0xffffffff,
1232 .num_resources = ARRAY_SIZE(pxa_dma_resource),
1233 .resource = pxa_dma_resource,
1236 void __init pxa2xx_set_dmac_info(int nb_channels, int nb_requestors)
1238 pxa_dma_pdata.dma_channels = nb_channels;
1239 pxa_dma_pdata.nb_requestors = nb_requestors;
1240 pxa_register_device(&pxa2xx_pxa_dma, &pxa_dma_pdata);