1 /* linux/arch/arm/plat-samsung/devs.c
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
6 * Base SAMSUNG platform device definitions
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/amba/pl330.h>
14 #include <linux/kernel.h>
15 #include <linux/types.h>
16 #include <linux/interrupt.h>
17 #include <linux/list.h>
18 #include <linux/timer.h>
19 #include <linux/init.h>
20 #include <linux/serial_core.h>
21 #include <linux/platform_device.h>
23 #include <linux/slab.h>
24 #include <linux/string.h>
25 #include <linux/dma-mapping.h>
27 #include <linux/gfp.h>
28 #include <linux/mtd/mtd.h>
29 #include <linux/mtd/onenand.h>
30 #include <linux/mtd/partitions.h>
31 #include <linux/mmc/host.h>
32 #include <linux/ioport.h>
33 #include <linux/platform_data/s3c-hsudc.h>
34 #include <linux/platform_data/s3c-hsotg.h>
36 #include <media/s5p_hdmi.h>
39 #include <asm/mach/arch.h>
40 #include <asm/mach/map.h>
41 #include <asm/mach/irq.h>
43 #include <mach/hardware.h>
45 #include <mach/irqs.h>
49 #include <plat/devs.h>
51 #include <linux/platform_data/ata-samsung_cf.h>
52 #include <linux/platform_data/usb-ehci-s5p.h>
54 #include <plat/fb-s3c2410.h>
55 #include <plat/hdmi.h>
56 #include <linux/platform_data/hwmon-s3c.h>
57 #include <linux/platform_data/i2c-s3c2410.h>
58 #include <plat/keypad.h>
59 #include <linux/platform_data/mmc-s3cmci.h>
60 #include <linux/platform_data/mtd-nand-s3c2410.h>
61 #include <plat/sdhci.h>
62 #include <linux/platform_data/touchscreen-s3c2410.h>
63 #include <linux/platform_data/usb-s3c2410_udc.h>
64 #include <linux/platform_data/usb-ohci-s3c2410.h>
65 #include <plat/usb-phy.h>
66 #include <plat/regs-iic.h>
67 #include <plat/regs-serial.h>
68 #include <plat/regs-spi.h>
69 #include <linux/platform_data/spi-s3c64xx.h>
71 static u64 samsung_device_dma_mask
= DMA_BIT_MASK(32);
74 #ifdef CONFIG_CPU_S3C2440
75 static struct resource s3c_ac97_resource
[] = {
76 [0] = DEFINE_RES_MEM(S3C2440_PA_AC97
, S3C2440_SZ_AC97
),
77 [1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97
),
78 [2] = DEFINE_RES_DMA_NAMED(DMACH_PCM_OUT
, "PCM out"),
79 [3] = DEFINE_RES_DMA_NAMED(DMACH_PCM_IN
, "PCM in"),
80 [4] = DEFINE_RES_DMA_NAMED(DMACH_MIC_IN
, "Mic in"),
83 struct platform_device s3c_device_ac97
= {
84 .name
= "samsung-ac97",
86 .num_resources
= ARRAY_SIZE(s3c_ac97_resource
),
87 .resource
= s3c_ac97_resource
,
89 .dma_mask
= &samsung_device_dma_mask
,
90 .coherent_dma_mask
= DMA_BIT_MASK(32),
93 #endif /* CONFIG_CPU_S3C2440 */
97 #ifdef CONFIG_PLAT_S3C24XX
98 static struct resource s3c_adc_resource
[] = {
99 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC
, S3C24XX_SZ_ADC
),
100 [1] = DEFINE_RES_IRQ(IRQ_TC
),
101 [2] = DEFINE_RES_IRQ(IRQ_ADC
),
104 struct platform_device s3c_device_adc
= {
105 .name
= "s3c24xx-adc",
107 .num_resources
= ARRAY_SIZE(s3c_adc_resource
),
108 .resource
= s3c_adc_resource
,
110 #endif /* CONFIG_PLAT_S3C24XX */
112 #if defined(CONFIG_SAMSUNG_DEV_ADC)
113 static struct resource s3c_adc_resource
[] = {
114 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC
, SZ_256
),
115 [1] = DEFINE_RES_IRQ(IRQ_TC
),
116 [2] = DEFINE_RES_IRQ(IRQ_ADC
),
119 struct platform_device s3c_device_adc
= {
120 .name
= "samsung-adc",
122 .num_resources
= ARRAY_SIZE(s3c_adc_resource
),
123 .resource
= s3c_adc_resource
,
125 #endif /* CONFIG_SAMSUNG_DEV_ADC */
127 /* Camif Controller */
129 #ifdef CONFIG_CPU_S3C2440
130 static struct resource s3c_camif_resource
[] = {
131 [0] = DEFINE_RES_MEM(S3C2440_PA_CAMIF
, S3C2440_SZ_CAMIF
),
132 [1] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_C
),
133 [2] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_P
),
136 struct platform_device s3c_device_camif
= {
137 .name
= "s3c2440-camif",
139 .num_resources
= ARRAY_SIZE(s3c_camif_resource
),
140 .resource
= s3c_camif_resource
,
142 .dma_mask
= &samsung_device_dma_mask
,
143 .coherent_dma_mask
= DMA_BIT_MASK(32),
146 #endif /* CONFIG_CPU_S3C2440 */
150 struct platform_device samsung_asoc_idma
= {
151 .name
= "samsung-idma",
154 .dma_mask
= &samsung_device_dma_mask
,
155 .coherent_dma_mask
= DMA_BIT_MASK(32),
161 #ifdef CONFIG_S3C_DEV_FB
162 static struct resource s3c_fb_resource
[] = {
163 [0] = DEFINE_RES_MEM(S3C_PA_FB
, SZ_16K
),
164 [1] = DEFINE_RES_IRQ(IRQ_LCD_VSYNC
),
165 [2] = DEFINE_RES_IRQ(IRQ_LCD_FIFO
),
166 [3] = DEFINE_RES_IRQ(IRQ_LCD_SYSTEM
),
169 struct platform_device s3c_device_fb
= {
172 .num_resources
= ARRAY_SIZE(s3c_fb_resource
),
173 .resource
= s3c_fb_resource
,
175 .dma_mask
= &samsung_device_dma_mask
,
176 .coherent_dma_mask
= DMA_BIT_MASK(32),
180 void __init
s3c_fb_set_platdata(struct s3c_fb_platdata
*pd
)
182 s3c_set_platdata(pd
, sizeof(struct s3c_fb_platdata
),
185 #endif /* CONFIG_S3C_DEV_FB */
189 #ifdef CONFIG_S5P_DEV_FIMC0
190 static struct resource s5p_fimc0_resource
[] = {
191 [0] = DEFINE_RES_MEM(S5P_PA_FIMC0
, SZ_4K
),
192 [1] = DEFINE_RES_IRQ(IRQ_FIMC0
),
195 struct platform_device s5p_device_fimc0
= {
198 .num_resources
= ARRAY_SIZE(s5p_fimc0_resource
),
199 .resource
= s5p_fimc0_resource
,
201 .dma_mask
= &samsung_device_dma_mask
,
202 .coherent_dma_mask
= DMA_BIT_MASK(32),
206 struct platform_device s5p_device_fimc_md
= {
207 .name
= "s5p-fimc-md",
210 #endif /* CONFIG_S5P_DEV_FIMC0 */
212 #ifdef CONFIG_S5P_DEV_FIMC1
213 static struct resource s5p_fimc1_resource
[] = {
214 [0] = DEFINE_RES_MEM(S5P_PA_FIMC1
, SZ_4K
),
215 [1] = DEFINE_RES_IRQ(IRQ_FIMC1
),
218 struct platform_device s5p_device_fimc1
= {
221 .num_resources
= ARRAY_SIZE(s5p_fimc1_resource
),
222 .resource
= s5p_fimc1_resource
,
224 .dma_mask
= &samsung_device_dma_mask
,
225 .coherent_dma_mask
= DMA_BIT_MASK(32),
228 #endif /* CONFIG_S5P_DEV_FIMC1 */
230 #ifdef CONFIG_S5P_DEV_FIMC2
231 static struct resource s5p_fimc2_resource
[] = {
232 [0] = DEFINE_RES_MEM(S5P_PA_FIMC2
, SZ_4K
),
233 [1] = DEFINE_RES_IRQ(IRQ_FIMC2
),
236 struct platform_device s5p_device_fimc2
= {
239 .num_resources
= ARRAY_SIZE(s5p_fimc2_resource
),
240 .resource
= s5p_fimc2_resource
,
242 .dma_mask
= &samsung_device_dma_mask
,
243 .coherent_dma_mask
= DMA_BIT_MASK(32),
246 #endif /* CONFIG_S5P_DEV_FIMC2 */
248 #ifdef CONFIG_S5P_DEV_FIMC3
249 static struct resource s5p_fimc3_resource
[] = {
250 [0] = DEFINE_RES_MEM(S5P_PA_FIMC3
, SZ_4K
),
251 [1] = DEFINE_RES_IRQ(IRQ_FIMC3
),
254 struct platform_device s5p_device_fimc3
= {
257 .num_resources
= ARRAY_SIZE(s5p_fimc3_resource
),
258 .resource
= s5p_fimc3_resource
,
260 .dma_mask
= &samsung_device_dma_mask
,
261 .coherent_dma_mask
= DMA_BIT_MASK(32),
264 #endif /* CONFIG_S5P_DEV_FIMC3 */
268 #ifdef CONFIG_S5P_DEV_G2D
269 static struct resource s5p_g2d_resource
[] = {
270 [0] = DEFINE_RES_MEM(S5P_PA_G2D
, SZ_4K
),
271 [1] = DEFINE_RES_IRQ(IRQ_2D
),
274 struct platform_device s5p_device_g2d
= {
277 .num_resources
= ARRAY_SIZE(s5p_g2d_resource
),
278 .resource
= s5p_g2d_resource
,
280 .dma_mask
= &samsung_device_dma_mask
,
281 .coherent_dma_mask
= DMA_BIT_MASK(32),
284 #endif /* CONFIG_S5P_DEV_G2D */
286 #ifdef CONFIG_S5P_DEV_JPEG
287 static struct resource s5p_jpeg_resource
[] = {
288 [0] = DEFINE_RES_MEM(S5P_PA_JPEG
, SZ_4K
),
289 [1] = DEFINE_RES_IRQ(IRQ_JPEG
),
292 struct platform_device s5p_device_jpeg
= {
295 .num_resources
= ARRAY_SIZE(s5p_jpeg_resource
),
296 .resource
= s5p_jpeg_resource
,
298 .dma_mask
= &samsung_device_dma_mask
,
299 .coherent_dma_mask
= DMA_BIT_MASK(32),
302 #endif /* CONFIG_S5P_DEV_JPEG */
306 #ifdef CONFIG_S5P_DEV_FIMD0
307 static struct resource s5p_fimd0_resource
[] = {
308 [0] = DEFINE_RES_MEM(S5P_PA_FIMD0
, SZ_32K
),
309 [1] = DEFINE_RES_IRQ(IRQ_FIMD0_VSYNC
),
310 [2] = DEFINE_RES_IRQ(IRQ_FIMD0_FIFO
),
311 [3] = DEFINE_RES_IRQ(IRQ_FIMD0_SYSTEM
),
314 struct platform_device s5p_device_fimd0
= {
317 .num_resources
= ARRAY_SIZE(s5p_fimd0_resource
),
318 .resource
= s5p_fimd0_resource
,
320 .dma_mask
= &samsung_device_dma_mask
,
321 .coherent_dma_mask
= DMA_BIT_MASK(32),
325 void __init
s5p_fimd0_set_platdata(struct s3c_fb_platdata
*pd
)
327 s3c_set_platdata(pd
, sizeof(struct s3c_fb_platdata
),
330 #endif /* CONFIG_S5P_DEV_FIMD0 */
334 #ifdef CONFIG_S3C_DEV_HWMON
335 struct platform_device s3c_device_hwmon
= {
338 .dev
.parent
= &s3c_device_adc
.dev
,
341 void __init
s3c_hwmon_set_platdata(struct s3c_hwmon_pdata
*pd
)
343 s3c_set_platdata(pd
, sizeof(struct s3c_hwmon_pdata
),
346 #endif /* CONFIG_S3C_DEV_HWMON */
350 #ifdef CONFIG_S3C_DEV_HSMMC
351 static struct resource s3c_hsmmc_resource
[] = {
352 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC0
, SZ_4K
),
353 [1] = DEFINE_RES_IRQ(IRQ_HSMMC0
),
356 struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata
= {
358 .host_caps
= (MMC_CAP_4_BIT_DATA
|
359 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
362 struct platform_device s3c_device_hsmmc0
= {
365 .num_resources
= ARRAY_SIZE(s3c_hsmmc_resource
),
366 .resource
= s3c_hsmmc_resource
,
368 .dma_mask
= &samsung_device_dma_mask
,
369 .coherent_dma_mask
= DMA_BIT_MASK(32),
370 .platform_data
= &s3c_hsmmc0_def_platdata
,
374 void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata
*pd
)
376 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc0_def_platdata
);
378 #endif /* CONFIG_S3C_DEV_HSMMC */
380 #ifdef CONFIG_S3C_DEV_HSMMC1
381 static struct resource s3c_hsmmc1_resource
[] = {
382 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC1
, SZ_4K
),
383 [1] = DEFINE_RES_IRQ(IRQ_HSMMC1
),
386 struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata
= {
388 .host_caps
= (MMC_CAP_4_BIT_DATA
|
389 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
392 struct platform_device s3c_device_hsmmc1
= {
395 .num_resources
= ARRAY_SIZE(s3c_hsmmc1_resource
),
396 .resource
= s3c_hsmmc1_resource
,
398 .dma_mask
= &samsung_device_dma_mask
,
399 .coherent_dma_mask
= DMA_BIT_MASK(32),
400 .platform_data
= &s3c_hsmmc1_def_platdata
,
404 void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata
*pd
)
406 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc1_def_platdata
);
408 #endif /* CONFIG_S3C_DEV_HSMMC1 */
412 #ifdef CONFIG_S3C_DEV_HSMMC2
413 static struct resource s3c_hsmmc2_resource
[] = {
414 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC2
, SZ_4K
),
415 [1] = DEFINE_RES_IRQ(IRQ_HSMMC2
),
418 struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata
= {
420 .host_caps
= (MMC_CAP_4_BIT_DATA
|
421 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
424 struct platform_device s3c_device_hsmmc2
= {
427 .num_resources
= ARRAY_SIZE(s3c_hsmmc2_resource
),
428 .resource
= s3c_hsmmc2_resource
,
430 .dma_mask
= &samsung_device_dma_mask
,
431 .coherent_dma_mask
= DMA_BIT_MASK(32),
432 .platform_data
= &s3c_hsmmc2_def_platdata
,
436 void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata
*pd
)
438 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc2_def_platdata
);
440 #endif /* CONFIG_S3C_DEV_HSMMC2 */
442 #ifdef CONFIG_S3C_DEV_HSMMC3
443 static struct resource s3c_hsmmc3_resource
[] = {
444 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC3
, SZ_4K
),
445 [1] = DEFINE_RES_IRQ(IRQ_HSMMC3
),
448 struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata
= {
450 .host_caps
= (MMC_CAP_4_BIT_DATA
|
451 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
454 struct platform_device s3c_device_hsmmc3
= {
457 .num_resources
= ARRAY_SIZE(s3c_hsmmc3_resource
),
458 .resource
= s3c_hsmmc3_resource
,
460 .dma_mask
= &samsung_device_dma_mask
,
461 .coherent_dma_mask
= DMA_BIT_MASK(32),
462 .platform_data
= &s3c_hsmmc3_def_platdata
,
466 void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata
*pd
)
468 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc3_def_platdata
);
470 #endif /* CONFIG_S3C_DEV_HSMMC3 */
474 static struct resource s3c_i2c0_resource
[] = {
475 [0] = DEFINE_RES_MEM(S3C_PA_IIC
, SZ_4K
),
476 [1] = DEFINE_RES_IRQ(IRQ_IIC
),
479 struct platform_device s3c_device_i2c0
= {
480 .name
= "s3c2410-i2c",
482 .num_resources
= ARRAY_SIZE(s3c_i2c0_resource
),
483 .resource
= s3c_i2c0_resource
,
486 struct s3c2410_platform_i2c default_i2c_data __initdata
= {
489 .frequency
= 100*1000,
493 void __init
s3c_i2c0_set_platdata(struct s3c2410_platform_i2c
*pd
)
495 struct s3c2410_platform_i2c
*npd
;
498 pd
= &default_i2c_data
;
502 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
506 npd
->cfg_gpio
= s3c_i2c0_cfg_gpio
;
509 #ifdef CONFIG_S3C_DEV_I2C1
510 static struct resource s3c_i2c1_resource
[] = {
511 [0] = DEFINE_RES_MEM(S3C_PA_IIC1
, SZ_4K
),
512 [1] = DEFINE_RES_IRQ(IRQ_IIC1
),
515 struct platform_device s3c_device_i2c1
= {
516 .name
= "s3c2410-i2c",
518 .num_resources
= ARRAY_SIZE(s3c_i2c1_resource
),
519 .resource
= s3c_i2c1_resource
,
522 void __init
s3c_i2c1_set_platdata(struct s3c2410_platform_i2c
*pd
)
524 struct s3c2410_platform_i2c
*npd
;
527 pd
= &default_i2c_data
;
531 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
535 npd
->cfg_gpio
= s3c_i2c1_cfg_gpio
;
537 #endif /* CONFIG_S3C_DEV_I2C1 */
539 #ifdef CONFIG_S3C_DEV_I2C2
540 static struct resource s3c_i2c2_resource
[] = {
541 [0] = DEFINE_RES_MEM(S3C_PA_IIC2
, SZ_4K
),
542 [1] = DEFINE_RES_IRQ(IRQ_IIC2
),
545 struct platform_device s3c_device_i2c2
= {
546 .name
= "s3c2410-i2c",
548 .num_resources
= ARRAY_SIZE(s3c_i2c2_resource
),
549 .resource
= s3c_i2c2_resource
,
552 void __init
s3c_i2c2_set_platdata(struct s3c2410_platform_i2c
*pd
)
554 struct s3c2410_platform_i2c
*npd
;
557 pd
= &default_i2c_data
;
561 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
565 npd
->cfg_gpio
= s3c_i2c2_cfg_gpio
;
567 #endif /* CONFIG_S3C_DEV_I2C2 */
569 #ifdef CONFIG_S3C_DEV_I2C3
570 static struct resource s3c_i2c3_resource
[] = {
571 [0] = DEFINE_RES_MEM(S3C_PA_IIC3
, SZ_4K
),
572 [1] = DEFINE_RES_IRQ(IRQ_IIC3
),
575 struct platform_device s3c_device_i2c3
= {
576 .name
= "s3c2440-i2c",
578 .num_resources
= ARRAY_SIZE(s3c_i2c3_resource
),
579 .resource
= s3c_i2c3_resource
,
582 void __init
s3c_i2c3_set_platdata(struct s3c2410_platform_i2c
*pd
)
584 struct s3c2410_platform_i2c
*npd
;
587 pd
= &default_i2c_data
;
591 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
595 npd
->cfg_gpio
= s3c_i2c3_cfg_gpio
;
597 #endif /*CONFIG_S3C_DEV_I2C3 */
599 #ifdef CONFIG_S3C_DEV_I2C4
600 static struct resource s3c_i2c4_resource
[] = {
601 [0] = DEFINE_RES_MEM(S3C_PA_IIC4
, SZ_4K
),
602 [1] = DEFINE_RES_IRQ(IRQ_IIC4
),
605 struct platform_device s3c_device_i2c4
= {
606 .name
= "s3c2440-i2c",
608 .num_resources
= ARRAY_SIZE(s3c_i2c4_resource
),
609 .resource
= s3c_i2c4_resource
,
612 void __init
s3c_i2c4_set_platdata(struct s3c2410_platform_i2c
*pd
)
614 struct s3c2410_platform_i2c
*npd
;
617 pd
= &default_i2c_data
;
621 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
625 npd
->cfg_gpio
= s3c_i2c4_cfg_gpio
;
627 #endif /*CONFIG_S3C_DEV_I2C4 */
629 #ifdef CONFIG_S3C_DEV_I2C5
630 static struct resource s3c_i2c5_resource
[] = {
631 [0] = DEFINE_RES_MEM(S3C_PA_IIC5
, SZ_4K
),
632 [1] = DEFINE_RES_IRQ(IRQ_IIC5
),
635 struct platform_device s3c_device_i2c5
= {
636 .name
= "s3c2440-i2c",
638 .num_resources
= ARRAY_SIZE(s3c_i2c5_resource
),
639 .resource
= s3c_i2c5_resource
,
642 void __init
s3c_i2c5_set_platdata(struct s3c2410_platform_i2c
*pd
)
644 struct s3c2410_platform_i2c
*npd
;
647 pd
= &default_i2c_data
;
651 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
655 npd
->cfg_gpio
= s3c_i2c5_cfg_gpio
;
657 #endif /*CONFIG_S3C_DEV_I2C5 */
659 #ifdef CONFIG_S3C_DEV_I2C6
660 static struct resource s3c_i2c6_resource
[] = {
661 [0] = DEFINE_RES_MEM(S3C_PA_IIC6
, SZ_4K
),
662 [1] = DEFINE_RES_IRQ(IRQ_IIC6
),
665 struct platform_device s3c_device_i2c6
= {
666 .name
= "s3c2440-i2c",
668 .num_resources
= ARRAY_SIZE(s3c_i2c6_resource
),
669 .resource
= s3c_i2c6_resource
,
672 void __init
s3c_i2c6_set_platdata(struct s3c2410_platform_i2c
*pd
)
674 struct s3c2410_platform_i2c
*npd
;
677 pd
= &default_i2c_data
;
681 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
685 npd
->cfg_gpio
= s3c_i2c6_cfg_gpio
;
687 #endif /* CONFIG_S3C_DEV_I2C6 */
689 #ifdef CONFIG_S3C_DEV_I2C7
690 static struct resource s3c_i2c7_resource
[] = {
691 [0] = DEFINE_RES_MEM(S3C_PA_IIC7
, SZ_4K
),
692 [1] = DEFINE_RES_IRQ(IRQ_IIC7
),
695 struct platform_device s3c_device_i2c7
= {
696 .name
= "s3c2440-i2c",
698 .num_resources
= ARRAY_SIZE(s3c_i2c7_resource
),
699 .resource
= s3c_i2c7_resource
,
702 void __init
s3c_i2c7_set_platdata(struct s3c2410_platform_i2c
*pd
)
704 struct s3c2410_platform_i2c
*npd
;
707 pd
= &default_i2c_data
;
711 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
715 npd
->cfg_gpio
= s3c_i2c7_cfg_gpio
;
717 #endif /* CONFIG_S3C_DEV_I2C7 */
721 #ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
722 static struct resource s5p_i2c_resource
[] = {
723 [0] = DEFINE_RES_MEM(S5P_PA_IIC_HDMIPHY
, SZ_4K
),
724 [1] = DEFINE_RES_IRQ(IRQ_IIC_HDMIPHY
),
727 struct platform_device s5p_device_i2c_hdmiphy
= {
728 .name
= "s3c2440-hdmiphy-i2c",
730 .num_resources
= ARRAY_SIZE(s5p_i2c_resource
),
731 .resource
= s5p_i2c_resource
,
734 void __init
s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c
*pd
)
736 struct s3c2410_platform_i2c
*npd
;
739 pd
= &default_i2c_data
;
741 if (soc_is_exynos4210() ||
742 soc_is_exynos4212() || soc_is_exynos4412())
744 else if (soc_is_s5pv210())
750 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
751 &s5p_device_i2c_hdmiphy
);
754 static struct s5p_hdmi_platform_data s5p_hdmi_def_platdata
;
756 void __init
s5p_hdmi_set_platdata(struct i2c_board_info
*hdmiphy_info
,
757 struct i2c_board_info
*mhl_info
, int mhl_bus
)
759 struct s5p_hdmi_platform_data
*pd
= &s5p_hdmi_def_platdata
;
761 if (soc_is_exynos4210() ||
762 soc_is_exynos4212() || soc_is_exynos4412())
764 else if (soc_is_s5pv210())
769 pd
->hdmiphy_info
= hdmiphy_info
;
770 pd
->mhl_info
= mhl_info
;
771 pd
->mhl_bus
= mhl_bus
;
773 s3c_set_platdata(pd
, sizeof(struct s5p_hdmi_platform_data
),
777 #endif /* CONFIG_S5P_DEV_I2C_HDMIPHY */
781 #ifdef CONFIG_PLAT_S3C24XX
782 static struct resource s3c_iis_resource
[] = {
783 [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS
, S3C24XX_SZ_IIS
),
786 struct platform_device s3c_device_iis
= {
787 .name
= "s3c24xx-iis",
789 .num_resources
= ARRAY_SIZE(s3c_iis_resource
),
790 .resource
= s3c_iis_resource
,
792 .dma_mask
= &samsung_device_dma_mask
,
793 .coherent_dma_mask
= DMA_BIT_MASK(32),
796 #endif /* CONFIG_PLAT_S3C24XX */
800 #ifdef CONFIG_SAMSUNG_DEV_IDE
801 static struct resource s3c_cfcon_resource
[] = {
802 [0] = DEFINE_RES_MEM(SAMSUNG_PA_CFCON
, SZ_16K
),
803 [1] = DEFINE_RES_IRQ(IRQ_CFCON
),
806 struct platform_device s3c_device_cfcon
= {
808 .num_resources
= ARRAY_SIZE(s3c_cfcon_resource
),
809 .resource
= s3c_cfcon_resource
,
812 void __init
s3c_ide_set_platdata(struct s3c_ide_platdata
*pdata
)
814 s3c_set_platdata(pdata
, sizeof(struct s3c_ide_platdata
),
817 #endif /* CONFIG_SAMSUNG_DEV_IDE */
821 #ifdef CONFIG_SAMSUNG_DEV_KEYPAD
822 static struct resource samsung_keypad_resources
[] = {
823 [0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD
, SZ_32
),
824 [1] = DEFINE_RES_IRQ(IRQ_KEYPAD
),
827 struct platform_device samsung_device_keypad
= {
828 .name
= "samsung-keypad",
830 .num_resources
= ARRAY_SIZE(samsung_keypad_resources
),
831 .resource
= samsung_keypad_resources
,
834 void __init
samsung_keypad_set_platdata(struct samsung_keypad_platdata
*pd
)
836 struct samsung_keypad_platdata
*npd
;
838 npd
= s3c_set_platdata(pd
, sizeof(struct samsung_keypad_platdata
),
839 &samsung_device_keypad
);
842 npd
->cfg_gpio
= samsung_keypad_cfg_gpio
;
844 #endif /* CONFIG_SAMSUNG_DEV_KEYPAD */
848 #ifdef CONFIG_PLAT_S3C24XX
849 static struct resource s3c_lcd_resource
[] = {
850 [0] = DEFINE_RES_MEM(S3C24XX_PA_LCD
, S3C24XX_SZ_LCD
),
851 [1] = DEFINE_RES_IRQ(IRQ_LCD
),
854 struct platform_device s3c_device_lcd
= {
855 .name
= "s3c2410-lcd",
857 .num_resources
= ARRAY_SIZE(s3c_lcd_resource
),
858 .resource
= s3c_lcd_resource
,
860 .dma_mask
= &samsung_device_dma_mask
,
861 .coherent_dma_mask
= DMA_BIT_MASK(32),
865 void __init
s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info
*pd
)
867 struct s3c2410fb_mach_info
*npd
;
869 npd
= s3c_set_platdata(pd
, sizeof(*npd
), &s3c_device_lcd
);
871 npd
->displays
= kmemdup(pd
->displays
,
872 sizeof(struct s3c2410fb_display
) * npd
->num_displays
,
875 printk(KERN_ERR
"no memory for LCD display data\n");
877 printk(KERN_ERR
"no memory for LCD platform data\n");
880 #endif /* CONFIG_PLAT_S3C24XX */
884 #ifdef CONFIG_S5P_DEV_MFC
885 static struct resource s5p_mfc_resource
[] = {
886 [0] = DEFINE_RES_MEM(S5P_PA_MFC
, SZ_64K
),
887 [1] = DEFINE_RES_IRQ(IRQ_MFC
),
890 struct platform_device s5p_device_mfc
= {
893 .num_resources
= ARRAY_SIZE(s5p_mfc_resource
),
894 .resource
= s5p_mfc_resource
,
898 * MFC hardware has 2 memory interfaces which are modelled as two separate
899 * platform devices to let dma-mapping distinguish between them.
901 * MFC parent device (s5p_device_mfc) must be registered before memory
902 * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
905 struct platform_device s5p_device_mfc_l
= {
909 .parent
= &s5p_device_mfc
.dev
,
910 .dma_mask
= &samsung_device_dma_mask
,
911 .coherent_dma_mask
= DMA_BIT_MASK(32),
915 struct platform_device s5p_device_mfc_r
= {
919 .parent
= &s5p_device_mfc
.dev
,
920 .dma_mask
= &samsung_device_dma_mask
,
921 .coherent_dma_mask
= DMA_BIT_MASK(32),
925 #endif /* CONFIG_S5P_DEV_MFC */
929 #ifdef CONFIG_S5P_DEV_CSIS0
930 static struct resource s5p_mipi_csis0_resource
[] = {
931 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS0
, SZ_16K
),
932 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS0
),
935 struct platform_device s5p_device_mipi_csis0
= {
936 .name
= "s5p-mipi-csis",
938 .num_resources
= ARRAY_SIZE(s5p_mipi_csis0_resource
),
939 .resource
= s5p_mipi_csis0_resource
,
941 #endif /* CONFIG_S5P_DEV_CSIS0 */
943 #ifdef CONFIG_S5P_DEV_CSIS1
944 static struct resource s5p_mipi_csis1_resource
[] = {
945 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS1
, SZ_16K
),
946 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS1
),
949 struct platform_device s5p_device_mipi_csis1
= {
950 .name
= "s5p-mipi-csis",
952 .num_resources
= ARRAY_SIZE(s5p_mipi_csis1_resource
),
953 .resource
= s5p_mipi_csis1_resource
,
959 #ifdef CONFIG_S3C_DEV_NAND
960 static struct resource s3c_nand_resource
[] = {
961 [0] = DEFINE_RES_MEM(S3C_PA_NAND
, SZ_1M
),
964 struct platform_device s3c_device_nand
= {
965 .name
= "s3c2410-nand",
967 .num_resources
= ARRAY_SIZE(s3c_nand_resource
),
968 .resource
= s3c_nand_resource
,
972 * s3c_nand_copy_set() - copy nand set data
973 * @set: The new structure, directly copied from the old.
975 * Copy all the fields from the NAND set field from what is probably __initdata
976 * to new kernel memory. The code returns 0 if the copy happened correctly or
977 * an error code for the calling function to display.
979 * Note, we currently do not try and look to see if we've already copied the
980 * data in a previous set.
982 static int __init
s3c_nand_copy_set(struct s3c2410_nand_set
*set
)
987 size
= sizeof(struct mtd_partition
) * set
->nr_partitions
;
989 ptr
= kmemdup(set
->partitions
, size
, GFP_KERNEL
);
990 set
->partitions
= ptr
;
996 if (set
->nr_map
&& set
->nr_chips
) {
997 size
= sizeof(int) * set
->nr_chips
;
998 ptr
= kmemdup(set
->nr_map
, size
, GFP_KERNEL
);
1005 if (set
->ecc_layout
) {
1006 ptr
= kmemdup(set
->ecc_layout
,
1007 sizeof(struct nand_ecclayout
), GFP_KERNEL
);
1008 set
->ecc_layout
= ptr
;
1017 void __init
s3c_nand_set_platdata(struct s3c2410_platform_nand
*nand
)
1019 struct s3c2410_platform_nand
*npd
;
1023 /* note, if we get a failure in allocation, we simply drop out of the
1024 * function. If there is so little memory available at initialisation
1025 * time then there is little chance the system is going to run.
1028 npd
= s3c_set_platdata(nand
, sizeof(struct s3c2410_platform_nand
),
1033 /* now see if we need to copy any of the nand set data */
1035 size
= sizeof(struct s3c2410_nand_set
) * npd
->nr_sets
;
1037 struct s3c2410_nand_set
*from
= npd
->sets
;
1038 struct s3c2410_nand_set
*to
;
1041 to
= kmemdup(from
, size
, GFP_KERNEL
);
1042 npd
->sets
= to
; /* set, even if we failed */
1045 printk(KERN_ERR
"%s: no memory for sets\n", __func__
);
1049 for (i
= 0; i
< npd
->nr_sets
; i
++) {
1050 ret
= s3c_nand_copy_set(to
);
1052 printk(KERN_ERR
"%s: failed to copy set %d\n",
1060 #endif /* CONFIG_S3C_DEV_NAND */
1064 #ifdef CONFIG_S3C_DEV_ONENAND
1065 static struct resource s3c_onenand_resources
[] = {
1066 [0] = DEFINE_RES_MEM(S3C_PA_ONENAND
, SZ_1K
),
1067 [1] = DEFINE_RES_MEM(S3C_PA_ONENAND_BUF
, S3C_SZ_ONENAND_BUF
),
1068 [2] = DEFINE_RES_IRQ(IRQ_ONENAND
),
1071 struct platform_device s3c_device_onenand
= {
1072 .name
= "samsung-onenand",
1074 .num_resources
= ARRAY_SIZE(s3c_onenand_resources
),
1075 .resource
= s3c_onenand_resources
,
1077 #endif /* CONFIG_S3C_DEV_ONENAND */
1079 #ifdef CONFIG_S3C64XX_DEV_ONENAND1
1080 static struct resource s3c64xx_onenand1_resources
[] = {
1081 [0] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1
, SZ_1K
),
1082 [1] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1_BUF
, S3C64XX_SZ_ONENAND1_BUF
),
1083 [2] = DEFINE_RES_IRQ(IRQ_ONENAND1
),
1086 struct platform_device s3c64xx_device_onenand1
= {
1087 .name
= "samsung-onenand",
1089 .num_resources
= ARRAY_SIZE(s3c64xx_onenand1_resources
),
1090 .resource
= s3c64xx_onenand1_resources
,
1093 void __init
s3c64xx_onenand1_set_platdata(struct onenand_platform_data
*pdata
)
1095 s3c_set_platdata(pdata
, sizeof(struct onenand_platform_data
),
1096 &s3c64xx_device_onenand1
);
1098 #endif /* CONFIG_S3C64XX_DEV_ONENAND1 */
1100 #ifdef CONFIG_S5P_DEV_ONENAND
1101 static struct resource s5p_onenand_resources
[] = {
1102 [0] = DEFINE_RES_MEM(S5P_PA_ONENAND
, SZ_128K
),
1103 [1] = DEFINE_RES_MEM(S5P_PA_ONENAND_DMA
, SZ_8K
),
1104 [2] = DEFINE_RES_IRQ(IRQ_ONENAND_AUDI
),
1107 struct platform_device s5p_device_onenand
= {
1108 .name
= "s5pc110-onenand",
1110 .num_resources
= ARRAY_SIZE(s5p_onenand_resources
),
1111 .resource
= s5p_onenand_resources
,
1113 #endif /* CONFIG_S5P_DEV_ONENAND */
1117 #ifdef CONFIG_PLAT_S5P
1118 static struct resource s5p_pmu_resource
[] = {
1119 DEFINE_RES_IRQ(IRQ_PMU
)
1122 static struct platform_device s5p_device_pmu
= {
1125 .num_resources
= ARRAY_SIZE(s5p_pmu_resource
),
1126 .resource
= s5p_pmu_resource
,
1129 static int __init
s5p_pmu_init(void)
1131 platform_device_register(&s5p_device_pmu
);
1134 arch_initcall(s5p_pmu_init
);
1135 #endif /* CONFIG_PLAT_S5P */
1139 #ifdef CONFIG_SAMSUNG_DEV_PWM
1141 #define TIMER_RESOURCE_SIZE (1)
1143 #define TIMER_RESOURCE(_tmr, _irq) \
1144 (struct resource [TIMER_RESOURCE_SIZE]) { \
1148 .flags = IORESOURCE_IRQ \
1152 #define DEFINE_S3C_TIMER(_tmr_no, _irq) \
1153 .name = "s3c24xx-pwm", \
1155 .num_resources = TIMER_RESOURCE_SIZE, \
1156 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
1159 * since we already have an static mapping for the timer,
1160 * we do not bother setting any IO resource for the base.
1163 struct platform_device s3c_device_timer
[] = {
1164 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0
) },
1165 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1
) },
1166 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2
) },
1167 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3
) },
1168 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4
) },
1170 #endif /* CONFIG_SAMSUNG_DEV_PWM */
1174 #ifdef CONFIG_PLAT_S3C24XX
1175 static struct resource s3c_rtc_resource
[] = {
1176 [0] = DEFINE_RES_MEM(S3C24XX_PA_RTC
, SZ_256
),
1177 [1] = DEFINE_RES_IRQ(IRQ_RTC
),
1178 [2] = DEFINE_RES_IRQ(IRQ_TICK
),
1181 struct platform_device s3c_device_rtc
= {
1182 .name
= "s3c2410-rtc",
1184 .num_resources
= ARRAY_SIZE(s3c_rtc_resource
),
1185 .resource
= s3c_rtc_resource
,
1187 #endif /* CONFIG_PLAT_S3C24XX */
1189 #ifdef CONFIG_S3C_DEV_RTC
1190 static struct resource s3c_rtc_resource
[] = {
1191 [0] = DEFINE_RES_MEM(S3C_PA_RTC
, SZ_256
),
1192 [1] = DEFINE_RES_IRQ(IRQ_RTC_ALARM
),
1193 [2] = DEFINE_RES_IRQ(IRQ_RTC_TIC
),
1196 struct platform_device s3c_device_rtc
= {
1197 .name
= "s3c64xx-rtc",
1199 .num_resources
= ARRAY_SIZE(s3c_rtc_resource
),
1200 .resource
= s3c_rtc_resource
,
1202 #endif /* CONFIG_S3C_DEV_RTC */
1206 #ifdef CONFIG_PLAT_S3C24XX
1207 static struct resource s3c_sdi_resource
[] = {
1208 [0] = DEFINE_RES_MEM(S3C24XX_PA_SDI
, S3C24XX_SZ_SDI
),
1209 [1] = DEFINE_RES_IRQ(IRQ_SDI
),
1212 struct platform_device s3c_device_sdi
= {
1213 .name
= "s3c2410-sdi",
1215 .num_resources
= ARRAY_SIZE(s3c_sdi_resource
),
1216 .resource
= s3c_sdi_resource
,
1219 void __init
s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata
*pdata
)
1221 s3c_set_platdata(pdata
, sizeof(struct s3c24xx_mci_pdata
),
1224 #endif /* CONFIG_PLAT_S3C24XX */
1228 #ifdef CONFIG_PLAT_S3C24XX
1229 static struct resource s3c_spi0_resource
[] = {
1230 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI
, SZ_32
),
1231 [1] = DEFINE_RES_IRQ(IRQ_SPI0
),
1234 struct platform_device s3c_device_spi0
= {
1235 .name
= "s3c2410-spi",
1237 .num_resources
= ARRAY_SIZE(s3c_spi0_resource
),
1238 .resource
= s3c_spi0_resource
,
1240 .dma_mask
= &samsung_device_dma_mask
,
1241 .coherent_dma_mask
= DMA_BIT_MASK(32),
1245 static struct resource s3c_spi1_resource
[] = {
1246 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI1
, SZ_32
),
1247 [1] = DEFINE_RES_IRQ(IRQ_SPI1
),
1250 struct platform_device s3c_device_spi1
= {
1251 .name
= "s3c2410-spi",
1253 .num_resources
= ARRAY_SIZE(s3c_spi1_resource
),
1254 .resource
= s3c_spi1_resource
,
1256 .dma_mask
= &samsung_device_dma_mask
,
1257 .coherent_dma_mask
= DMA_BIT_MASK(32),
1260 #endif /* CONFIG_PLAT_S3C24XX */
1264 #ifdef CONFIG_PLAT_S3C24XX
1265 static struct resource s3c_ts_resource
[] = {
1266 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC
, S3C24XX_SZ_ADC
),
1267 [1] = DEFINE_RES_IRQ(IRQ_TC
),
1270 struct platform_device s3c_device_ts
= {
1271 .name
= "s3c2410-ts",
1273 .dev
.parent
= &s3c_device_adc
.dev
,
1274 .num_resources
= ARRAY_SIZE(s3c_ts_resource
),
1275 .resource
= s3c_ts_resource
,
1278 void __init
s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info
*hard_s3c2410ts_info
)
1280 s3c_set_platdata(hard_s3c2410ts_info
,
1281 sizeof(struct s3c2410_ts_mach_info
), &s3c_device_ts
);
1283 #endif /* CONFIG_PLAT_S3C24XX */
1285 #ifdef CONFIG_SAMSUNG_DEV_TS
1286 static struct resource s3c_ts_resource
[] = {
1287 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC
, SZ_256
),
1288 [1] = DEFINE_RES_IRQ(IRQ_TC
),
1291 static struct s3c2410_ts_mach_info default_ts_data __initdata
= {
1294 .oversampling_shift
= 2,
1297 struct platform_device s3c_device_ts
= {
1298 .name
= "s3c64xx-ts",
1300 .num_resources
= ARRAY_SIZE(s3c_ts_resource
),
1301 .resource
= s3c_ts_resource
,
1304 void __init
s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info
*pd
)
1307 pd
= &default_ts_data
;
1309 s3c_set_platdata(pd
, sizeof(struct s3c2410_ts_mach_info
),
1312 #endif /* CONFIG_SAMSUNG_DEV_TS */
1316 #ifdef CONFIG_S5P_DEV_TV
1318 static struct resource s5p_hdmi_resources
[] = {
1319 [0] = DEFINE_RES_MEM(S5P_PA_HDMI
, SZ_1M
),
1320 [1] = DEFINE_RES_IRQ(IRQ_HDMI
),
1323 struct platform_device s5p_device_hdmi
= {
1326 .num_resources
= ARRAY_SIZE(s5p_hdmi_resources
),
1327 .resource
= s5p_hdmi_resources
,
1330 static struct resource s5p_sdo_resources
[] = {
1331 [0] = DEFINE_RES_MEM(S5P_PA_SDO
, SZ_64K
),
1332 [1] = DEFINE_RES_IRQ(IRQ_SDO
),
1335 struct platform_device s5p_device_sdo
= {
1338 .num_resources
= ARRAY_SIZE(s5p_sdo_resources
),
1339 .resource
= s5p_sdo_resources
,
1342 static struct resource s5p_mixer_resources
[] = {
1343 [0] = DEFINE_RES_MEM_NAMED(S5P_PA_MIXER
, SZ_64K
, "mxr"),
1344 [1] = DEFINE_RES_MEM_NAMED(S5P_PA_VP
, SZ_64K
, "vp"),
1345 [2] = DEFINE_RES_IRQ_NAMED(IRQ_MIXER
, "irq"),
1348 struct platform_device s5p_device_mixer
= {
1349 .name
= "s5p-mixer",
1351 .num_resources
= ARRAY_SIZE(s5p_mixer_resources
),
1352 .resource
= s5p_mixer_resources
,
1354 .dma_mask
= &samsung_device_dma_mask
,
1355 .coherent_dma_mask
= DMA_BIT_MASK(32),
1358 #endif /* CONFIG_S5P_DEV_TV */
1362 #ifdef CONFIG_S3C_DEV_USB_HOST
1363 static struct resource s3c_usb_resource
[] = {
1364 [0] = DEFINE_RES_MEM(S3C_PA_USBHOST
, SZ_256
),
1365 [1] = DEFINE_RES_IRQ(IRQ_USBH
),
1368 struct platform_device s3c_device_ohci
= {
1369 .name
= "s3c2410-ohci",
1371 .num_resources
= ARRAY_SIZE(s3c_usb_resource
),
1372 .resource
= s3c_usb_resource
,
1374 .dma_mask
= &samsung_device_dma_mask
,
1375 .coherent_dma_mask
= DMA_BIT_MASK(32),
1380 * s3c_ohci_set_platdata - initialise OHCI device platform data
1381 * @info: The platform data.
1383 * This call copies the @info passed in and sets the device .platform_data
1384 * field to that copy. The @info is copied so that the original can be marked
1388 void __init
s3c_ohci_set_platdata(struct s3c2410_hcd_info
*info
)
1390 s3c_set_platdata(info
, sizeof(struct s3c2410_hcd_info
),
1393 #endif /* CONFIG_S3C_DEV_USB_HOST */
1395 /* USB Device (Gadget) */
1397 #ifdef CONFIG_PLAT_S3C24XX
1398 static struct resource s3c_usbgadget_resource
[] = {
1399 [0] = DEFINE_RES_MEM(S3C24XX_PA_USBDEV
, S3C24XX_SZ_USBDEV
),
1400 [1] = DEFINE_RES_IRQ(IRQ_USBD
),
1403 struct platform_device s3c_device_usbgadget
= {
1404 .name
= "s3c2410-usbgadget",
1406 .num_resources
= ARRAY_SIZE(s3c_usbgadget_resource
),
1407 .resource
= s3c_usbgadget_resource
,
1410 void __init
s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info
*pd
)
1412 s3c_set_platdata(pd
, sizeof(*pd
), &s3c_device_usbgadget
);
1414 #endif /* CONFIG_PLAT_S3C24XX */
1416 /* USB EHCI Host Controller */
1418 #ifdef CONFIG_S5P_DEV_USB_EHCI
1419 static struct resource s5p_ehci_resource
[] = {
1420 [0] = DEFINE_RES_MEM(S5P_PA_EHCI
, SZ_256
),
1421 [1] = DEFINE_RES_IRQ(IRQ_USB_HOST
),
1424 struct platform_device s5p_device_ehci
= {
1427 .num_resources
= ARRAY_SIZE(s5p_ehci_resource
),
1428 .resource
= s5p_ehci_resource
,
1430 .dma_mask
= &samsung_device_dma_mask
,
1431 .coherent_dma_mask
= DMA_BIT_MASK(32),
1435 void __init
s5p_ehci_set_platdata(struct s5p_ehci_platdata
*pd
)
1437 struct s5p_ehci_platdata
*npd
;
1439 npd
= s3c_set_platdata(pd
, sizeof(struct s5p_ehci_platdata
),
1443 npd
->phy_init
= s5p_usb_phy_init
;
1445 npd
->phy_exit
= s5p_usb_phy_exit
;
1447 #endif /* CONFIG_S5P_DEV_USB_EHCI */
1451 #ifdef CONFIG_S3C_DEV_USB_HSOTG
1452 static struct resource s3c_usb_hsotg_resources
[] = {
1453 [0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG
, SZ_128K
),
1454 [1] = DEFINE_RES_IRQ(IRQ_OTG
),
1457 struct platform_device s3c_device_usb_hsotg
= {
1458 .name
= "s3c-hsotg",
1460 .num_resources
= ARRAY_SIZE(s3c_usb_hsotg_resources
),
1461 .resource
= s3c_usb_hsotg_resources
,
1463 .dma_mask
= &samsung_device_dma_mask
,
1464 .coherent_dma_mask
= DMA_BIT_MASK(32),
1468 void __init
s3c_hsotg_set_platdata(struct s3c_hsotg_plat
*pd
)
1470 struct s3c_hsotg_plat
*npd
;
1472 npd
= s3c_set_platdata(pd
, sizeof(struct s3c_hsotg_plat
),
1473 &s3c_device_usb_hsotg
);
1476 npd
->phy_init
= s5p_usb_phy_init
;
1478 npd
->phy_exit
= s5p_usb_phy_exit
;
1480 #endif /* CONFIG_S3C_DEV_USB_HSOTG */
1482 /* USB High Spped 2.0 Device (Gadget) */
1484 #ifdef CONFIG_PLAT_S3C24XX
1485 static struct resource s3c_hsudc_resource
[] = {
1486 [0] = DEFINE_RES_MEM(S3C2416_PA_HSUDC
, S3C2416_SZ_HSUDC
),
1487 [1] = DEFINE_RES_IRQ(IRQ_USBD
),
1490 struct platform_device s3c_device_usb_hsudc
= {
1491 .name
= "s3c-hsudc",
1493 .num_resources
= ARRAY_SIZE(s3c_hsudc_resource
),
1494 .resource
= s3c_hsudc_resource
,
1496 .dma_mask
= &samsung_device_dma_mask
,
1497 .coherent_dma_mask
= DMA_BIT_MASK(32),
1501 void __init
s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata
*pd
)
1503 s3c_set_platdata(pd
, sizeof(*pd
), &s3c_device_usb_hsudc
);
1505 #endif /* CONFIG_PLAT_S3C24XX */
1509 #ifdef CONFIG_S3C_DEV_WDT
1510 static struct resource s3c_wdt_resource
[] = {
1511 [0] = DEFINE_RES_MEM(S3C_PA_WDT
, SZ_1K
),
1512 [1] = DEFINE_RES_IRQ(IRQ_WDT
),
1515 struct platform_device s3c_device_wdt
= {
1516 .name
= "s3c2410-wdt",
1518 .num_resources
= ARRAY_SIZE(s3c_wdt_resource
),
1519 .resource
= s3c_wdt_resource
,
1521 #endif /* CONFIG_S3C_DEV_WDT */
1523 #ifdef CONFIG_S3C64XX_DEV_SPI0
1524 static struct resource s3c64xx_spi0_resource
[] = {
1525 [0] = DEFINE_RES_MEM(S3C_PA_SPI0
, SZ_256
),
1526 [1] = DEFINE_RES_DMA(DMACH_SPI0_TX
),
1527 [2] = DEFINE_RES_DMA(DMACH_SPI0_RX
),
1528 [3] = DEFINE_RES_IRQ(IRQ_SPI0
),
1531 struct platform_device s3c64xx_device_spi0
= {
1532 .name
= "s3c6410-spi",
1534 .num_resources
= ARRAY_SIZE(s3c64xx_spi0_resource
),
1535 .resource
= s3c64xx_spi0_resource
,
1537 .dma_mask
= &samsung_device_dma_mask
,
1538 .coherent_dma_mask
= DMA_BIT_MASK(32),
1542 void __init
s3c64xx_spi0_set_platdata(int (*cfg_gpio
)(void), int src_clk_nr
,
1545 struct s3c64xx_spi_info pd
;
1547 /* Reject invalid configuration */
1548 if (!num_cs
|| src_clk_nr
< 0) {
1549 pr_err("%s: Invalid SPI configuration\n", __func__
);
1554 pd
.src_clk_nr
= src_clk_nr
;
1555 pd
.cfg_gpio
= (cfg_gpio
) ? cfg_gpio
: s3c64xx_spi0_cfg_gpio
;
1556 #ifdef CONFIG_PL330_DMA
1557 pd
.filter
= pl330_filter
;
1560 s3c_set_platdata(&pd
, sizeof(pd
), &s3c64xx_device_spi0
);
1562 #endif /* CONFIG_S3C64XX_DEV_SPI0 */
1564 #ifdef CONFIG_S3C64XX_DEV_SPI1
1565 static struct resource s3c64xx_spi1_resource
[] = {
1566 [0] = DEFINE_RES_MEM(S3C_PA_SPI1
, SZ_256
),
1567 [1] = DEFINE_RES_DMA(DMACH_SPI1_TX
),
1568 [2] = DEFINE_RES_DMA(DMACH_SPI1_RX
),
1569 [3] = DEFINE_RES_IRQ(IRQ_SPI1
),
1572 struct platform_device s3c64xx_device_spi1
= {
1573 .name
= "s3c6410-spi",
1575 .num_resources
= ARRAY_SIZE(s3c64xx_spi1_resource
),
1576 .resource
= s3c64xx_spi1_resource
,
1578 .dma_mask
= &samsung_device_dma_mask
,
1579 .coherent_dma_mask
= DMA_BIT_MASK(32),
1583 void __init
s3c64xx_spi1_set_platdata(int (*cfg_gpio
)(void), int src_clk_nr
,
1586 struct s3c64xx_spi_info pd
;
1588 /* Reject invalid configuration */
1589 if (!num_cs
|| src_clk_nr
< 0) {
1590 pr_err("%s: Invalid SPI configuration\n", __func__
);
1595 pd
.src_clk_nr
= src_clk_nr
;
1596 pd
.cfg_gpio
= (cfg_gpio
) ? cfg_gpio
: s3c64xx_spi1_cfg_gpio
;
1597 #ifdef CONFIG_PL330_DMA
1598 pd
.filter
= pl330_filter
;
1601 s3c_set_platdata(&pd
, sizeof(pd
), &s3c64xx_device_spi1
);
1603 #endif /* CONFIG_S3C64XX_DEV_SPI1 */
1605 #ifdef CONFIG_S3C64XX_DEV_SPI2
1606 static struct resource s3c64xx_spi2_resource
[] = {
1607 [0] = DEFINE_RES_MEM(S3C_PA_SPI2
, SZ_256
),
1608 [1] = DEFINE_RES_DMA(DMACH_SPI2_TX
),
1609 [2] = DEFINE_RES_DMA(DMACH_SPI2_RX
),
1610 [3] = DEFINE_RES_IRQ(IRQ_SPI2
),
1613 struct platform_device s3c64xx_device_spi2
= {
1614 .name
= "s3c6410-spi",
1616 .num_resources
= ARRAY_SIZE(s3c64xx_spi2_resource
),
1617 .resource
= s3c64xx_spi2_resource
,
1619 .dma_mask
= &samsung_device_dma_mask
,
1620 .coherent_dma_mask
= DMA_BIT_MASK(32),
1624 void __init
s3c64xx_spi2_set_platdata(int (*cfg_gpio
)(void), int src_clk_nr
,
1627 struct s3c64xx_spi_info pd
;
1629 /* Reject invalid configuration */
1630 if (!num_cs
|| src_clk_nr
< 0) {
1631 pr_err("%s: Invalid SPI configuration\n", __func__
);
1636 pd
.src_clk_nr
= src_clk_nr
;
1637 pd
.cfg_gpio
= (cfg_gpio
) ? cfg_gpio
: s3c64xx_spi2_cfg_gpio
;
1638 #ifdef CONFIG_PL330_DMA
1639 pd
.filter
= pl330_filter
;
1642 s3c_set_platdata(&pd
, sizeof(pd
), &s3c64xx_device_spi2
);
1644 #endif /* CONFIG_S3C64XX_DEV_SPI2 */