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>
12 #include <linux/soc/pxa/cpu.h>
15 #include <linux/platform_data/usb-pxa3xx-ulpi.h>
16 #include <linux/platform_data/video-pxafb.h>
17 #include <linux/platform_data/mmc-pxamci.h>
18 #include <linux/platform_data/irda-pxaficp.h>
20 #include <linux/platform_data/usb-ohci-pxa27x.h>
21 #include <linux/platform_data/keypad-pxa27x.h>
22 #include <linux/platform_data/media/camera-pxa.h>
23 #include <linux/platform_data/asoc-pxa.h>
24 #include <linux/platform_data/mmp_dma.h>
25 #include <linux/platform_data/mtd-nand-pxa3xx.h>
32 void __init pxa_register_device(struct platform_device *dev, void *data)
36 dev->dev.platform_data = data;
38 ret = platform_device_register(dev);
40 dev_err(&dev->dev, "unable to register device: %d\n", ret);
43 static struct resource pxa_resource_pmu = {
46 .flags = IORESOURCE_IRQ,
49 struct platform_device pxa_device_pmu = {
52 .resource = &pxa_resource_pmu,
56 static struct resource pxamci_resources[] = {
60 .flags = IORESOURCE_MEM,
65 .flags = IORESOURCE_IRQ,
69 static u64 pxamci_dmamask = 0xffffffffUL;
71 struct platform_device pxa_device_mci = {
75 .dma_mask = &pxamci_dmamask,
76 .coherent_dma_mask = 0xffffffff,
78 .num_resources = ARRAY_SIZE(pxamci_resources),
79 .resource = pxamci_resources,
82 void __init pxa_set_mci_info(struct pxamci_platform_data *info)
84 pxa_register_device(&pxa_device_mci, info);
88 static struct pxa2xx_udc_mach_info pxa_udc_info = {
92 void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
94 memcpy(&pxa_udc_info, info, sizeof *info);
97 static struct resource pxa2xx_udc_resources[] = {
101 .flags = IORESOURCE_MEM,
106 .flags = IORESOURCE_IRQ,
110 static u64 udc_dma_mask = ~(u32)0;
112 struct platform_device pxa25x_device_udc = {
113 .name = "pxa25x-udc",
115 .resource = pxa2xx_udc_resources,
116 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
118 .platform_data = &pxa_udc_info,
119 .dma_mask = &udc_dma_mask,
123 struct platform_device pxa27x_device_udc = {
124 .name = "pxa27x-udc",
126 .resource = pxa2xx_udc_resources,
127 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
129 .platform_data = &pxa_udc_info,
130 .dma_mask = &udc_dma_mask,
135 static struct resource pxa3xx_u2d_resources[] = {
139 .flags = IORESOURCE_MEM,
144 .flags = IORESOURCE_IRQ,
148 struct platform_device pxa3xx_device_u2d = {
149 .name = "pxa3xx-u2d",
151 .resource = pxa3xx_u2d_resources,
152 .num_resources = ARRAY_SIZE(pxa3xx_u2d_resources),
155 void __init pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info)
157 pxa_register_device(&pxa3xx_device_u2d, info);
159 #endif /* CONFIG_PXA3xx */
161 static struct resource pxafb_resources[] = {
165 .flags = IORESOURCE_MEM,
170 .flags = IORESOURCE_IRQ,
174 static u64 fb_dma_mask = ~(u64)0;
176 struct platform_device pxa_device_fb = {
180 .dma_mask = &fb_dma_mask,
181 .coherent_dma_mask = 0xffffffff,
183 .num_resources = ARRAY_SIZE(pxafb_resources),
184 .resource = pxafb_resources,
187 void __init pxa_set_fb_info(struct device *parent, struct pxafb_mach_info *info)
189 pxa_device_fb.dev.parent = parent;
190 pxa_register_device(&pxa_device_fb, info);
193 static struct resource pxa_resource_ffuart[] = {
197 .flags = IORESOURCE_MEM,
201 .flags = IORESOURCE_IRQ,
205 struct platform_device pxa_device_ffuart = {
206 .name = "pxa2xx-uart",
208 .resource = pxa_resource_ffuart,
209 .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
212 void __init pxa_set_ffuart_info(void *info)
214 pxa_register_device(&pxa_device_ffuart, info);
217 static struct resource pxa_resource_btuart[] = {
221 .flags = IORESOURCE_MEM,
225 .flags = IORESOURCE_IRQ,
229 struct platform_device pxa_device_btuart = {
230 .name = "pxa2xx-uart",
232 .resource = pxa_resource_btuart,
233 .num_resources = ARRAY_SIZE(pxa_resource_btuart),
236 void __init pxa_set_btuart_info(void *info)
238 pxa_register_device(&pxa_device_btuart, info);
241 static struct resource pxa_resource_stuart[] = {
245 .flags = IORESOURCE_MEM,
249 .flags = IORESOURCE_IRQ,
253 struct platform_device pxa_device_stuart = {
254 .name = "pxa2xx-uart",
256 .resource = pxa_resource_stuart,
257 .num_resources = ARRAY_SIZE(pxa_resource_stuart),
260 void __init pxa_set_stuart_info(void *info)
262 pxa_register_device(&pxa_device_stuart, info);
265 static struct resource pxa_resource_hwuart[] = {
269 .flags = IORESOURCE_MEM,
273 .flags = IORESOURCE_IRQ,
277 struct platform_device pxa_device_hwuart = {
278 .name = "pxa2xx-uart",
280 .resource = pxa_resource_hwuart,
281 .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
284 void __init pxa_set_hwuart_info(void *info)
287 pxa_register_device(&pxa_device_hwuart, info);
289 pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware");
292 static struct resource pxai2c_resources[] = {
296 .flags = IORESOURCE_MEM,
300 .flags = IORESOURCE_IRQ,
304 struct platform_device pxa_device_i2c = {
305 .name = "pxa2xx-i2c",
307 .resource = pxai2c_resources,
308 .num_resources = ARRAY_SIZE(pxai2c_resources),
311 void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
313 pxa_register_device(&pxa_device_i2c, info);
317 static struct resource pxa27x_resources_i2c_power[] = {
321 .flags = IORESOURCE_MEM,
325 .flags = IORESOURCE_IRQ,
329 struct platform_device pxa27x_device_i2c_power = {
330 .name = "pxa2xx-i2c",
332 .resource = pxa27x_resources_i2c_power,
333 .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power),
337 static struct resource pxai2s_resources[] = {
341 .flags = IORESOURCE_MEM,
345 .flags = IORESOURCE_IRQ,
349 struct platform_device pxa_device_i2s = {
350 .name = "pxa2xx-i2s",
352 .resource = pxai2s_resources,
353 .num_resources = ARRAY_SIZE(pxai2s_resources),
356 struct platform_device pxa_device_asoc_ssp1 = {
357 .name = "pxa-ssp-dai",
361 struct platform_device pxa_device_asoc_ssp2= {
362 .name = "pxa-ssp-dai",
366 struct platform_device pxa_device_asoc_ssp3 = {
367 .name = "pxa-ssp-dai",
371 struct platform_device pxa_device_asoc_ssp4 = {
372 .name = "pxa-ssp-dai",
376 struct platform_device pxa_device_asoc_platform = {
377 .name = "pxa-pcm-audio",
381 static u64 pxaficp_dmamask = ~(u32)0;
383 static struct resource pxa_ir_resources[] = {
387 .flags = IORESOURCE_IRQ,
392 .flags = IORESOURCE_IRQ,
397 .flags = IORESOURCE_MEM,
402 .flags = IORESOURCE_MEM,
406 struct platform_device pxa_device_ficp = {
409 .num_resources = ARRAY_SIZE(pxa_ir_resources),
410 .resource = pxa_ir_resources,
412 .dma_mask = &pxaficp_dmamask,
413 .coherent_dma_mask = 0xffffffff,
417 void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
419 pxa_register_device(&pxa_device_ficp, info);
422 static struct resource pxa_rtc_resources[] = {
425 .end = 0x40900000 + 0x3b,
426 .flags = IORESOURCE_MEM,
432 .flags = IORESOURCE_IRQ,
435 .start = IRQ_RTCAlrm,
438 .flags = IORESOURCE_IRQ,
442 struct platform_device pxa_device_rtc = {
445 .num_resources = ARRAY_SIZE(pxa_rtc_resources),
446 .resource = pxa_rtc_resources,
449 struct platform_device sa1100_device_rtc = {
450 .name = "sa1100-rtc",
452 .num_resources = ARRAY_SIZE(pxa_rtc_resources),
453 .resource = pxa_rtc_resources,
456 static struct resource pxa_ac97_resources[] = {
459 .end = 0x40500000 + 0xfff,
460 .flags = IORESOURCE_MEM,
465 .flags = IORESOURCE_IRQ,
469 static u64 pxa_ac97_dmamask = 0xffffffffUL;
471 struct platform_device pxa_device_ac97 = {
472 .name = "pxa2xx-ac97",
475 .dma_mask = &pxa_ac97_dmamask,
476 .coherent_dma_mask = 0xffffffff,
478 .num_resources = ARRAY_SIZE(pxa_ac97_resources),
479 .resource = pxa_ac97_resources,
482 void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops)
486 ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:0", "AC97CLK",
487 &pxa_device_ac97.dev);
489 pr_err("PXA AC97 clock1 alias error: %d\n", ret);
491 ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:1", "AC97CLK",
492 &pxa_device_ac97.dev);
494 pr_err("PXA AC97 clock2 alias error: %d\n", ret);
496 pxa_register_device(&pxa_device_ac97, ops);
501 static struct resource pxa25x_resource_pwm0[] = {
505 .flags = IORESOURCE_MEM,
509 struct platform_device pxa25x_device_pwm0 = {
510 .name = "pxa25x-pwm",
512 .resource = pxa25x_resource_pwm0,
513 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0),
516 static struct resource pxa25x_resource_pwm1[] = {
520 .flags = IORESOURCE_MEM,
524 struct platform_device pxa25x_device_pwm1 = {
525 .name = "pxa25x-pwm",
527 .resource = pxa25x_resource_pwm1,
528 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1),
531 static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
533 static struct resource pxa25x_resource_ssp[] = {
537 .flags = IORESOURCE_MEM,
542 .flags = IORESOURCE_IRQ,
546 struct platform_device pxa25x_device_ssp = {
547 .name = "pxa25x-ssp",
550 .dma_mask = &pxa25x_ssp_dma_mask,
551 .coherent_dma_mask = DMA_BIT_MASK(32),
553 .resource = pxa25x_resource_ssp,
554 .num_resources = ARRAY_SIZE(pxa25x_resource_ssp),
557 static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
559 static struct resource pxa25x_resource_nssp[] = {
563 .flags = IORESOURCE_MEM,
568 .flags = IORESOURCE_IRQ,
572 struct platform_device pxa25x_device_nssp = {
573 .name = "pxa25x-nssp",
576 .dma_mask = &pxa25x_nssp_dma_mask,
577 .coherent_dma_mask = DMA_BIT_MASK(32),
579 .resource = pxa25x_resource_nssp,
580 .num_resources = ARRAY_SIZE(pxa25x_resource_nssp),
583 static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
585 static struct resource pxa25x_resource_assp[] = {
589 .flags = IORESOURCE_MEM,
594 .flags = IORESOURCE_IRQ,
598 struct platform_device pxa25x_device_assp = {
599 /* ASSP is basically equivalent to NSSP */
600 .name = "pxa25x-nssp",
603 .dma_mask = &pxa25x_assp_dma_mask,
604 .coherent_dma_mask = DMA_BIT_MASK(32),
606 .resource = pxa25x_resource_assp,
607 .num_resources = ARRAY_SIZE(pxa25x_resource_assp),
609 #endif /* CONFIG_PXA25x */
611 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
612 static struct resource pxa27x_resource_camera[] = {
616 .flags = IORESOURCE_MEM,
621 .flags = IORESOURCE_IRQ,
625 static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
627 static struct platform_device pxa27x_device_camera = {
628 .name = "pxa27x-camera",
629 .id = 0, /* This is used to put cameras on this interface */
631 .dma_mask = &pxa27x_dma_mask_camera,
632 .coherent_dma_mask = 0xffffffff,
634 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
635 .resource = pxa27x_resource_camera,
638 void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
642 /* Register a fixed-rate clock for camera sensors. */
643 mclk = clk_register_fixed_rate(NULL, "pxa_camera_clk", NULL, 0,
644 info->mclk_10khz * 10000);
646 clkdev_create(mclk, "mclk", NULL);
647 pxa_register_device(&pxa27x_device_camera, info);
650 static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
652 static struct resource pxa27x_resource_ohci[] = {
656 .flags = IORESOURCE_MEM,
661 .flags = IORESOURCE_IRQ,
665 struct platform_device pxa27x_device_ohci = {
666 .name = "pxa27x-ohci",
669 .dma_mask = &pxa27x_ohci_dma_mask,
670 .coherent_dma_mask = DMA_BIT_MASK(32),
672 .num_resources = ARRAY_SIZE(pxa27x_resource_ohci),
673 .resource = pxa27x_resource_ohci,
676 void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
678 pxa_register_device(&pxa27x_device_ohci, info);
680 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
682 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
683 static struct resource pxa27x_resource_keypad[] = {
687 .flags = IORESOURCE_MEM,
692 .flags = IORESOURCE_IRQ,
696 struct platform_device pxa27x_device_keypad = {
697 .name = "pxa27x-keypad",
699 .resource = pxa27x_resource_keypad,
700 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad),
703 void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
705 pxa_register_device(&pxa27x_device_keypad, info);
708 static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
710 static struct resource pxa27x_resource_ssp1[] = {
714 .flags = IORESOURCE_MEM,
719 .flags = IORESOURCE_IRQ,
723 struct platform_device pxa27x_device_ssp1 = {
724 .name = "pxa27x-ssp",
727 .dma_mask = &pxa27x_ssp1_dma_mask,
728 .coherent_dma_mask = DMA_BIT_MASK(32),
730 .resource = pxa27x_resource_ssp1,
731 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
734 static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
736 static struct resource pxa27x_resource_ssp2[] = {
740 .flags = IORESOURCE_MEM,
745 .flags = IORESOURCE_IRQ,
749 struct platform_device pxa27x_device_ssp2 = {
750 .name = "pxa27x-ssp",
753 .dma_mask = &pxa27x_ssp2_dma_mask,
754 .coherent_dma_mask = DMA_BIT_MASK(32),
756 .resource = pxa27x_resource_ssp2,
757 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
760 static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
762 static struct resource pxa27x_resource_ssp3[] = {
766 .flags = IORESOURCE_MEM,
771 .flags = IORESOURCE_IRQ,
775 struct platform_device pxa27x_device_ssp3 = {
776 .name = "pxa27x-ssp",
779 .dma_mask = &pxa27x_ssp3_dma_mask,
780 .coherent_dma_mask = DMA_BIT_MASK(32),
782 .resource = pxa27x_resource_ssp3,
783 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
786 static struct resource pxa27x_resource_pwm0[] = {
790 .flags = IORESOURCE_MEM,
794 struct platform_device pxa27x_device_pwm0 = {
795 .name = "pxa27x-pwm",
797 .resource = pxa27x_resource_pwm0,
798 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0),
801 static struct resource pxa27x_resource_pwm1[] = {
805 .flags = IORESOURCE_MEM,
809 struct platform_device pxa27x_device_pwm1 = {
810 .name = "pxa27x-pwm",
812 .resource = pxa27x_resource_pwm1,
813 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1),
815 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
818 static struct resource pxa3xx_resources_mci2[] = {
822 .flags = IORESOURCE_MEM,
827 .flags = IORESOURCE_IRQ,
831 struct platform_device pxa3xx_device_mci2 = {
832 .name = "pxa2xx-mci",
835 .dma_mask = &pxamci_dmamask,
836 .coherent_dma_mask = 0xffffffff,
838 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci2),
839 .resource = pxa3xx_resources_mci2,
842 void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info)
844 pxa_register_device(&pxa3xx_device_mci2, info);
847 static struct resource pxa3xx_resources_mci3[] = {
851 .flags = IORESOURCE_MEM,
856 .flags = IORESOURCE_IRQ,
860 struct platform_device pxa3xx_device_mci3 = {
861 .name = "pxa2xx-mci",
864 .dma_mask = &pxamci_dmamask,
865 .coherent_dma_mask = 0xffffffff,
867 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci3),
868 .resource = pxa3xx_resources_mci3,
871 void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
873 pxa_register_device(&pxa3xx_device_mci3, info);
876 static struct resource pxa3xx_resources_gcu[] = {
880 .flags = IORESOURCE_MEM,
885 .flags = IORESOURCE_IRQ,
889 static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32);
891 struct platform_device pxa3xx_device_gcu = {
892 .name = "pxa3xx-gcu",
894 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu),
895 .resource = pxa3xx_resources_gcu,
897 .dma_mask = &pxa3xx_gcu_dmamask,
898 .coherent_dma_mask = 0xffffffff,
902 #endif /* CONFIG_PXA3xx */
904 #if defined(CONFIG_PXA3xx)
905 static struct resource pxa3xx_resources_i2c_power[] = {
909 .flags = IORESOURCE_MEM,
913 .flags = IORESOURCE_IRQ,
917 struct platform_device pxa3xx_device_i2c_power = {
918 .name = "pxa3xx-pwri2c",
920 .resource = pxa3xx_resources_i2c_power,
921 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power),
924 static struct resource pxa3xx_resources_nand[] = {
928 .flags = IORESOURCE_MEM,
933 .flags = IORESOURCE_IRQ,
937 static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
939 struct platform_device pxa3xx_device_nand = {
940 .name = "pxa3xx-nand",
943 .dma_mask = &pxa3xx_nand_dma_mask,
944 .coherent_dma_mask = DMA_BIT_MASK(32),
946 .num_resources = ARRAY_SIZE(pxa3xx_resources_nand),
947 .resource = pxa3xx_resources_nand,
950 void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
952 pxa_register_device(&pxa3xx_device_nand, info);
955 static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
957 static struct resource pxa3xx_resource_ssp4[] = {
961 .flags = IORESOURCE_MEM,
966 .flags = IORESOURCE_IRQ,
971 * PXA3xx SSP is basically equivalent to PXA27x.
972 * However, we need to register the device by the correct name in order to
973 * make the driver set the correct internal type, hence we provide specific
974 * platform_devices for each of them.
976 struct platform_device pxa3xx_device_ssp1 = {
977 .name = "pxa3xx-ssp",
980 .dma_mask = &pxa27x_ssp1_dma_mask,
981 .coherent_dma_mask = DMA_BIT_MASK(32),
983 .resource = pxa27x_resource_ssp1,
984 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
987 struct platform_device pxa3xx_device_ssp2 = {
988 .name = "pxa3xx-ssp",
991 .dma_mask = &pxa27x_ssp2_dma_mask,
992 .coherent_dma_mask = DMA_BIT_MASK(32),
994 .resource = pxa27x_resource_ssp2,
995 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
998 struct platform_device pxa3xx_device_ssp3 = {
999 .name = "pxa3xx-ssp",
1002 .dma_mask = &pxa27x_ssp3_dma_mask,
1003 .coherent_dma_mask = DMA_BIT_MASK(32),
1005 .resource = pxa27x_resource_ssp3,
1006 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
1009 struct platform_device pxa3xx_device_ssp4 = {
1010 .name = "pxa3xx-ssp",
1013 .dma_mask = &pxa3xx_ssp4_dma_mask,
1014 .coherent_dma_mask = DMA_BIT_MASK(32),
1016 .resource = pxa3xx_resource_ssp4,
1017 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
1019 #endif /* CONFIG_PXA3xx */
1021 struct resource pxa_resource_gpio[] = {
1023 .start = 0x40e00000,
1025 .flags = IORESOURCE_MEM,
1030 .flags = IORESOURCE_IRQ,
1035 .flags = IORESOURCE_IRQ,
1037 .start = IRQ_GPIO_2_x,
1038 .end = IRQ_GPIO_2_x,
1040 .flags = IORESOURCE_IRQ,
1044 struct platform_device pxa25x_device_gpio = {
1045 #ifdef CONFIG_CPU_PXA26x
1046 .name = "pxa26x-gpio",
1048 .name = "pxa25x-gpio",
1051 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1052 .resource = pxa_resource_gpio,
1055 struct platform_device pxa27x_device_gpio = {
1056 .name = "pxa27x-gpio",
1058 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1059 .resource = pxa_resource_gpio,
1062 struct platform_device pxa3xx_device_gpio = {
1063 .name = "pxa3xx-gpio",
1065 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1066 .resource = pxa_resource_gpio,
1069 struct platform_device pxa93x_device_gpio = {
1070 .name = "pxa93x-gpio",
1072 .num_resources = ARRAY_SIZE(pxa_resource_gpio),
1073 .resource = pxa_resource_gpio,
1076 /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
1077 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
1078 void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info)
1080 struct platform_device *pd;
1082 pd = platform_device_alloc("pxa2xx-spi", id);
1084 printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n",
1089 pd->dev.platform_data = info;
1090 platform_device_add(pd);
1093 static struct resource pxa_dma_resource[] = {
1095 .start = 0x40000000,
1097 .flags = IORESOURCE_MEM,
1102 .flags = IORESOURCE_IRQ,
1106 static u64 pxadma_dmamask = 0xffffffffUL;
1108 static struct platform_device pxa2xx_pxa_dma = {
1112 .dma_mask = &pxadma_dmamask,
1113 .coherent_dma_mask = 0xffffffff,
1115 .num_resources = ARRAY_SIZE(pxa_dma_resource),
1116 .resource = pxa_dma_resource,
1119 void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata)
1121 pxa_register_device(&pxa2xx_pxa_dma, dma_pdata);
1124 void __init pxa_register_wdt(unsigned int reset_status)
1126 struct resource res = DEFINE_RES_MEM(OST_PHYS, OST_LEN);
1128 reset_status &= RESET_STATUS_WATCHDOG;
1129 platform_device_register_resndata(NULL, "sa1100_wdt", -1, &res, 1,
1130 &reset_status, sizeof(reset_status));