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/kernel.h>
14 #include <linux/types.h>
15 #include <linux/interrupt.h>
16 #include <linux/list.h>
17 #include <linux/timer.h>
18 #include <linux/init.h>
19 #include <linux/serial_core.h>
20 #include <linux/platform_device.h>
22 #include <linux/slab.h>
23 #include <linux/string.h>
24 #include <linux/dma-mapping.h>
26 #include <linux/gfp.h>
27 #include <linux/mtd/mtd.h>
28 #include <linux/mtd/onenand.h>
29 #include <linux/mtd/partitions.h>
30 #include <linux/mmc/host.h>
31 #include <linux/ioport.h>
32 #include <linux/platform_data/s3c-hsudc.h>
33 #include <linux/platform_data/s3c-hsotg.h>
35 #include <media/s5p_hdmi.h>
38 #include <asm/mach/arch.h>
39 #include <asm/mach/map.h>
40 #include <asm/mach/irq.h>
42 #include <mach/hardware.h>
44 #include <mach/irqs.h>
48 #include <plat/devs.h>
50 #include <linux/platform_data/ata-samsung_cf.h>
51 #include <linux/platform_data/usb-ehci-s5p.h>
53 #include <plat/fb-s3c2410.h>
54 #include <plat/hdmi.h>
55 #include <linux/platform_data/hwmon-s3c.h>
56 #include <linux/platform_data/i2c-s3c2410.h>
57 #include <plat/keypad.h>
58 #include <linux/platform_data/mmc-s3cmci.h>
59 #include <linux/platform_data/mtd-nand-s3c2410.h>
60 #include <plat/sdhci.h>
61 #include <linux/platform_data/touchscreen-s3c2410.h>
62 #include <linux/platform_data/usb-s3c2410_udc.h>
63 #include <linux/platform_data/usb-ohci-s3c2410.h>
64 #include <plat/usb-phy.h>
65 #include <plat/regs-iic.h>
66 #include <plat/regs-serial.h>
67 #include <plat/regs-spi.h>
68 #include <linux/platform_data/spi-s3c64xx.h>
70 static u64 samsung_device_dma_mask
= DMA_BIT_MASK(32);
73 #ifdef CONFIG_CPU_S3C2440
74 static struct resource s3c_ac97_resource
[] = {
75 [0] = DEFINE_RES_MEM(S3C2440_PA_AC97
, S3C2440_SZ_AC97
),
76 [1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97
),
77 [2] = DEFINE_RES_DMA_NAMED(DMACH_PCM_OUT
, "PCM out"),
78 [3] = DEFINE_RES_DMA_NAMED(DMACH_PCM_IN
, "PCM in"),
79 [4] = DEFINE_RES_DMA_NAMED(DMACH_MIC_IN
, "Mic in"),
82 struct platform_device s3c_device_ac97
= {
83 .name
= "samsung-ac97",
85 .num_resources
= ARRAY_SIZE(s3c_ac97_resource
),
86 .resource
= s3c_ac97_resource
,
88 .dma_mask
= &samsung_device_dma_mask
,
89 .coherent_dma_mask
= DMA_BIT_MASK(32),
92 #endif /* CONFIG_CPU_S3C2440 */
96 #ifdef CONFIG_PLAT_S3C24XX
97 static struct resource s3c_adc_resource
[] = {
98 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC
, S3C24XX_SZ_ADC
),
99 [1] = DEFINE_RES_IRQ(IRQ_TC
),
100 [2] = DEFINE_RES_IRQ(IRQ_ADC
),
103 struct platform_device s3c_device_adc
= {
104 .name
= "s3c24xx-adc",
106 .num_resources
= ARRAY_SIZE(s3c_adc_resource
),
107 .resource
= s3c_adc_resource
,
109 #endif /* CONFIG_PLAT_S3C24XX */
111 #if defined(CONFIG_SAMSUNG_DEV_ADC)
112 static struct resource s3c_adc_resource
[] = {
113 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC
, SZ_256
),
114 [1] = DEFINE_RES_IRQ(IRQ_TC
),
115 [2] = DEFINE_RES_IRQ(IRQ_ADC
),
118 struct platform_device s3c_device_adc
= {
119 .name
= "samsung-adc",
121 .num_resources
= ARRAY_SIZE(s3c_adc_resource
),
122 .resource
= s3c_adc_resource
,
124 #endif /* CONFIG_SAMSUNG_DEV_ADC */
126 /* Camif Controller */
128 #ifdef CONFIG_CPU_S3C2440
129 static struct resource s3c_camif_resource
[] = {
130 [0] = DEFINE_RES_MEM(S3C2440_PA_CAMIF
, S3C2440_SZ_CAMIF
),
131 [1] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_C
),
132 [2] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_P
),
135 struct platform_device s3c_device_camif
= {
136 .name
= "s3c2440-camif",
138 .num_resources
= ARRAY_SIZE(s3c_camif_resource
),
139 .resource
= s3c_camif_resource
,
141 .dma_mask
= &samsung_device_dma_mask
,
142 .coherent_dma_mask
= DMA_BIT_MASK(32),
145 #endif /* CONFIG_CPU_S3C2440 */
149 struct platform_device samsung_asoc_idma
= {
150 .name
= "samsung-idma",
153 .dma_mask
= &samsung_device_dma_mask
,
154 .coherent_dma_mask
= DMA_BIT_MASK(32),
160 #ifdef CONFIG_S3C_DEV_FB
161 static struct resource s3c_fb_resource
[] = {
162 [0] = DEFINE_RES_MEM(S3C_PA_FB
, SZ_16K
),
163 [1] = DEFINE_RES_IRQ(IRQ_LCD_VSYNC
),
164 [2] = DEFINE_RES_IRQ(IRQ_LCD_FIFO
),
165 [3] = DEFINE_RES_IRQ(IRQ_LCD_SYSTEM
),
168 struct platform_device s3c_device_fb
= {
171 .num_resources
= ARRAY_SIZE(s3c_fb_resource
),
172 .resource
= s3c_fb_resource
,
174 .dma_mask
= &samsung_device_dma_mask
,
175 .coherent_dma_mask
= DMA_BIT_MASK(32),
179 void __init
s3c_fb_set_platdata(struct s3c_fb_platdata
*pd
)
181 s3c_set_platdata(pd
, sizeof(struct s3c_fb_platdata
),
184 #endif /* CONFIG_S3C_DEV_FB */
188 #ifdef CONFIG_S5P_DEV_FIMC0
189 static struct resource s5p_fimc0_resource
[] = {
190 [0] = DEFINE_RES_MEM(S5P_PA_FIMC0
, SZ_4K
),
191 [1] = DEFINE_RES_IRQ(IRQ_FIMC0
),
194 struct platform_device s5p_device_fimc0
= {
197 .num_resources
= ARRAY_SIZE(s5p_fimc0_resource
),
198 .resource
= s5p_fimc0_resource
,
200 .dma_mask
= &samsung_device_dma_mask
,
201 .coherent_dma_mask
= DMA_BIT_MASK(32),
205 struct platform_device s5p_device_fimc_md
= {
206 .name
= "s5p-fimc-md",
209 #endif /* CONFIG_S5P_DEV_FIMC0 */
211 #ifdef CONFIG_S5P_DEV_FIMC1
212 static struct resource s5p_fimc1_resource
[] = {
213 [0] = DEFINE_RES_MEM(S5P_PA_FIMC1
, SZ_4K
),
214 [1] = DEFINE_RES_IRQ(IRQ_FIMC1
),
217 struct platform_device s5p_device_fimc1
= {
220 .num_resources
= ARRAY_SIZE(s5p_fimc1_resource
),
221 .resource
= s5p_fimc1_resource
,
223 .dma_mask
= &samsung_device_dma_mask
,
224 .coherent_dma_mask
= DMA_BIT_MASK(32),
227 #endif /* CONFIG_S5P_DEV_FIMC1 */
229 #ifdef CONFIG_S5P_DEV_FIMC2
230 static struct resource s5p_fimc2_resource
[] = {
231 [0] = DEFINE_RES_MEM(S5P_PA_FIMC2
, SZ_4K
),
232 [1] = DEFINE_RES_IRQ(IRQ_FIMC2
),
235 struct platform_device s5p_device_fimc2
= {
238 .num_resources
= ARRAY_SIZE(s5p_fimc2_resource
),
239 .resource
= s5p_fimc2_resource
,
241 .dma_mask
= &samsung_device_dma_mask
,
242 .coherent_dma_mask
= DMA_BIT_MASK(32),
245 #endif /* CONFIG_S5P_DEV_FIMC2 */
247 #ifdef CONFIG_S5P_DEV_FIMC3
248 static struct resource s5p_fimc3_resource
[] = {
249 [0] = DEFINE_RES_MEM(S5P_PA_FIMC3
, SZ_4K
),
250 [1] = DEFINE_RES_IRQ(IRQ_FIMC3
),
253 struct platform_device s5p_device_fimc3
= {
256 .num_resources
= ARRAY_SIZE(s5p_fimc3_resource
),
257 .resource
= s5p_fimc3_resource
,
259 .dma_mask
= &samsung_device_dma_mask
,
260 .coherent_dma_mask
= DMA_BIT_MASK(32),
263 #endif /* CONFIG_S5P_DEV_FIMC3 */
267 #ifdef CONFIG_S5P_DEV_G2D
268 static struct resource s5p_g2d_resource
[] = {
269 [0] = DEFINE_RES_MEM(S5P_PA_G2D
, SZ_4K
),
270 [1] = DEFINE_RES_IRQ(IRQ_2D
),
273 struct platform_device s5p_device_g2d
= {
276 .num_resources
= ARRAY_SIZE(s5p_g2d_resource
),
277 .resource
= s5p_g2d_resource
,
279 .dma_mask
= &samsung_device_dma_mask
,
280 .coherent_dma_mask
= DMA_BIT_MASK(32),
283 #endif /* CONFIG_S5P_DEV_G2D */
285 #ifdef CONFIG_S5P_DEV_JPEG
286 static struct resource s5p_jpeg_resource
[] = {
287 [0] = DEFINE_RES_MEM(S5P_PA_JPEG
, SZ_4K
),
288 [1] = DEFINE_RES_IRQ(IRQ_JPEG
),
291 struct platform_device s5p_device_jpeg
= {
294 .num_resources
= ARRAY_SIZE(s5p_jpeg_resource
),
295 .resource
= s5p_jpeg_resource
,
297 .dma_mask
= &samsung_device_dma_mask
,
298 .coherent_dma_mask
= DMA_BIT_MASK(32),
301 #endif /* CONFIG_S5P_DEV_JPEG */
305 #ifdef CONFIG_S5P_DEV_FIMD0
306 static struct resource s5p_fimd0_resource
[] = {
307 [0] = DEFINE_RES_MEM(S5P_PA_FIMD0
, SZ_32K
),
308 [1] = DEFINE_RES_IRQ(IRQ_FIMD0_VSYNC
),
309 [2] = DEFINE_RES_IRQ(IRQ_FIMD0_FIFO
),
310 [3] = DEFINE_RES_IRQ(IRQ_FIMD0_SYSTEM
),
313 struct platform_device s5p_device_fimd0
= {
316 .num_resources
= ARRAY_SIZE(s5p_fimd0_resource
),
317 .resource
= s5p_fimd0_resource
,
319 .dma_mask
= &samsung_device_dma_mask
,
320 .coherent_dma_mask
= DMA_BIT_MASK(32),
324 void __init
s5p_fimd0_set_platdata(struct s3c_fb_platdata
*pd
)
326 s3c_set_platdata(pd
, sizeof(struct s3c_fb_platdata
),
329 #endif /* CONFIG_S5P_DEV_FIMD0 */
333 #ifdef CONFIG_S3C_DEV_HWMON
334 struct platform_device s3c_device_hwmon
= {
337 .dev
.parent
= &s3c_device_adc
.dev
,
340 void __init
s3c_hwmon_set_platdata(struct s3c_hwmon_pdata
*pd
)
342 s3c_set_platdata(pd
, sizeof(struct s3c_hwmon_pdata
),
345 #endif /* CONFIG_S3C_DEV_HWMON */
349 #ifdef CONFIG_S3C_DEV_HSMMC
350 static struct resource s3c_hsmmc_resource
[] = {
351 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC0
, SZ_4K
),
352 [1] = DEFINE_RES_IRQ(IRQ_HSMMC0
),
355 struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata
= {
357 .host_caps
= (MMC_CAP_4_BIT_DATA
|
358 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
361 struct platform_device s3c_device_hsmmc0
= {
364 .num_resources
= ARRAY_SIZE(s3c_hsmmc_resource
),
365 .resource
= s3c_hsmmc_resource
,
367 .dma_mask
= &samsung_device_dma_mask
,
368 .coherent_dma_mask
= DMA_BIT_MASK(32),
369 .platform_data
= &s3c_hsmmc0_def_platdata
,
373 void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata
*pd
)
375 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc0_def_platdata
);
377 #endif /* CONFIG_S3C_DEV_HSMMC */
379 #ifdef CONFIG_S3C_DEV_HSMMC1
380 static struct resource s3c_hsmmc1_resource
[] = {
381 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC1
, SZ_4K
),
382 [1] = DEFINE_RES_IRQ(IRQ_HSMMC1
),
385 struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata
= {
387 .host_caps
= (MMC_CAP_4_BIT_DATA
|
388 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
391 struct platform_device s3c_device_hsmmc1
= {
394 .num_resources
= ARRAY_SIZE(s3c_hsmmc1_resource
),
395 .resource
= s3c_hsmmc1_resource
,
397 .dma_mask
= &samsung_device_dma_mask
,
398 .coherent_dma_mask
= DMA_BIT_MASK(32),
399 .platform_data
= &s3c_hsmmc1_def_platdata
,
403 void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata
*pd
)
405 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc1_def_platdata
);
407 #endif /* CONFIG_S3C_DEV_HSMMC1 */
411 #ifdef CONFIG_S3C_DEV_HSMMC2
412 static struct resource s3c_hsmmc2_resource
[] = {
413 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC2
, SZ_4K
),
414 [1] = DEFINE_RES_IRQ(IRQ_HSMMC2
),
417 struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata
= {
419 .host_caps
= (MMC_CAP_4_BIT_DATA
|
420 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
423 struct platform_device s3c_device_hsmmc2
= {
426 .num_resources
= ARRAY_SIZE(s3c_hsmmc2_resource
),
427 .resource
= s3c_hsmmc2_resource
,
429 .dma_mask
= &samsung_device_dma_mask
,
430 .coherent_dma_mask
= DMA_BIT_MASK(32),
431 .platform_data
= &s3c_hsmmc2_def_platdata
,
435 void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata
*pd
)
437 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc2_def_platdata
);
439 #endif /* CONFIG_S3C_DEV_HSMMC2 */
441 #ifdef CONFIG_S3C_DEV_HSMMC3
442 static struct resource s3c_hsmmc3_resource
[] = {
443 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC3
, SZ_4K
),
444 [1] = DEFINE_RES_IRQ(IRQ_HSMMC3
),
447 struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata
= {
449 .host_caps
= (MMC_CAP_4_BIT_DATA
|
450 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
453 struct platform_device s3c_device_hsmmc3
= {
456 .num_resources
= ARRAY_SIZE(s3c_hsmmc3_resource
),
457 .resource
= s3c_hsmmc3_resource
,
459 .dma_mask
= &samsung_device_dma_mask
,
460 .coherent_dma_mask
= DMA_BIT_MASK(32),
461 .platform_data
= &s3c_hsmmc3_def_platdata
,
465 void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata
*pd
)
467 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc3_def_platdata
);
469 #endif /* CONFIG_S3C_DEV_HSMMC3 */
473 static struct resource s3c_i2c0_resource
[] = {
474 [0] = DEFINE_RES_MEM(S3C_PA_IIC
, SZ_4K
),
475 [1] = DEFINE_RES_IRQ(IRQ_IIC
),
478 struct platform_device s3c_device_i2c0
= {
479 .name
= "s3c2410-i2c",
481 .num_resources
= ARRAY_SIZE(s3c_i2c0_resource
),
482 .resource
= s3c_i2c0_resource
,
485 struct s3c2410_platform_i2c default_i2c_data __initdata
= {
488 .frequency
= 100*1000,
492 void __init
s3c_i2c0_set_platdata(struct s3c2410_platform_i2c
*pd
)
494 struct s3c2410_platform_i2c
*npd
;
497 pd
= &default_i2c_data
;
501 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
505 npd
->cfg_gpio
= s3c_i2c0_cfg_gpio
;
508 #ifdef CONFIG_S3C_DEV_I2C1
509 static struct resource s3c_i2c1_resource
[] = {
510 [0] = DEFINE_RES_MEM(S3C_PA_IIC1
, SZ_4K
),
511 [1] = DEFINE_RES_IRQ(IRQ_IIC1
),
514 struct platform_device s3c_device_i2c1
= {
515 .name
= "s3c2410-i2c",
517 .num_resources
= ARRAY_SIZE(s3c_i2c1_resource
),
518 .resource
= s3c_i2c1_resource
,
521 void __init
s3c_i2c1_set_platdata(struct s3c2410_platform_i2c
*pd
)
523 struct s3c2410_platform_i2c
*npd
;
526 pd
= &default_i2c_data
;
530 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
534 npd
->cfg_gpio
= s3c_i2c1_cfg_gpio
;
536 #endif /* CONFIG_S3C_DEV_I2C1 */
538 #ifdef CONFIG_S3C_DEV_I2C2
539 static struct resource s3c_i2c2_resource
[] = {
540 [0] = DEFINE_RES_MEM(S3C_PA_IIC2
, SZ_4K
),
541 [1] = DEFINE_RES_IRQ(IRQ_IIC2
),
544 struct platform_device s3c_device_i2c2
= {
545 .name
= "s3c2410-i2c",
547 .num_resources
= ARRAY_SIZE(s3c_i2c2_resource
),
548 .resource
= s3c_i2c2_resource
,
551 void __init
s3c_i2c2_set_platdata(struct s3c2410_platform_i2c
*pd
)
553 struct s3c2410_platform_i2c
*npd
;
556 pd
= &default_i2c_data
;
560 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
564 npd
->cfg_gpio
= s3c_i2c2_cfg_gpio
;
566 #endif /* CONFIG_S3C_DEV_I2C2 */
568 #ifdef CONFIG_S3C_DEV_I2C3
569 static struct resource s3c_i2c3_resource
[] = {
570 [0] = DEFINE_RES_MEM(S3C_PA_IIC3
, SZ_4K
),
571 [1] = DEFINE_RES_IRQ(IRQ_IIC3
),
574 struct platform_device s3c_device_i2c3
= {
575 .name
= "s3c2440-i2c",
577 .num_resources
= ARRAY_SIZE(s3c_i2c3_resource
),
578 .resource
= s3c_i2c3_resource
,
581 void __init
s3c_i2c3_set_platdata(struct s3c2410_platform_i2c
*pd
)
583 struct s3c2410_platform_i2c
*npd
;
586 pd
= &default_i2c_data
;
590 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
594 npd
->cfg_gpio
= s3c_i2c3_cfg_gpio
;
596 #endif /*CONFIG_S3C_DEV_I2C3 */
598 #ifdef CONFIG_S3C_DEV_I2C4
599 static struct resource s3c_i2c4_resource
[] = {
600 [0] = DEFINE_RES_MEM(S3C_PA_IIC4
, SZ_4K
),
601 [1] = DEFINE_RES_IRQ(IRQ_IIC4
),
604 struct platform_device s3c_device_i2c4
= {
605 .name
= "s3c2440-i2c",
607 .num_resources
= ARRAY_SIZE(s3c_i2c4_resource
),
608 .resource
= s3c_i2c4_resource
,
611 void __init
s3c_i2c4_set_platdata(struct s3c2410_platform_i2c
*pd
)
613 struct s3c2410_platform_i2c
*npd
;
616 pd
= &default_i2c_data
;
620 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
624 npd
->cfg_gpio
= s3c_i2c4_cfg_gpio
;
626 #endif /*CONFIG_S3C_DEV_I2C4 */
628 #ifdef CONFIG_S3C_DEV_I2C5
629 static struct resource s3c_i2c5_resource
[] = {
630 [0] = DEFINE_RES_MEM(S3C_PA_IIC5
, SZ_4K
),
631 [1] = DEFINE_RES_IRQ(IRQ_IIC5
),
634 struct platform_device s3c_device_i2c5
= {
635 .name
= "s3c2440-i2c",
637 .num_resources
= ARRAY_SIZE(s3c_i2c5_resource
),
638 .resource
= s3c_i2c5_resource
,
641 void __init
s3c_i2c5_set_platdata(struct s3c2410_platform_i2c
*pd
)
643 struct s3c2410_platform_i2c
*npd
;
646 pd
= &default_i2c_data
;
650 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
654 npd
->cfg_gpio
= s3c_i2c5_cfg_gpio
;
656 #endif /*CONFIG_S3C_DEV_I2C5 */
658 #ifdef CONFIG_S3C_DEV_I2C6
659 static struct resource s3c_i2c6_resource
[] = {
660 [0] = DEFINE_RES_MEM(S3C_PA_IIC6
, SZ_4K
),
661 [1] = DEFINE_RES_IRQ(IRQ_IIC6
),
664 struct platform_device s3c_device_i2c6
= {
665 .name
= "s3c2440-i2c",
667 .num_resources
= ARRAY_SIZE(s3c_i2c6_resource
),
668 .resource
= s3c_i2c6_resource
,
671 void __init
s3c_i2c6_set_platdata(struct s3c2410_platform_i2c
*pd
)
673 struct s3c2410_platform_i2c
*npd
;
676 pd
= &default_i2c_data
;
680 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
684 npd
->cfg_gpio
= s3c_i2c6_cfg_gpio
;
686 #endif /* CONFIG_S3C_DEV_I2C6 */
688 #ifdef CONFIG_S3C_DEV_I2C7
689 static struct resource s3c_i2c7_resource
[] = {
690 [0] = DEFINE_RES_MEM(S3C_PA_IIC7
, SZ_4K
),
691 [1] = DEFINE_RES_IRQ(IRQ_IIC7
),
694 struct platform_device s3c_device_i2c7
= {
695 .name
= "s3c2440-i2c",
697 .num_resources
= ARRAY_SIZE(s3c_i2c7_resource
),
698 .resource
= s3c_i2c7_resource
,
701 void __init
s3c_i2c7_set_platdata(struct s3c2410_platform_i2c
*pd
)
703 struct s3c2410_platform_i2c
*npd
;
706 pd
= &default_i2c_data
;
710 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
714 npd
->cfg_gpio
= s3c_i2c7_cfg_gpio
;
716 #endif /* CONFIG_S3C_DEV_I2C7 */
720 #ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
721 static struct resource s5p_i2c_resource
[] = {
722 [0] = DEFINE_RES_MEM(S5P_PA_IIC_HDMIPHY
, SZ_4K
),
723 [1] = DEFINE_RES_IRQ(IRQ_IIC_HDMIPHY
),
726 struct platform_device s5p_device_i2c_hdmiphy
= {
727 .name
= "s3c2440-hdmiphy-i2c",
729 .num_resources
= ARRAY_SIZE(s5p_i2c_resource
),
730 .resource
= s5p_i2c_resource
,
733 void __init
s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c
*pd
)
735 struct s3c2410_platform_i2c
*npd
;
738 pd
= &default_i2c_data
;
740 if (soc_is_exynos4210() ||
741 soc_is_exynos4212() || soc_is_exynos4412())
743 else if (soc_is_s5pv210())
749 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
750 &s5p_device_i2c_hdmiphy
);
753 static struct s5p_hdmi_platform_data s5p_hdmi_def_platdata
;
755 void __init
s5p_hdmi_set_platdata(struct i2c_board_info
*hdmiphy_info
,
756 struct i2c_board_info
*mhl_info
, int mhl_bus
)
758 struct s5p_hdmi_platform_data
*pd
= &s5p_hdmi_def_platdata
;
760 if (soc_is_exynos4210() ||
761 soc_is_exynos4212() || soc_is_exynos4412())
763 else if (soc_is_s5pv210())
768 pd
->hdmiphy_info
= hdmiphy_info
;
769 pd
->mhl_info
= mhl_info
;
770 pd
->mhl_bus
= mhl_bus
;
772 s3c_set_platdata(pd
, sizeof(struct s5p_hdmi_platform_data
),
776 #endif /* CONFIG_S5P_DEV_I2C_HDMIPHY */
780 #ifdef CONFIG_PLAT_S3C24XX
781 static struct resource s3c_iis_resource
[] = {
782 [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS
, S3C24XX_SZ_IIS
),
785 struct platform_device s3c_device_iis
= {
786 .name
= "s3c24xx-iis",
788 .num_resources
= ARRAY_SIZE(s3c_iis_resource
),
789 .resource
= s3c_iis_resource
,
791 .dma_mask
= &samsung_device_dma_mask
,
792 .coherent_dma_mask
= DMA_BIT_MASK(32),
795 #endif /* CONFIG_PLAT_S3C24XX */
799 #ifdef CONFIG_SAMSUNG_DEV_IDE
800 static struct resource s3c_cfcon_resource
[] = {
801 [0] = DEFINE_RES_MEM(SAMSUNG_PA_CFCON
, SZ_16K
),
802 [1] = DEFINE_RES_IRQ(IRQ_CFCON
),
805 struct platform_device s3c_device_cfcon
= {
807 .num_resources
= ARRAY_SIZE(s3c_cfcon_resource
),
808 .resource
= s3c_cfcon_resource
,
811 void __init
s3c_ide_set_platdata(struct s3c_ide_platdata
*pdata
)
813 s3c_set_platdata(pdata
, sizeof(struct s3c_ide_platdata
),
816 #endif /* CONFIG_SAMSUNG_DEV_IDE */
820 #ifdef CONFIG_SAMSUNG_DEV_KEYPAD
821 static struct resource samsung_keypad_resources
[] = {
822 [0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD
, SZ_32
),
823 [1] = DEFINE_RES_IRQ(IRQ_KEYPAD
),
826 struct platform_device samsung_device_keypad
= {
827 .name
= "samsung-keypad",
829 .num_resources
= ARRAY_SIZE(samsung_keypad_resources
),
830 .resource
= samsung_keypad_resources
,
833 void __init
samsung_keypad_set_platdata(struct samsung_keypad_platdata
*pd
)
835 struct samsung_keypad_platdata
*npd
;
837 npd
= s3c_set_platdata(pd
, sizeof(struct samsung_keypad_platdata
),
838 &samsung_device_keypad
);
841 npd
->cfg_gpio
= samsung_keypad_cfg_gpio
;
843 #endif /* CONFIG_SAMSUNG_DEV_KEYPAD */
847 #ifdef CONFIG_PLAT_S3C24XX
848 static struct resource s3c_lcd_resource
[] = {
849 [0] = DEFINE_RES_MEM(S3C24XX_PA_LCD
, S3C24XX_SZ_LCD
),
850 [1] = DEFINE_RES_IRQ(IRQ_LCD
),
853 struct platform_device s3c_device_lcd
= {
854 .name
= "s3c2410-lcd",
856 .num_resources
= ARRAY_SIZE(s3c_lcd_resource
),
857 .resource
= s3c_lcd_resource
,
859 .dma_mask
= &samsung_device_dma_mask
,
860 .coherent_dma_mask
= DMA_BIT_MASK(32),
864 void __init
s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info
*pd
)
866 struct s3c2410fb_mach_info
*npd
;
868 npd
= s3c_set_platdata(pd
, sizeof(*npd
), &s3c_device_lcd
);
870 npd
->displays
= kmemdup(pd
->displays
,
871 sizeof(struct s3c2410fb_display
) * npd
->num_displays
,
874 printk(KERN_ERR
"no memory for LCD display data\n");
876 printk(KERN_ERR
"no memory for LCD platform data\n");
879 #endif /* CONFIG_PLAT_S3C24XX */
883 #ifdef CONFIG_S5P_DEV_MFC
884 static struct resource s5p_mfc_resource
[] = {
885 [0] = DEFINE_RES_MEM(S5P_PA_MFC
, SZ_64K
),
886 [1] = DEFINE_RES_IRQ(IRQ_MFC
),
889 struct platform_device s5p_device_mfc
= {
892 .num_resources
= ARRAY_SIZE(s5p_mfc_resource
),
893 .resource
= s5p_mfc_resource
,
897 * MFC hardware has 2 memory interfaces which are modelled as two separate
898 * platform devices to let dma-mapping distinguish between them.
900 * MFC parent device (s5p_device_mfc) must be registered before memory
901 * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
904 struct platform_device s5p_device_mfc_l
= {
908 .parent
= &s5p_device_mfc
.dev
,
909 .dma_mask
= &samsung_device_dma_mask
,
910 .coherent_dma_mask
= DMA_BIT_MASK(32),
914 struct platform_device s5p_device_mfc_r
= {
918 .parent
= &s5p_device_mfc
.dev
,
919 .dma_mask
= &samsung_device_dma_mask
,
920 .coherent_dma_mask
= DMA_BIT_MASK(32),
924 #endif /* CONFIG_S5P_DEV_MFC */
928 #ifdef CONFIG_S5P_DEV_CSIS0
929 static struct resource s5p_mipi_csis0_resource
[] = {
930 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS0
, SZ_16K
),
931 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS0
),
934 struct platform_device s5p_device_mipi_csis0
= {
935 .name
= "s5p-mipi-csis",
937 .num_resources
= ARRAY_SIZE(s5p_mipi_csis0_resource
),
938 .resource
= s5p_mipi_csis0_resource
,
940 #endif /* CONFIG_S5P_DEV_CSIS0 */
942 #ifdef CONFIG_S5P_DEV_CSIS1
943 static struct resource s5p_mipi_csis1_resource
[] = {
944 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS1
, SZ_16K
),
945 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS1
),
948 struct platform_device s5p_device_mipi_csis1
= {
949 .name
= "s5p-mipi-csis",
951 .num_resources
= ARRAY_SIZE(s5p_mipi_csis1_resource
),
952 .resource
= s5p_mipi_csis1_resource
,
958 #ifdef CONFIG_S3C_DEV_NAND
959 static struct resource s3c_nand_resource
[] = {
960 [0] = DEFINE_RES_MEM(S3C_PA_NAND
, SZ_1M
),
963 struct platform_device s3c_device_nand
= {
964 .name
= "s3c2410-nand",
966 .num_resources
= ARRAY_SIZE(s3c_nand_resource
),
967 .resource
= s3c_nand_resource
,
971 * s3c_nand_copy_set() - copy nand set data
972 * @set: The new structure, directly copied from the old.
974 * Copy all the fields from the NAND set field from what is probably __initdata
975 * to new kernel memory. The code returns 0 if the copy happened correctly or
976 * an error code for the calling function to display.
978 * Note, we currently do not try and look to see if we've already copied the
979 * data in a previous set.
981 static int __init
s3c_nand_copy_set(struct s3c2410_nand_set
*set
)
986 size
= sizeof(struct mtd_partition
) * set
->nr_partitions
;
988 ptr
= kmemdup(set
->partitions
, size
, GFP_KERNEL
);
989 set
->partitions
= ptr
;
995 if (set
->nr_map
&& set
->nr_chips
) {
996 size
= sizeof(int) * set
->nr_chips
;
997 ptr
= kmemdup(set
->nr_map
, size
, GFP_KERNEL
);
1004 if (set
->ecc_layout
) {
1005 ptr
= kmemdup(set
->ecc_layout
,
1006 sizeof(struct nand_ecclayout
), GFP_KERNEL
);
1007 set
->ecc_layout
= ptr
;
1016 void __init
s3c_nand_set_platdata(struct s3c2410_platform_nand
*nand
)
1018 struct s3c2410_platform_nand
*npd
;
1022 /* note, if we get a failure in allocation, we simply drop out of the
1023 * function. If there is so little memory available at initialisation
1024 * time then there is little chance the system is going to run.
1027 npd
= s3c_set_platdata(nand
, sizeof(struct s3c2410_platform_nand
),
1032 /* now see if we need to copy any of the nand set data */
1034 size
= sizeof(struct s3c2410_nand_set
) * npd
->nr_sets
;
1036 struct s3c2410_nand_set
*from
= npd
->sets
;
1037 struct s3c2410_nand_set
*to
;
1040 to
= kmemdup(from
, size
, GFP_KERNEL
);
1041 npd
->sets
= to
; /* set, even if we failed */
1044 printk(KERN_ERR
"%s: no memory for sets\n", __func__
);
1048 for (i
= 0; i
< npd
->nr_sets
; i
++) {
1049 ret
= s3c_nand_copy_set(to
);
1051 printk(KERN_ERR
"%s: failed to copy set %d\n",
1059 #endif /* CONFIG_S3C_DEV_NAND */
1063 #ifdef CONFIG_S3C_DEV_ONENAND
1064 static struct resource s3c_onenand_resources
[] = {
1065 [0] = DEFINE_RES_MEM(S3C_PA_ONENAND
, SZ_1K
),
1066 [1] = DEFINE_RES_MEM(S3C_PA_ONENAND_BUF
, S3C_SZ_ONENAND_BUF
),
1067 [2] = DEFINE_RES_IRQ(IRQ_ONENAND
),
1070 struct platform_device s3c_device_onenand
= {
1071 .name
= "samsung-onenand",
1073 .num_resources
= ARRAY_SIZE(s3c_onenand_resources
),
1074 .resource
= s3c_onenand_resources
,
1076 #endif /* CONFIG_S3C_DEV_ONENAND */
1078 #ifdef CONFIG_S3C64XX_DEV_ONENAND1
1079 static struct resource s3c64xx_onenand1_resources
[] = {
1080 [0] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1
, SZ_1K
),
1081 [1] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1_BUF
, S3C64XX_SZ_ONENAND1_BUF
),
1082 [2] = DEFINE_RES_IRQ(IRQ_ONENAND1
),
1085 struct platform_device s3c64xx_device_onenand1
= {
1086 .name
= "samsung-onenand",
1088 .num_resources
= ARRAY_SIZE(s3c64xx_onenand1_resources
),
1089 .resource
= s3c64xx_onenand1_resources
,
1092 void __init
s3c64xx_onenand1_set_platdata(struct onenand_platform_data
*pdata
)
1094 s3c_set_platdata(pdata
, sizeof(struct onenand_platform_data
),
1095 &s3c64xx_device_onenand1
);
1097 #endif /* CONFIG_S3C64XX_DEV_ONENAND1 */
1099 #ifdef CONFIG_S5P_DEV_ONENAND
1100 static struct resource s5p_onenand_resources
[] = {
1101 [0] = DEFINE_RES_MEM(S5P_PA_ONENAND
, SZ_128K
),
1102 [1] = DEFINE_RES_MEM(S5P_PA_ONENAND_DMA
, SZ_8K
),
1103 [2] = DEFINE_RES_IRQ(IRQ_ONENAND_AUDI
),
1106 struct platform_device s5p_device_onenand
= {
1107 .name
= "s5pc110-onenand",
1109 .num_resources
= ARRAY_SIZE(s5p_onenand_resources
),
1110 .resource
= s5p_onenand_resources
,
1112 #endif /* CONFIG_S5P_DEV_ONENAND */
1116 #ifdef CONFIG_PLAT_S5P
1117 static struct resource s5p_pmu_resource
[] = {
1118 DEFINE_RES_IRQ(IRQ_PMU
)
1121 static struct platform_device s5p_device_pmu
= {
1124 .num_resources
= ARRAY_SIZE(s5p_pmu_resource
),
1125 .resource
= s5p_pmu_resource
,
1128 static int __init
s5p_pmu_init(void)
1130 platform_device_register(&s5p_device_pmu
);
1133 arch_initcall(s5p_pmu_init
);
1134 #endif /* CONFIG_PLAT_S5P */
1138 #ifdef CONFIG_SAMSUNG_DEV_PWM
1140 #define TIMER_RESOURCE_SIZE (1)
1142 #define TIMER_RESOURCE(_tmr, _irq) \
1143 (struct resource [TIMER_RESOURCE_SIZE]) { \
1147 .flags = IORESOURCE_IRQ \
1151 #define DEFINE_S3C_TIMER(_tmr_no, _irq) \
1152 .name = "s3c24xx-pwm", \
1154 .num_resources = TIMER_RESOURCE_SIZE, \
1155 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
1158 * since we already have an static mapping for the timer,
1159 * we do not bother setting any IO resource for the base.
1162 struct platform_device s3c_device_timer
[] = {
1163 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0
) },
1164 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1
) },
1165 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2
) },
1166 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3
) },
1167 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4
) },
1169 #endif /* CONFIG_SAMSUNG_DEV_PWM */
1173 #ifdef CONFIG_PLAT_S3C24XX
1174 static struct resource s3c_rtc_resource
[] = {
1175 [0] = DEFINE_RES_MEM(S3C24XX_PA_RTC
, SZ_256
),
1176 [1] = DEFINE_RES_IRQ(IRQ_RTC
),
1177 [2] = DEFINE_RES_IRQ(IRQ_TICK
),
1180 struct platform_device s3c_device_rtc
= {
1181 .name
= "s3c2410-rtc",
1183 .num_resources
= ARRAY_SIZE(s3c_rtc_resource
),
1184 .resource
= s3c_rtc_resource
,
1186 #endif /* CONFIG_PLAT_S3C24XX */
1188 #ifdef CONFIG_S3C_DEV_RTC
1189 static struct resource s3c_rtc_resource
[] = {
1190 [0] = DEFINE_RES_MEM(S3C_PA_RTC
, SZ_256
),
1191 [1] = DEFINE_RES_IRQ(IRQ_RTC_ALARM
),
1192 [2] = DEFINE_RES_IRQ(IRQ_RTC_TIC
),
1195 struct platform_device s3c_device_rtc
= {
1196 .name
= "s3c64xx-rtc",
1198 .num_resources
= ARRAY_SIZE(s3c_rtc_resource
),
1199 .resource
= s3c_rtc_resource
,
1201 #endif /* CONFIG_S3C_DEV_RTC */
1205 #ifdef CONFIG_PLAT_S3C24XX
1206 static struct resource s3c_sdi_resource
[] = {
1207 [0] = DEFINE_RES_MEM(S3C24XX_PA_SDI
, S3C24XX_SZ_SDI
),
1208 [1] = DEFINE_RES_IRQ(IRQ_SDI
),
1211 struct platform_device s3c_device_sdi
= {
1212 .name
= "s3c2410-sdi",
1214 .num_resources
= ARRAY_SIZE(s3c_sdi_resource
),
1215 .resource
= s3c_sdi_resource
,
1218 void __init
s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata
*pdata
)
1220 s3c_set_platdata(pdata
, sizeof(struct s3c24xx_mci_pdata
),
1223 #endif /* CONFIG_PLAT_S3C24XX */
1227 #ifdef CONFIG_PLAT_S3C24XX
1228 static struct resource s3c_spi0_resource
[] = {
1229 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI
, SZ_32
),
1230 [1] = DEFINE_RES_IRQ(IRQ_SPI0
),
1233 struct platform_device s3c_device_spi0
= {
1234 .name
= "s3c2410-spi",
1236 .num_resources
= ARRAY_SIZE(s3c_spi0_resource
),
1237 .resource
= s3c_spi0_resource
,
1239 .dma_mask
= &samsung_device_dma_mask
,
1240 .coherent_dma_mask
= DMA_BIT_MASK(32),
1244 static struct resource s3c_spi1_resource
[] = {
1245 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI1
, SZ_32
),
1246 [1] = DEFINE_RES_IRQ(IRQ_SPI1
),
1249 struct platform_device s3c_device_spi1
= {
1250 .name
= "s3c2410-spi",
1252 .num_resources
= ARRAY_SIZE(s3c_spi1_resource
),
1253 .resource
= s3c_spi1_resource
,
1255 .dma_mask
= &samsung_device_dma_mask
,
1256 .coherent_dma_mask
= DMA_BIT_MASK(32),
1259 #endif /* CONFIG_PLAT_S3C24XX */
1263 #ifdef CONFIG_PLAT_S3C24XX
1264 static struct resource s3c_ts_resource
[] = {
1265 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC
, S3C24XX_SZ_ADC
),
1266 [1] = DEFINE_RES_IRQ(IRQ_TC
),
1269 struct platform_device s3c_device_ts
= {
1270 .name
= "s3c2410-ts",
1272 .dev
.parent
= &s3c_device_adc
.dev
,
1273 .num_resources
= ARRAY_SIZE(s3c_ts_resource
),
1274 .resource
= s3c_ts_resource
,
1277 void __init
s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info
*hard_s3c2410ts_info
)
1279 s3c_set_platdata(hard_s3c2410ts_info
,
1280 sizeof(struct s3c2410_ts_mach_info
), &s3c_device_ts
);
1282 #endif /* CONFIG_PLAT_S3C24XX */
1284 #ifdef CONFIG_SAMSUNG_DEV_TS
1285 static struct resource s3c_ts_resource
[] = {
1286 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC
, SZ_256
),
1287 [1] = DEFINE_RES_IRQ(IRQ_TC
),
1290 static struct s3c2410_ts_mach_info default_ts_data __initdata
= {
1293 .oversampling_shift
= 2,
1296 struct platform_device s3c_device_ts
= {
1297 .name
= "s3c64xx-ts",
1299 .num_resources
= ARRAY_SIZE(s3c_ts_resource
),
1300 .resource
= s3c_ts_resource
,
1303 void __init
s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info
*pd
)
1306 pd
= &default_ts_data
;
1308 s3c_set_platdata(pd
, sizeof(struct s3c2410_ts_mach_info
),
1311 #endif /* CONFIG_SAMSUNG_DEV_TS */
1315 #ifdef CONFIG_S5P_DEV_TV
1317 static struct resource s5p_hdmi_resources
[] = {
1318 [0] = DEFINE_RES_MEM(S5P_PA_HDMI
, SZ_1M
),
1319 [1] = DEFINE_RES_IRQ(IRQ_HDMI
),
1322 struct platform_device s5p_device_hdmi
= {
1325 .num_resources
= ARRAY_SIZE(s5p_hdmi_resources
),
1326 .resource
= s5p_hdmi_resources
,
1329 static struct resource s5p_sdo_resources
[] = {
1330 [0] = DEFINE_RES_MEM(S5P_PA_SDO
, SZ_64K
),
1331 [1] = DEFINE_RES_IRQ(IRQ_SDO
),
1334 struct platform_device s5p_device_sdo
= {
1337 .num_resources
= ARRAY_SIZE(s5p_sdo_resources
),
1338 .resource
= s5p_sdo_resources
,
1341 static struct resource s5p_mixer_resources
[] = {
1342 [0] = DEFINE_RES_MEM_NAMED(S5P_PA_MIXER
, SZ_64K
, "mxr"),
1343 [1] = DEFINE_RES_MEM_NAMED(S5P_PA_VP
, SZ_64K
, "vp"),
1344 [2] = DEFINE_RES_IRQ_NAMED(IRQ_MIXER
, "irq"),
1347 struct platform_device s5p_device_mixer
= {
1348 .name
= "s5p-mixer",
1350 .num_resources
= ARRAY_SIZE(s5p_mixer_resources
),
1351 .resource
= s5p_mixer_resources
,
1353 .dma_mask
= &samsung_device_dma_mask
,
1354 .coherent_dma_mask
= DMA_BIT_MASK(32),
1357 #endif /* CONFIG_S5P_DEV_TV */
1361 #ifdef CONFIG_S3C_DEV_USB_HOST
1362 static struct resource s3c_usb_resource
[] = {
1363 [0] = DEFINE_RES_MEM(S3C_PA_USBHOST
, SZ_256
),
1364 [1] = DEFINE_RES_IRQ(IRQ_USBH
),
1367 struct platform_device s3c_device_ohci
= {
1368 .name
= "s3c2410-ohci",
1370 .num_resources
= ARRAY_SIZE(s3c_usb_resource
),
1371 .resource
= s3c_usb_resource
,
1373 .dma_mask
= &samsung_device_dma_mask
,
1374 .coherent_dma_mask
= DMA_BIT_MASK(32),
1379 * s3c_ohci_set_platdata - initialise OHCI device platform data
1380 * @info: The platform data.
1382 * This call copies the @info passed in and sets the device .platform_data
1383 * field to that copy. The @info is copied so that the original can be marked
1387 void __init
s3c_ohci_set_platdata(struct s3c2410_hcd_info
*info
)
1389 s3c_set_platdata(info
, sizeof(struct s3c2410_hcd_info
),
1392 #endif /* CONFIG_S3C_DEV_USB_HOST */
1394 /* USB Device (Gadget) */
1396 #ifdef CONFIG_PLAT_S3C24XX
1397 static struct resource s3c_usbgadget_resource
[] = {
1398 [0] = DEFINE_RES_MEM(S3C24XX_PA_USBDEV
, S3C24XX_SZ_USBDEV
),
1399 [1] = DEFINE_RES_IRQ(IRQ_USBD
),
1402 struct platform_device s3c_device_usbgadget
= {
1403 .name
= "s3c2410-usbgadget",
1405 .num_resources
= ARRAY_SIZE(s3c_usbgadget_resource
),
1406 .resource
= s3c_usbgadget_resource
,
1409 void __init
s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info
*pd
)
1411 s3c_set_platdata(pd
, sizeof(*pd
), &s3c_device_usbgadget
);
1413 #endif /* CONFIG_PLAT_S3C24XX */
1415 /* USB EHCI Host Controller */
1417 #ifdef CONFIG_S5P_DEV_USB_EHCI
1418 static struct resource s5p_ehci_resource
[] = {
1419 [0] = DEFINE_RES_MEM(S5P_PA_EHCI
, SZ_256
),
1420 [1] = DEFINE_RES_IRQ(IRQ_USB_HOST
),
1423 struct platform_device s5p_device_ehci
= {
1426 .num_resources
= ARRAY_SIZE(s5p_ehci_resource
),
1427 .resource
= s5p_ehci_resource
,
1429 .dma_mask
= &samsung_device_dma_mask
,
1430 .coherent_dma_mask
= DMA_BIT_MASK(32),
1434 void __init
s5p_ehci_set_platdata(struct s5p_ehci_platdata
*pd
)
1436 struct s5p_ehci_platdata
*npd
;
1438 npd
= s3c_set_platdata(pd
, sizeof(struct s5p_ehci_platdata
),
1442 npd
->phy_init
= s5p_usb_phy_init
;
1444 npd
->phy_exit
= s5p_usb_phy_exit
;
1446 #endif /* CONFIG_S5P_DEV_USB_EHCI */
1450 #ifdef CONFIG_S3C_DEV_USB_HSOTG
1451 static struct resource s3c_usb_hsotg_resources
[] = {
1452 [0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG
, SZ_128K
),
1453 [1] = DEFINE_RES_IRQ(IRQ_OTG
),
1456 struct platform_device s3c_device_usb_hsotg
= {
1457 .name
= "s3c-hsotg",
1459 .num_resources
= ARRAY_SIZE(s3c_usb_hsotg_resources
),
1460 .resource
= s3c_usb_hsotg_resources
,
1462 .dma_mask
= &samsung_device_dma_mask
,
1463 .coherent_dma_mask
= DMA_BIT_MASK(32),
1467 void __init
s3c_hsotg_set_platdata(struct s3c_hsotg_plat
*pd
)
1469 struct s3c_hsotg_plat
*npd
;
1471 npd
= s3c_set_platdata(pd
, sizeof(struct s3c_hsotg_plat
),
1472 &s3c_device_usb_hsotg
);
1475 npd
->phy_init
= s5p_usb_phy_init
;
1477 npd
->phy_exit
= s5p_usb_phy_exit
;
1479 #endif /* CONFIG_S3C_DEV_USB_HSOTG */
1481 /* USB High Spped 2.0 Device (Gadget) */
1483 #ifdef CONFIG_PLAT_S3C24XX
1484 static struct resource s3c_hsudc_resource
[] = {
1485 [0] = DEFINE_RES_MEM(S3C2416_PA_HSUDC
, S3C2416_SZ_HSUDC
),
1486 [1] = DEFINE_RES_IRQ(IRQ_USBD
),
1489 struct platform_device s3c_device_usb_hsudc
= {
1490 .name
= "s3c-hsudc",
1492 .num_resources
= ARRAY_SIZE(s3c_hsudc_resource
),
1493 .resource
= s3c_hsudc_resource
,
1495 .dma_mask
= &samsung_device_dma_mask
,
1496 .coherent_dma_mask
= DMA_BIT_MASK(32),
1500 void __init
s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata
*pd
)
1502 s3c_set_platdata(pd
, sizeof(*pd
), &s3c_device_usb_hsudc
);
1504 #endif /* CONFIG_PLAT_S3C24XX */
1508 #ifdef CONFIG_S3C_DEV_WDT
1509 static struct resource s3c_wdt_resource
[] = {
1510 [0] = DEFINE_RES_MEM(S3C_PA_WDT
, SZ_1K
),
1511 [1] = DEFINE_RES_IRQ(IRQ_WDT
),
1514 struct platform_device s3c_device_wdt
= {
1515 .name
= "s3c2410-wdt",
1517 .num_resources
= ARRAY_SIZE(s3c_wdt_resource
),
1518 .resource
= s3c_wdt_resource
,
1520 #endif /* CONFIG_S3C_DEV_WDT */
1522 #ifdef CONFIG_S3C64XX_DEV_SPI0
1523 static struct resource s3c64xx_spi0_resource
[] = {
1524 [0] = DEFINE_RES_MEM(S3C_PA_SPI0
, SZ_256
),
1525 [1] = DEFINE_RES_DMA(DMACH_SPI0_TX
),
1526 [2] = DEFINE_RES_DMA(DMACH_SPI0_RX
),
1527 [3] = DEFINE_RES_IRQ(IRQ_SPI0
),
1530 struct platform_device s3c64xx_device_spi0
= {
1531 .name
= "s3c6410-spi",
1533 .num_resources
= ARRAY_SIZE(s3c64xx_spi0_resource
),
1534 .resource
= s3c64xx_spi0_resource
,
1536 .dma_mask
= &samsung_device_dma_mask
,
1537 .coherent_dma_mask
= DMA_BIT_MASK(32),
1541 void __init
s3c64xx_spi0_set_platdata(int (*cfg_gpio
)(void), int src_clk_nr
,
1544 struct s3c64xx_spi_info pd
;
1546 /* Reject invalid configuration */
1547 if (!num_cs
|| src_clk_nr
< 0) {
1548 pr_err("%s: Invalid SPI configuration\n", __func__
);
1553 pd
.src_clk_nr
= src_clk_nr
;
1554 pd
.cfg_gpio
= (cfg_gpio
) ? cfg_gpio
: s3c64xx_spi0_cfg_gpio
;
1556 s3c_set_platdata(&pd
, sizeof(pd
), &s3c64xx_device_spi0
);
1558 #endif /* CONFIG_S3C64XX_DEV_SPI0 */
1560 #ifdef CONFIG_S3C64XX_DEV_SPI1
1561 static struct resource s3c64xx_spi1_resource
[] = {
1562 [0] = DEFINE_RES_MEM(S3C_PA_SPI1
, SZ_256
),
1563 [1] = DEFINE_RES_DMA(DMACH_SPI1_TX
),
1564 [2] = DEFINE_RES_DMA(DMACH_SPI1_RX
),
1565 [3] = DEFINE_RES_IRQ(IRQ_SPI1
),
1568 struct platform_device s3c64xx_device_spi1
= {
1569 .name
= "s3c6410-spi",
1571 .num_resources
= ARRAY_SIZE(s3c64xx_spi1_resource
),
1572 .resource
= s3c64xx_spi1_resource
,
1574 .dma_mask
= &samsung_device_dma_mask
,
1575 .coherent_dma_mask
= DMA_BIT_MASK(32),
1579 void __init
s3c64xx_spi1_set_platdata(int (*cfg_gpio
)(void), int src_clk_nr
,
1582 struct s3c64xx_spi_info pd
;
1584 /* Reject invalid configuration */
1585 if (!num_cs
|| src_clk_nr
< 0) {
1586 pr_err("%s: Invalid SPI configuration\n", __func__
);
1591 pd
.src_clk_nr
= src_clk_nr
;
1592 pd
.cfg_gpio
= (cfg_gpio
) ? cfg_gpio
: s3c64xx_spi1_cfg_gpio
;
1594 s3c_set_platdata(&pd
, sizeof(pd
), &s3c64xx_device_spi1
);
1596 #endif /* CONFIG_S3C64XX_DEV_SPI1 */
1598 #ifdef CONFIG_S3C64XX_DEV_SPI2
1599 static struct resource s3c64xx_spi2_resource
[] = {
1600 [0] = DEFINE_RES_MEM(S3C_PA_SPI2
, SZ_256
),
1601 [1] = DEFINE_RES_DMA(DMACH_SPI2_TX
),
1602 [2] = DEFINE_RES_DMA(DMACH_SPI2_RX
),
1603 [3] = DEFINE_RES_IRQ(IRQ_SPI2
),
1606 struct platform_device s3c64xx_device_spi2
= {
1607 .name
= "s3c6410-spi",
1609 .num_resources
= ARRAY_SIZE(s3c64xx_spi2_resource
),
1610 .resource
= s3c64xx_spi2_resource
,
1612 .dma_mask
= &samsung_device_dma_mask
,
1613 .coherent_dma_mask
= DMA_BIT_MASK(32),
1617 void __init
s3c64xx_spi2_set_platdata(int (*cfg_gpio
)(void), int src_clk_nr
,
1620 struct s3c64xx_spi_info pd
;
1622 /* Reject invalid configuration */
1623 if (!num_cs
|| src_clk_nr
< 0) {
1624 pr_err("%s: Invalid SPI configuration\n", __func__
);
1629 pd
.src_clk_nr
= src_clk_nr
;
1630 pd
.cfg_gpio
= (cfg_gpio
) ? cfg_gpio
: s3c64xx_spi2_cfg_gpio
;
1632 s3c_set_platdata(&pd
, sizeof(pd
), &s3c64xx_device_spi2
);
1634 #endif /* CONFIG_S3C64XX_DEV_SPI2 */