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>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/map.h>
38 #include <asm/mach/irq.h>
40 #include <mach/hardware.h>
42 #include <mach/irqs.h>
46 #include <plat/devs.h>
49 #include <plat/ehci.h>
51 #include <plat/fb-s3c2410.h>
52 #include <plat/hwmon.h>
54 #include <plat/keypad.h>
56 #include <plat/nand.h>
57 #include <plat/sdhci.h>
60 #include <plat/udc-hs.h>
61 #include <plat/usb-control.h>
62 #include <plat/usb-phy.h>
63 #include <plat/regs-iic.h>
64 #include <plat/regs-serial.h>
65 #include <plat/regs-spi.h>
66 #include <plat/s3c64xx-spi.h>
68 static u64 samsung_device_dma_mask
= DMA_BIT_MASK(32);
71 #ifdef CONFIG_CPU_S3C2440
72 static struct resource s3c_ac97_resource
[] = {
73 [0] = DEFINE_RES_MEM(S3C2440_PA_AC97
, S3C2440_SZ_AC97
),
74 [1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97
),
75 [2] = DEFINE_RES_DMA_NAMED(DMACH_PCM_OUT
, "PCM out"),
76 [3] = DEFINE_RES_DMA_NAMED(DMACH_PCM_IN
, "PCM in"),
77 [4] = DEFINE_RES_DMA_NAMED(DMACH_MIC_IN
, "Mic in"),
80 struct platform_device s3c_device_ac97
= {
81 .name
= "samsung-ac97",
83 .num_resources
= ARRAY_SIZE(s3c_ac97_resource
),
84 .resource
= s3c_ac97_resource
,
86 .dma_mask
= &samsung_device_dma_mask
,
87 .coherent_dma_mask
= DMA_BIT_MASK(32),
90 #endif /* CONFIG_CPU_S3C2440 */
94 #ifdef CONFIG_PLAT_S3C24XX
95 static struct resource s3c_adc_resource
[] = {
96 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC
, S3C24XX_SZ_ADC
),
97 [1] = DEFINE_RES_IRQ(IRQ_TC
),
98 [2] = DEFINE_RES_IRQ(IRQ_ADC
),
101 struct platform_device s3c_device_adc
= {
102 .name
= "s3c24xx-adc",
104 .num_resources
= ARRAY_SIZE(s3c_adc_resource
),
105 .resource
= s3c_adc_resource
,
107 #endif /* CONFIG_PLAT_S3C24XX */
109 #if defined(CONFIG_SAMSUNG_DEV_ADC)
110 static struct resource s3c_adc_resource
[] = {
111 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC
, SZ_256
),
112 [1] = DEFINE_RES_IRQ(IRQ_TC
),
113 [2] = DEFINE_RES_IRQ(IRQ_ADC
),
116 struct platform_device s3c_device_adc
= {
117 .name
= "samsung-adc",
119 .num_resources
= ARRAY_SIZE(s3c_adc_resource
),
120 .resource
= s3c_adc_resource
,
122 #endif /* CONFIG_SAMSUNG_DEV_ADC */
124 /* Camif Controller */
126 #ifdef CONFIG_CPU_S3C2440
127 static struct resource s3c_camif_resource
[] = {
128 [0] = DEFINE_RES_MEM(S3C2440_PA_CAMIF
, S3C2440_SZ_CAMIF
),
129 [1] = DEFINE_RES_IRQ(IRQ_CAM
),
132 struct platform_device s3c_device_camif
= {
133 .name
= "s3c2440-camif",
135 .num_resources
= ARRAY_SIZE(s3c_camif_resource
),
136 .resource
= s3c_camif_resource
,
138 .dma_mask
= &samsung_device_dma_mask
,
139 .coherent_dma_mask
= DMA_BIT_MASK(32),
142 #endif /* CONFIG_CPU_S3C2440 */
146 struct platform_device samsung_asoc_dma
= {
147 .name
= "samsung-audio",
150 .dma_mask
= &samsung_device_dma_mask
,
151 .coherent_dma_mask
= DMA_BIT_MASK(32),
155 struct platform_device samsung_asoc_idma
= {
156 .name
= "samsung-idma",
159 .dma_mask
= &samsung_device_dma_mask
,
160 .coherent_dma_mask
= DMA_BIT_MASK(32),
166 #ifdef CONFIG_S3C_DEV_FB
167 static struct resource s3c_fb_resource
[] = {
168 [0] = DEFINE_RES_MEM(S3C_PA_FB
, SZ_16K
),
169 [1] = DEFINE_RES_IRQ(IRQ_LCD_VSYNC
),
170 [2] = DEFINE_RES_IRQ(IRQ_LCD_FIFO
),
171 [3] = DEFINE_RES_IRQ(IRQ_LCD_SYSTEM
),
174 struct platform_device s3c_device_fb
= {
177 .num_resources
= ARRAY_SIZE(s3c_fb_resource
),
178 .resource
= s3c_fb_resource
,
180 .dma_mask
= &samsung_device_dma_mask
,
181 .coherent_dma_mask
= DMA_BIT_MASK(32),
185 void __init
s3c_fb_set_platdata(struct s3c_fb_platdata
*pd
)
187 s3c_set_platdata(pd
, sizeof(struct s3c_fb_platdata
),
190 #endif /* CONFIG_S3C_DEV_FB */
194 #ifdef CONFIG_S5P_DEV_FIMC0
195 static struct resource s5p_fimc0_resource
[] = {
196 [0] = DEFINE_RES_MEM(S5P_PA_FIMC0
, SZ_4K
),
197 [1] = DEFINE_RES_IRQ(IRQ_FIMC0
),
200 struct platform_device s5p_device_fimc0
= {
203 .num_resources
= ARRAY_SIZE(s5p_fimc0_resource
),
204 .resource
= s5p_fimc0_resource
,
206 .dma_mask
= &samsung_device_dma_mask
,
207 .coherent_dma_mask
= DMA_BIT_MASK(32),
211 struct platform_device s5p_device_fimc_md
= {
212 .name
= "s5p-fimc-md",
215 #endif /* CONFIG_S5P_DEV_FIMC0 */
217 #ifdef CONFIG_S5P_DEV_FIMC1
218 static struct resource s5p_fimc1_resource
[] = {
219 [0] = DEFINE_RES_MEM(S5P_PA_FIMC1
, SZ_4K
),
220 [1] = DEFINE_RES_IRQ(IRQ_FIMC1
),
223 struct platform_device s5p_device_fimc1
= {
226 .num_resources
= ARRAY_SIZE(s5p_fimc1_resource
),
227 .resource
= s5p_fimc1_resource
,
229 .dma_mask
= &samsung_device_dma_mask
,
230 .coherent_dma_mask
= DMA_BIT_MASK(32),
233 #endif /* CONFIG_S5P_DEV_FIMC1 */
235 #ifdef CONFIG_S5P_DEV_FIMC2
236 static struct resource s5p_fimc2_resource
[] = {
237 [0] = DEFINE_RES_MEM(S5P_PA_FIMC2
, SZ_4K
),
238 [1] = DEFINE_RES_IRQ(IRQ_FIMC2
),
241 struct platform_device s5p_device_fimc2
= {
244 .num_resources
= ARRAY_SIZE(s5p_fimc2_resource
),
245 .resource
= s5p_fimc2_resource
,
247 .dma_mask
= &samsung_device_dma_mask
,
248 .coherent_dma_mask
= DMA_BIT_MASK(32),
251 #endif /* CONFIG_S5P_DEV_FIMC2 */
253 #ifdef CONFIG_S5P_DEV_FIMC3
254 static struct resource s5p_fimc3_resource
[] = {
255 [0] = DEFINE_RES_MEM(S5P_PA_FIMC3
, SZ_4K
),
256 [1] = DEFINE_RES_IRQ(IRQ_FIMC3
),
259 struct platform_device s5p_device_fimc3
= {
262 .num_resources
= ARRAY_SIZE(s5p_fimc3_resource
),
263 .resource
= s5p_fimc3_resource
,
265 .dma_mask
= &samsung_device_dma_mask
,
266 .coherent_dma_mask
= DMA_BIT_MASK(32),
269 #endif /* CONFIG_S5P_DEV_FIMC3 */
273 #ifdef CONFIG_S5P_DEV_G2D
274 static struct resource s5p_g2d_resource
[] = {
277 .end
= S5P_PA_G2D
+ SZ_4K
- 1,
278 .flags
= IORESOURCE_MEM
,
283 .flags
= IORESOURCE_IRQ
,
287 struct platform_device s5p_device_g2d
= {
290 .num_resources
= ARRAY_SIZE(s5p_g2d_resource
),
291 .resource
= s5p_g2d_resource
,
293 .dma_mask
= &samsung_device_dma_mask
,
294 .coherent_dma_mask
= DMA_BIT_MASK(32),
297 #endif /* CONFIG_S5P_DEV_G2D */
301 #ifdef CONFIG_S5P_DEV_FIMD0
302 static struct resource s5p_fimd0_resource
[] = {
303 [0] = DEFINE_RES_MEM(S5P_PA_FIMD0
, SZ_32K
),
304 [1] = DEFINE_RES_IRQ(IRQ_FIMD0_VSYNC
),
305 [2] = DEFINE_RES_IRQ(IRQ_FIMD0_FIFO
),
306 [3] = DEFINE_RES_IRQ(IRQ_FIMD0_SYSTEM
),
309 struct platform_device s5p_device_fimd0
= {
312 .num_resources
= ARRAY_SIZE(s5p_fimd0_resource
),
313 .resource
= s5p_fimd0_resource
,
315 .dma_mask
= &samsung_device_dma_mask
,
316 .coherent_dma_mask
= DMA_BIT_MASK(32),
320 void __init
s5p_fimd0_set_platdata(struct s3c_fb_platdata
*pd
)
322 s3c_set_platdata(pd
, sizeof(struct s3c_fb_platdata
),
325 #endif /* CONFIG_S5P_DEV_FIMD0 */
329 #ifdef CONFIG_S3C_DEV_HWMON
330 struct platform_device s3c_device_hwmon
= {
333 .dev
.parent
= &s3c_device_adc
.dev
,
336 void __init
s3c_hwmon_set_platdata(struct s3c_hwmon_pdata
*pd
)
338 s3c_set_platdata(pd
, sizeof(struct s3c_hwmon_pdata
),
341 #endif /* CONFIG_S3C_DEV_HWMON */
345 #ifdef CONFIG_S3C_DEV_HSMMC
346 static struct resource s3c_hsmmc_resource
[] = {
347 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC0
, SZ_4K
),
348 [1] = DEFINE_RES_IRQ(IRQ_HSMMC0
),
351 struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata
= {
353 .host_caps
= (MMC_CAP_4_BIT_DATA
|
354 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
355 .clk_type
= S3C_SDHCI_CLK_DIV_INTERNAL
,
358 struct platform_device s3c_device_hsmmc0
= {
361 .num_resources
= ARRAY_SIZE(s3c_hsmmc_resource
),
362 .resource
= s3c_hsmmc_resource
,
364 .dma_mask
= &samsung_device_dma_mask
,
365 .coherent_dma_mask
= DMA_BIT_MASK(32),
366 .platform_data
= &s3c_hsmmc0_def_platdata
,
370 void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata
*pd
)
372 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc0_def_platdata
);
374 #endif /* CONFIG_S3C_DEV_HSMMC */
376 #ifdef CONFIG_S3C_DEV_HSMMC1
377 static struct resource s3c_hsmmc1_resource
[] = {
378 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC1
, SZ_4K
),
379 [1] = DEFINE_RES_IRQ(IRQ_HSMMC1
),
382 struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata
= {
384 .host_caps
= (MMC_CAP_4_BIT_DATA
|
385 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
386 .clk_type
= S3C_SDHCI_CLK_DIV_INTERNAL
,
389 struct platform_device s3c_device_hsmmc1
= {
392 .num_resources
= ARRAY_SIZE(s3c_hsmmc1_resource
),
393 .resource
= s3c_hsmmc1_resource
,
395 .dma_mask
= &samsung_device_dma_mask
,
396 .coherent_dma_mask
= DMA_BIT_MASK(32),
397 .platform_data
= &s3c_hsmmc1_def_platdata
,
401 void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata
*pd
)
403 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc1_def_platdata
);
405 #endif /* CONFIG_S3C_DEV_HSMMC1 */
409 #ifdef CONFIG_S3C_DEV_HSMMC2
410 static struct resource s3c_hsmmc2_resource
[] = {
411 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC2
, SZ_4K
),
412 [1] = DEFINE_RES_IRQ(IRQ_HSMMC2
),
415 struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata
= {
417 .host_caps
= (MMC_CAP_4_BIT_DATA
|
418 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
419 .clk_type
= S3C_SDHCI_CLK_DIV_INTERNAL
,
422 struct platform_device s3c_device_hsmmc2
= {
425 .num_resources
= ARRAY_SIZE(s3c_hsmmc2_resource
),
426 .resource
= s3c_hsmmc2_resource
,
428 .dma_mask
= &samsung_device_dma_mask
,
429 .coherent_dma_mask
= DMA_BIT_MASK(32),
430 .platform_data
= &s3c_hsmmc2_def_platdata
,
434 void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata
*pd
)
436 s3c_sdhci_set_platdata(pd
, &s3c_hsmmc2_def_platdata
);
438 #endif /* CONFIG_S3C_DEV_HSMMC2 */
440 #ifdef CONFIG_S3C_DEV_HSMMC3
441 static struct resource s3c_hsmmc3_resource
[] = {
442 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC3
, SZ_4K
),
443 [1] = DEFINE_RES_IRQ(IRQ_HSMMC3
),
446 struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata
= {
448 .host_caps
= (MMC_CAP_4_BIT_DATA
|
449 MMC_CAP_MMC_HIGHSPEED
| MMC_CAP_SD_HIGHSPEED
),
450 .clk_type
= S3C_SDHCI_CLK_DIV_INTERNAL
,
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",
480 #ifdef CONFIG_S3C_DEV_I2C1
485 .num_resources
= ARRAY_SIZE(s3c_i2c0_resource
),
486 .resource
= s3c_i2c0_resource
,
489 struct s3c2410_platform_i2c default_i2c_data __initdata
= {
492 .frequency
= 100*1000,
496 void __init
s3c_i2c0_set_platdata(struct s3c2410_platform_i2c
*pd
)
498 struct s3c2410_platform_i2c
*npd
;
501 pd
= &default_i2c_data
;
503 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
507 npd
->cfg_gpio
= s3c_i2c0_cfg_gpio
;
510 #ifdef CONFIG_S3C_DEV_I2C1
511 static struct resource s3c_i2c1_resource
[] = {
512 [0] = DEFINE_RES_MEM(S3C_PA_IIC1
, SZ_4K
),
513 [1] = DEFINE_RES_IRQ(IRQ_IIC1
),
516 struct platform_device s3c_device_i2c1
= {
517 .name
= "s3c2410-i2c",
519 .num_resources
= ARRAY_SIZE(s3c_i2c1_resource
),
520 .resource
= s3c_i2c1_resource
,
523 void __init
s3c_i2c1_set_platdata(struct s3c2410_platform_i2c
*pd
)
525 struct s3c2410_platform_i2c
*npd
;
528 pd
= &default_i2c_data
;
532 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
536 npd
->cfg_gpio
= s3c_i2c1_cfg_gpio
;
538 #endif /* CONFIG_S3C_DEV_I2C1 */
540 #ifdef CONFIG_S3C_DEV_I2C2
541 static struct resource s3c_i2c2_resource
[] = {
542 [0] = DEFINE_RES_MEM(S3C_PA_IIC2
, SZ_4K
),
543 [1] = DEFINE_RES_IRQ(IRQ_IIC2
),
546 struct platform_device s3c_device_i2c2
= {
547 .name
= "s3c2410-i2c",
549 .num_resources
= ARRAY_SIZE(s3c_i2c2_resource
),
550 .resource
= s3c_i2c2_resource
,
553 void __init
s3c_i2c2_set_platdata(struct s3c2410_platform_i2c
*pd
)
555 struct s3c2410_platform_i2c
*npd
;
558 pd
= &default_i2c_data
;
562 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
566 npd
->cfg_gpio
= s3c_i2c2_cfg_gpio
;
568 #endif /* CONFIG_S3C_DEV_I2C2 */
570 #ifdef CONFIG_S3C_DEV_I2C3
571 static struct resource s3c_i2c3_resource
[] = {
572 [0] = DEFINE_RES_MEM(S3C_PA_IIC3
, SZ_4K
),
573 [1] = DEFINE_RES_IRQ(IRQ_IIC3
),
576 struct platform_device s3c_device_i2c3
= {
577 .name
= "s3c2440-i2c",
579 .num_resources
= ARRAY_SIZE(s3c_i2c3_resource
),
580 .resource
= s3c_i2c3_resource
,
583 void __init
s3c_i2c3_set_platdata(struct s3c2410_platform_i2c
*pd
)
585 struct s3c2410_platform_i2c
*npd
;
588 pd
= &default_i2c_data
;
592 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
596 npd
->cfg_gpio
= s3c_i2c3_cfg_gpio
;
598 #endif /*CONFIG_S3C_DEV_I2C3 */
600 #ifdef CONFIG_S3C_DEV_I2C4
601 static struct resource s3c_i2c4_resource
[] = {
602 [0] = DEFINE_RES_MEM(S3C_PA_IIC4
, SZ_4K
),
603 [1] = DEFINE_RES_IRQ(IRQ_IIC4
),
606 struct platform_device s3c_device_i2c4
= {
607 .name
= "s3c2440-i2c",
609 .num_resources
= ARRAY_SIZE(s3c_i2c4_resource
),
610 .resource
= s3c_i2c4_resource
,
613 void __init
s3c_i2c4_set_platdata(struct s3c2410_platform_i2c
*pd
)
615 struct s3c2410_platform_i2c
*npd
;
618 pd
= &default_i2c_data
;
622 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
626 npd
->cfg_gpio
= s3c_i2c4_cfg_gpio
;
628 #endif /*CONFIG_S3C_DEV_I2C4 */
630 #ifdef CONFIG_S3C_DEV_I2C5
631 static struct resource s3c_i2c5_resource
[] = {
632 [0] = DEFINE_RES_MEM(S3C_PA_IIC5
, SZ_4K
),
633 [1] = DEFINE_RES_IRQ(IRQ_IIC5
),
636 struct platform_device s3c_device_i2c5
= {
637 .name
= "s3c2440-i2c",
639 .num_resources
= ARRAY_SIZE(s3c_i2c5_resource
),
640 .resource
= s3c_i2c5_resource
,
643 void __init
s3c_i2c5_set_platdata(struct s3c2410_platform_i2c
*pd
)
645 struct s3c2410_platform_i2c
*npd
;
648 pd
= &default_i2c_data
;
652 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
656 npd
->cfg_gpio
= s3c_i2c5_cfg_gpio
;
658 #endif /*CONFIG_S3C_DEV_I2C5 */
660 #ifdef CONFIG_S3C_DEV_I2C6
661 static struct resource s3c_i2c6_resource
[] = {
662 [0] = DEFINE_RES_MEM(S3C_PA_IIC6
, SZ_4K
),
663 [1] = DEFINE_RES_IRQ(IRQ_IIC6
),
666 struct platform_device s3c_device_i2c6
= {
667 .name
= "s3c2440-i2c",
669 .num_resources
= ARRAY_SIZE(s3c_i2c6_resource
),
670 .resource
= s3c_i2c6_resource
,
673 void __init
s3c_i2c6_set_platdata(struct s3c2410_platform_i2c
*pd
)
675 struct s3c2410_platform_i2c
*npd
;
678 pd
= &default_i2c_data
;
682 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
686 npd
->cfg_gpio
= s3c_i2c6_cfg_gpio
;
688 #endif /* CONFIG_S3C_DEV_I2C6 */
690 #ifdef CONFIG_S3C_DEV_I2C7
691 static struct resource s3c_i2c7_resource
[] = {
692 [0] = DEFINE_RES_MEM(S3C_PA_IIC7
, SZ_4K
),
693 [1] = DEFINE_RES_IRQ(IRQ_IIC7
),
696 struct platform_device s3c_device_i2c7
= {
697 .name
= "s3c2440-i2c",
699 .num_resources
= ARRAY_SIZE(s3c_i2c7_resource
),
700 .resource
= s3c_i2c7_resource
,
703 void __init
s3c_i2c7_set_platdata(struct s3c2410_platform_i2c
*pd
)
705 struct s3c2410_platform_i2c
*npd
;
708 pd
= &default_i2c_data
;
712 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
716 npd
->cfg_gpio
= s3c_i2c7_cfg_gpio
;
718 #endif /* CONFIG_S3C_DEV_I2C7 */
722 #ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
723 static struct resource s5p_i2c_resource
[] = {
724 [0] = DEFINE_RES_MEM(S5P_PA_IIC_HDMIPHY
, SZ_4K
),
725 [1] = DEFINE_RES_IRQ(IRQ_IIC_HDMIPHY
),
728 struct platform_device s5p_device_i2c_hdmiphy
= {
729 .name
= "s3c2440-hdmiphy-i2c",
731 .num_resources
= ARRAY_SIZE(s5p_i2c_resource
),
732 .resource
= s5p_i2c_resource
,
735 void __init
s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c
*pd
)
737 struct s3c2410_platform_i2c
*npd
;
740 pd
= &default_i2c_data
;
742 if (soc_is_exynos4210())
744 else if (soc_is_s5pv210())
750 npd
= s3c_set_platdata(pd
, sizeof(struct s3c2410_platform_i2c
),
751 &s5p_device_i2c_hdmiphy
);
753 #endif /* CONFIG_S5P_DEV_I2C_HDMIPHY */
757 #ifdef CONFIG_PLAT_S3C24XX
758 static struct resource s3c_iis_resource
[] = {
759 [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS
, S3C24XX_SZ_IIS
),
762 struct platform_device s3c_device_iis
= {
763 .name
= "s3c24xx-iis",
765 .num_resources
= ARRAY_SIZE(s3c_iis_resource
),
766 .resource
= s3c_iis_resource
,
768 .dma_mask
= &samsung_device_dma_mask
,
769 .coherent_dma_mask
= DMA_BIT_MASK(32),
772 #endif /* CONFIG_PLAT_S3C24XX */
774 #ifdef CONFIG_CPU_S3C2440
775 struct platform_device s3c2412_device_iis
= {
776 .name
= "s3c2412-iis",
779 .dma_mask
= &samsung_device_dma_mask
,
780 .coherent_dma_mask
= DMA_BIT_MASK(32),
783 #endif /* CONFIG_CPU_S3C2440 */
787 #ifdef CONFIG_SAMSUNG_DEV_IDE
788 static struct resource s3c_cfcon_resource
[] = {
789 [0] = DEFINE_RES_MEM(SAMSUNG_PA_CFCON
, SZ_16K
),
790 [1] = DEFINE_RES_IRQ(IRQ_CFCON
),
793 struct platform_device s3c_device_cfcon
= {
795 .num_resources
= ARRAY_SIZE(s3c_cfcon_resource
),
796 .resource
= s3c_cfcon_resource
,
799 void s3c_ide_set_platdata(struct s3c_ide_platdata
*pdata
)
801 s3c_set_platdata(pdata
, sizeof(struct s3c_ide_platdata
),
804 #endif /* CONFIG_SAMSUNG_DEV_IDE */
808 #ifdef CONFIG_SAMSUNG_DEV_KEYPAD
809 static struct resource samsung_keypad_resources
[] = {
810 [0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD
, SZ_32
),
811 [1] = DEFINE_RES_IRQ(IRQ_KEYPAD
),
814 struct platform_device samsung_device_keypad
= {
815 .name
= "samsung-keypad",
817 .num_resources
= ARRAY_SIZE(samsung_keypad_resources
),
818 .resource
= samsung_keypad_resources
,
821 void __init
samsung_keypad_set_platdata(struct samsung_keypad_platdata
*pd
)
823 struct samsung_keypad_platdata
*npd
;
825 npd
= s3c_set_platdata(pd
, sizeof(struct samsung_keypad_platdata
),
826 &samsung_device_keypad
);
829 npd
->cfg_gpio
= samsung_keypad_cfg_gpio
;
831 #endif /* CONFIG_SAMSUNG_DEV_KEYPAD */
835 #ifdef CONFIG_PLAT_S3C24XX
836 static struct resource s3c_lcd_resource
[] = {
837 [0] = DEFINE_RES_MEM(S3C24XX_PA_LCD
, S3C24XX_SZ_LCD
),
838 [1] = DEFINE_RES_IRQ(IRQ_LCD
),
841 struct platform_device s3c_device_lcd
= {
842 .name
= "s3c2410-lcd",
844 .num_resources
= ARRAY_SIZE(s3c_lcd_resource
),
845 .resource
= s3c_lcd_resource
,
847 .dma_mask
= &samsung_device_dma_mask
,
848 .coherent_dma_mask
= DMA_BIT_MASK(32),
852 void __init
s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info
*pd
)
854 struct s3c2410fb_mach_info
*npd
;
856 npd
= s3c_set_platdata(pd
, sizeof(*npd
), &s3c_device_lcd
);
858 npd
->displays
= kmemdup(pd
->displays
,
859 sizeof(struct s3c2410fb_display
) * npd
->num_displays
,
862 printk(KERN_ERR
"no memory for LCD display data\n");
864 printk(KERN_ERR
"no memory for LCD platform data\n");
867 #endif /* CONFIG_PLAT_S3C24XX */
871 #ifdef CONFIG_S5P_DEV_MFC
872 static struct resource s5p_mfc_resource
[] = {
873 [0] = DEFINE_RES_MEM(S5P_PA_MFC
, SZ_64K
),
874 [1] = DEFINE_RES_IRQ(IRQ_MFC
),
877 struct platform_device s5p_device_mfc
= {
880 .num_resources
= ARRAY_SIZE(s5p_mfc_resource
),
881 .resource
= s5p_mfc_resource
,
885 * MFC hardware has 2 memory interfaces which are modelled as two separate
886 * platform devices to let dma-mapping distinguish between them.
888 * MFC parent device (s5p_device_mfc) must be registered before memory
889 * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
892 struct platform_device s5p_device_mfc_l
= {
896 .parent
= &s5p_device_mfc
.dev
,
897 .dma_mask
= &samsung_device_dma_mask
,
898 .coherent_dma_mask
= DMA_BIT_MASK(32),
902 struct platform_device s5p_device_mfc_r
= {
906 .parent
= &s5p_device_mfc
.dev
,
907 .dma_mask
= &samsung_device_dma_mask
,
908 .coherent_dma_mask
= DMA_BIT_MASK(32),
911 #endif /* CONFIG_S5P_DEV_MFC */
915 #ifdef CONFIG_S5P_DEV_CSIS0
916 static struct resource s5p_mipi_csis0_resource
[] = {
917 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS0
, SZ_4K
),
918 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS0
),
921 struct platform_device s5p_device_mipi_csis0
= {
922 .name
= "s5p-mipi-csis",
924 .num_resources
= ARRAY_SIZE(s5p_mipi_csis0_resource
),
925 .resource
= s5p_mipi_csis0_resource
,
927 #endif /* CONFIG_S5P_DEV_CSIS0 */
929 #ifdef CONFIG_S5P_DEV_CSIS1
930 static struct resource s5p_mipi_csis1_resource
[] = {
931 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS1
, SZ_4K
),
932 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS1
),
935 struct platform_device s5p_device_mipi_csis1
= {
936 .name
= "s5p-mipi-csis",
938 .num_resources
= ARRAY_SIZE(s5p_mipi_csis1_resource
),
939 .resource
= s5p_mipi_csis1_resource
,
945 #ifdef CONFIG_S3C_DEV_NAND
946 static struct resource s3c_nand_resource
[] = {
947 [0] = DEFINE_RES_MEM(S3C_PA_NAND
, SZ_1M
),
950 struct platform_device s3c_device_nand
= {
951 .name
= "s3c2410-nand",
953 .num_resources
= ARRAY_SIZE(s3c_nand_resource
),
954 .resource
= s3c_nand_resource
,
958 * s3c_nand_copy_set() - copy nand set data
959 * @set: The new structure, directly copied from the old.
961 * Copy all the fields from the NAND set field from what is probably __initdata
962 * to new kernel memory. The code returns 0 if the copy happened correctly or
963 * an error code for the calling function to display.
965 * Note, we currently do not try and look to see if we've already copied the
966 * data in a previous set.
968 static int __init
s3c_nand_copy_set(struct s3c2410_nand_set
*set
)
973 size
= sizeof(struct mtd_partition
) * set
->nr_partitions
;
975 ptr
= kmemdup(set
->partitions
, size
, GFP_KERNEL
);
976 set
->partitions
= ptr
;
982 if (set
->nr_map
&& set
->nr_chips
) {
983 size
= sizeof(int) * set
->nr_chips
;
984 ptr
= kmemdup(set
->nr_map
, size
, GFP_KERNEL
);
991 if (set
->ecc_layout
) {
992 ptr
= kmemdup(set
->ecc_layout
,
993 sizeof(struct nand_ecclayout
), GFP_KERNEL
);
994 set
->ecc_layout
= ptr
;
1003 void __init
s3c_nand_set_platdata(struct s3c2410_platform_nand
*nand
)
1005 struct s3c2410_platform_nand
*npd
;
1009 /* note, if we get a failure in allocation, we simply drop out of the
1010 * function. If there is so little memory available at initialisation
1011 * time then there is little chance the system is going to run.
1014 npd
= s3c_set_platdata(nand
, sizeof(struct s3c2410_platform_nand
),
1019 /* now see if we need to copy any of the nand set data */
1021 size
= sizeof(struct s3c2410_nand_set
) * npd
->nr_sets
;
1023 struct s3c2410_nand_set
*from
= npd
->sets
;
1024 struct s3c2410_nand_set
*to
;
1027 to
= kmemdup(from
, size
, GFP_KERNEL
);
1028 npd
->sets
= to
; /* set, even if we failed */
1031 printk(KERN_ERR
"%s: no memory for sets\n", __func__
);
1035 for (i
= 0; i
< npd
->nr_sets
; i
++) {
1036 ret
= s3c_nand_copy_set(to
);
1038 printk(KERN_ERR
"%s: failed to copy set %d\n",
1046 #endif /* CONFIG_S3C_DEV_NAND */
1050 #ifdef CONFIG_S3C_DEV_ONENAND
1051 static struct resource s3c_onenand_resources
[] = {
1052 [0] = DEFINE_RES_MEM(S3C_PA_ONENAND
, SZ_1K
),
1053 [1] = DEFINE_RES_MEM(S3C_PA_ONENAND_BUF
, S3C_SZ_ONENAND_BUF
),
1054 [2] = DEFINE_RES_IRQ(IRQ_ONENAND
),
1057 struct platform_device s3c_device_onenand
= {
1058 .name
= "samsung-onenand",
1060 .num_resources
= ARRAY_SIZE(s3c_onenand_resources
),
1061 .resource
= s3c_onenand_resources
,
1063 #endif /* CONFIG_S3C_DEV_ONENAND */
1065 #ifdef CONFIG_S3C64XX_DEV_ONENAND1
1066 static struct resource s3c64xx_onenand1_resources
[] = {
1067 [0] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1
, SZ_1K
),
1068 [1] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1_BUF
, S3C64XX_SZ_ONENAND1_BUF
),
1069 [2] = DEFINE_RES_IRQ(IRQ_ONENAND1
),
1072 struct platform_device s3c64xx_device_onenand1
= {
1073 .name
= "samsung-onenand",
1075 .num_resources
= ARRAY_SIZE(s3c64xx_onenand1_resources
),
1076 .resource
= s3c64xx_onenand1_resources
,
1079 void s3c64xx_onenand1_set_platdata(struct onenand_platform_data
*pdata
)
1081 s3c_set_platdata(pdata
, sizeof(struct onenand_platform_data
),
1082 &s3c64xx_device_onenand1
);
1084 #endif /* CONFIG_S3C64XX_DEV_ONENAND1 */
1086 #ifdef CONFIG_S5P_DEV_ONENAND
1087 static struct resource s5p_onenand_resources
[] = {
1088 [0] = DEFINE_RES_MEM(S5P_PA_ONENAND
, SZ_128K
),
1089 [1] = DEFINE_RES_MEM(S5P_PA_ONENAND_DMA
, SZ_8K
),
1090 [2] = DEFINE_RES_IRQ(IRQ_ONENAND_AUDI
),
1093 struct platform_device s5p_device_onenand
= {
1094 .name
= "s5pc110-onenand",
1096 .num_resources
= ARRAY_SIZE(s5p_onenand_resources
),
1097 .resource
= s5p_onenand_resources
,
1099 #endif /* CONFIG_S5P_DEV_ONENAND */
1103 #ifdef CONFIG_PLAT_S5P
1104 static struct resource s5p_pmu_resource
[] = {
1105 DEFINE_RES_IRQ(IRQ_PMU
)
1108 struct platform_device s5p_device_pmu
= {
1110 .id
= ARM_PMU_DEVICE_CPU
,
1111 .num_resources
= ARRAY_SIZE(s5p_pmu_resource
),
1112 .resource
= s5p_pmu_resource
,
1115 static int __init
s5p_pmu_init(void)
1117 platform_device_register(&s5p_device_pmu
);
1120 arch_initcall(s5p_pmu_init
);
1121 #endif /* CONFIG_PLAT_S5P */
1125 #ifdef CONFIG_SAMSUNG_DEV_PWM
1127 #define TIMER_RESOURCE_SIZE (1)
1129 #define TIMER_RESOURCE(_tmr, _irq) \
1130 (struct resource [TIMER_RESOURCE_SIZE]) { \
1134 .flags = IORESOURCE_IRQ \
1138 #define DEFINE_S3C_TIMER(_tmr_no, _irq) \
1139 .name = "s3c24xx-pwm", \
1141 .num_resources = TIMER_RESOURCE_SIZE, \
1142 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
1145 * since we already have an static mapping for the timer,
1146 * we do not bother setting any IO resource for the base.
1149 struct platform_device s3c_device_timer
[] = {
1150 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0
) },
1151 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1
) },
1152 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2
) },
1153 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3
) },
1154 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4
) },
1156 #endif /* CONFIG_SAMSUNG_DEV_PWM */
1160 #ifdef CONFIG_PLAT_S3C24XX
1161 static struct resource s3c_rtc_resource
[] = {
1162 [0] = DEFINE_RES_MEM(S3C24XX_PA_RTC
, SZ_256
),
1163 [1] = DEFINE_RES_IRQ(IRQ_RTC
),
1164 [2] = DEFINE_RES_IRQ(IRQ_TICK
),
1167 struct platform_device s3c_device_rtc
= {
1168 .name
= "s3c2410-rtc",
1170 .num_resources
= ARRAY_SIZE(s3c_rtc_resource
),
1171 .resource
= s3c_rtc_resource
,
1173 #endif /* CONFIG_PLAT_S3C24XX */
1175 #ifdef CONFIG_S3C_DEV_RTC
1176 static struct resource s3c_rtc_resource
[] = {
1177 [0] = DEFINE_RES_MEM(S3C_PA_RTC
, SZ_256
),
1178 [1] = DEFINE_RES_IRQ(IRQ_RTC_ALARM
),
1179 [2] = DEFINE_RES_IRQ(IRQ_RTC_TIC
),
1182 struct platform_device s3c_device_rtc
= {
1183 .name
= "s3c64xx-rtc",
1185 .num_resources
= ARRAY_SIZE(s3c_rtc_resource
),
1186 .resource
= s3c_rtc_resource
,
1188 #endif /* CONFIG_S3C_DEV_RTC */
1192 #ifdef CONFIG_PLAT_S3C24XX
1193 static struct resource s3c_sdi_resource
[] = {
1194 [0] = DEFINE_RES_MEM(S3C24XX_PA_SDI
, S3C24XX_SZ_SDI
),
1195 [1] = DEFINE_RES_IRQ(IRQ_SDI
),
1198 struct platform_device s3c_device_sdi
= {
1199 .name
= "s3c2410-sdi",
1201 .num_resources
= ARRAY_SIZE(s3c_sdi_resource
),
1202 .resource
= s3c_sdi_resource
,
1205 void __init
s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata
*pdata
)
1207 s3c_set_platdata(pdata
, sizeof(struct s3c24xx_mci_pdata
),
1210 #endif /* CONFIG_PLAT_S3C24XX */
1214 #ifdef CONFIG_PLAT_S3C24XX
1215 static struct resource s3c_spi0_resource
[] = {
1216 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI
, SZ_32
),
1217 [1] = DEFINE_RES_IRQ(IRQ_SPI0
),
1220 struct platform_device s3c_device_spi0
= {
1221 .name
= "s3c2410-spi",
1223 .num_resources
= ARRAY_SIZE(s3c_spi0_resource
),
1224 .resource
= s3c_spi0_resource
,
1226 .dma_mask
= &samsung_device_dma_mask
,
1227 .coherent_dma_mask
= DMA_BIT_MASK(32),
1231 static struct resource s3c_spi1_resource
[] = {
1232 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI1
, SZ_32
),
1233 [1] = DEFINE_RES_IRQ(IRQ_SPI1
),
1236 struct platform_device s3c_device_spi1
= {
1237 .name
= "s3c2410-spi",
1239 .num_resources
= ARRAY_SIZE(s3c_spi1_resource
),
1240 .resource
= s3c_spi1_resource
,
1242 .dma_mask
= &samsung_device_dma_mask
,
1243 .coherent_dma_mask
= DMA_BIT_MASK(32),
1246 #endif /* CONFIG_PLAT_S3C24XX */
1250 #ifdef CONFIG_PLAT_S3C24XX
1251 static struct resource s3c_ts_resource
[] = {
1252 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC
, S3C24XX_SZ_ADC
),
1253 [1] = DEFINE_RES_IRQ(IRQ_TC
),
1256 struct platform_device s3c_device_ts
= {
1257 .name
= "s3c2410-ts",
1259 .dev
.parent
= &s3c_device_adc
.dev
,
1260 .num_resources
= ARRAY_SIZE(s3c_ts_resource
),
1261 .resource
= s3c_ts_resource
,
1264 void __init
s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info
*hard_s3c2410ts_info
)
1266 s3c_set_platdata(hard_s3c2410ts_info
,
1267 sizeof(struct s3c2410_ts_mach_info
), &s3c_device_ts
);
1269 #endif /* CONFIG_PLAT_S3C24XX */
1271 #ifdef CONFIG_SAMSUNG_DEV_TS
1272 static struct resource s3c_ts_resource
[] = {
1273 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC
, SZ_256
),
1274 [1] = DEFINE_RES_IRQ(IRQ_TC
),
1277 static struct s3c2410_ts_mach_info default_ts_data __initdata
= {
1280 .oversampling_shift
= 2,
1283 struct platform_device s3c_device_ts
= {
1284 .name
= "s3c64xx-ts",
1286 .num_resources
= ARRAY_SIZE(s3c_ts_resource
),
1287 .resource
= s3c_ts_resource
,
1290 void __init
s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info
*pd
)
1293 pd
= &default_ts_data
;
1295 s3c_set_platdata(pd
, sizeof(struct s3c2410_ts_mach_info
),
1298 #endif /* CONFIG_SAMSUNG_DEV_TS */
1302 #ifdef CONFIG_S5P_DEV_TV
1304 static struct resource s5p_hdmi_resources
[] = {
1305 [0] = DEFINE_RES_MEM(S5P_PA_HDMI
, SZ_1M
),
1306 [1] = DEFINE_RES_IRQ(IRQ_HDMI
),
1309 struct platform_device s5p_device_hdmi
= {
1312 .num_resources
= ARRAY_SIZE(s5p_hdmi_resources
),
1313 .resource
= s5p_hdmi_resources
,
1316 static struct resource s5p_sdo_resources
[] = {
1317 [0] = DEFINE_RES_MEM(S5P_PA_SDO
, SZ_64K
),
1318 [1] = DEFINE_RES_IRQ(IRQ_SDO
),
1321 struct platform_device s5p_device_sdo
= {
1324 .num_resources
= ARRAY_SIZE(s5p_sdo_resources
),
1325 .resource
= s5p_sdo_resources
,
1328 static struct resource s5p_mixer_resources
[] = {
1329 [0] = DEFINE_RES_MEM_NAMED(S5P_PA_MIXER
, SZ_64K
, "mxr"),
1330 [1] = DEFINE_RES_MEM_NAMED(S5P_PA_VP
, SZ_64K
, "vp"),
1331 [2] = DEFINE_RES_IRQ_NAMED(IRQ_MIXER
, "irq"),
1334 struct platform_device s5p_device_mixer
= {
1335 .name
= "s5p-mixer",
1337 .num_resources
= ARRAY_SIZE(s5p_mixer_resources
),
1338 .resource
= s5p_mixer_resources
,
1340 .dma_mask
= &samsung_device_dma_mask
,
1341 .coherent_dma_mask
= DMA_BIT_MASK(32),
1344 #endif /* CONFIG_S5P_DEV_TV */
1348 #ifdef CONFIG_S3C_DEV_USB_HOST
1349 static struct resource s3c_usb_resource
[] = {
1350 [0] = DEFINE_RES_MEM(S3C_PA_USBHOST
, SZ_256
),
1351 [1] = DEFINE_RES_IRQ(IRQ_USBH
),
1354 struct platform_device s3c_device_ohci
= {
1355 .name
= "s3c2410-ohci",
1357 .num_resources
= ARRAY_SIZE(s3c_usb_resource
),
1358 .resource
= s3c_usb_resource
,
1360 .dma_mask
= &samsung_device_dma_mask
,
1361 .coherent_dma_mask
= DMA_BIT_MASK(32),
1366 * s3c_ohci_set_platdata - initialise OHCI device platform data
1367 * @info: The platform data.
1369 * This call copies the @info passed in and sets the device .platform_data
1370 * field to that copy. The @info is copied so that the original can be marked
1374 void __init
s3c_ohci_set_platdata(struct s3c2410_hcd_info
*info
)
1376 s3c_set_platdata(info
, sizeof(struct s3c2410_hcd_info
),
1379 #endif /* CONFIG_S3C_DEV_USB_HOST */
1381 /* USB Device (Gadget) */
1383 #ifdef CONFIG_PLAT_S3C24XX
1384 static struct resource s3c_usbgadget_resource
[] = {
1385 [0] = DEFINE_RES_MEM(S3C24XX_PA_USBDEV
, S3C24XX_SZ_USBDEV
),
1386 [1] = DEFINE_RES_IRQ(IRQ_USBD
),
1389 struct platform_device s3c_device_usbgadget
= {
1390 .name
= "s3c2410-usbgadget",
1392 .num_resources
= ARRAY_SIZE(s3c_usbgadget_resource
),
1393 .resource
= s3c_usbgadget_resource
,
1396 void __init
s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info
*pd
)
1398 s3c_set_platdata(pd
, sizeof(*pd
), &s3c_device_usbgadget
);
1400 #endif /* CONFIG_PLAT_S3C24XX */
1402 /* USB EHCI Host Controller */
1404 #ifdef CONFIG_S5P_DEV_USB_EHCI
1405 static struct resource s5p_ehci_resource
[] = {
1406 [0] = DEFINE_RES_MEM(S5P_PA_EHCI
, SZ_256
),
1407 [1] = DEFINE_RES_IRQ(IRQ_USB_HOST
),
1410 struct platform_device s5p_device_ehci
= {
1413 .num_resources
= ARRAY_SIZE(s5p_ehci_resource
),
1414 .resource
= s5p_ehci_resource
,
1416 .dma_mask
= &samsung_device_dma_mask
,
1417 .coherent_dma_mask
= DMA_BIT_MASK(32),
1421 void __init
s5p_ehci_set_platdata(struct s5p_ehci_platdata
*pd
)
1423 struct s5p_ehci_platdata
*npd
;
1425 npd
= s3c_set_platdata(pd
, sizeof(struct s5p_ehci_platdata
),
1429 npd
->phy_init
= s5p_usb_phy_init
;
1431 npd
->phy_exit
= s5p_usb_phy_exit
;
1433 #endif /* CONFIG_S5P_DEV_USB_EHCI */
1437 #ifdef CONFIG_S3C_DEV_USB_HSOTG
1438 static struct resource s3c_usb_hsotg_resources
[] = {
1439 [0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG
, SZ_16K
),
1440 [1] = DEFINE_RES_IRQ(IRQ_OTG
),
1443 struct platform_device s3c_device_usb_hsotg
= {
1444 .name
= "s3c-hsotg",
1446 .num_resources
= ARRAY_SIZE(s3c_usb_hsotg_resources
),
1447 .resource
= s3c_usb_hsotg_resources
,
1449 .dma_mask
= &samsung_device_dma_mask
,
1450 .coherent_dma_mask
= DMA_BIT_MASK(32),
1454 void __init
s3c_hsotg_set_platdata(struct s3c_hsotg_plat
*pd
)
1456 struct s3c_hsotg_plat
*npd
;
1458 npd
= s3c_set_platdata(pd
, sizeof(struct s3c_hsotg_plat
),
1459 &s3c_device_usb_hsotg
);
1462 npd
->phy_init
= s5p_usb_phy_init
;
1464 npd
->phy_exit
= s5p_usb_phy_exit
;
1466 #endif /* CONFIG_S3C_DEV_USB_HSOTG */
1468 /* USB High Spped 2.0 Device (Gadget) */
1470 #ifdef CONFIG_PLAT_S3C24XX
1471 static struct resource s3c_hsudc_resource
[] = {
1472 [0] = DEFINE_RES_MEM(S3C2416_PA_HSUDC
, S3C2416_SZ_HSUDC
),
1473 [1] = DEFINE_RES_IRQ(IRQ_USBD
),
1476 struct platform_device s3c_device_usb_hsudc
= {
1477 .name
= "s3c-hsudc",
1479 .num_resources
= ARRAY_SIZE(s3c_hsudc_resource
),
1480 .resource
= s3c_hsudc_resource
,
1482 .dma_mask
= &samsung_device_dma_mask
,
1483 .coherent_dma_mask
= DMA_BIT_MASK(32),
1487 void __init
s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata
*pd
)
1489 s3c_set_platdata(pd
, sizeof(*pd
), &s3c_device_usb_hsudc
);
1491 #endif /* CONFIG_PLAT_S3C24XX */
1495 #ifdef CONFIG_S3C_DEV_WDT
1496 static struct resource s3c_wdt_resource
[] = {
1497 [0] = DEFINE_RES_MEM(S3C_PA_WDT
, SZ_1K
),
1498 [1] = DEFINE_RES_IRQ(IRQ_WDT
),
1501 struct platform_device s3c_device_wdt
= {
1502 .name
= "s3c2410-wdt",
1504 .num_resources
= ARRAY_SIZE(s3c_wdt_resource
),
1505 .resource
= s3c_wdt_resource
,
1507 #endif /* CONFIG_S3C_DEV_WDT */
1509 #ifdef CONFIG_S3C64XX_DEV_SPI0
1510 static struct resource s3c64xx_spi0_resource
[] = {
1511 [0] = DEFINE_RES_MEM(S3C_PA_SPI0
, SZ_256
),
1512 [1] = DEFINE_RES_DMA(DMACH_SPI0_TX
),
1513 [2] = DEFINE_RES_DMA(DMACH_SPI0_RX
),
1514 [3] = DEFINE_RES_IRQ(IRQ_SPI0
),
1517 struct platform_device s3c64xx_device_spi0
= {
1518 .name
= "s3c64xx-spi",
1520 .num_resources
= ARRAY_SIZE(s3c64xx_spi0_resource
),
1521 .resource
= s3c64xx_spi0_resource
,
1523 .dma_mask
= &samsung_device_dma_mask
,
1524 .coherent_dma_mask
= DMA_BIT_MASK(32),
1528 void __init
s3c64xx_spi0_set_platdata(struct s3c64xx_spi_info
*pd
,
1529 int src_clk_nr
, int num_cs
)
1532 pr_err("%s:Need to pass platform data\n", __func__
);
1536 /* Reject invalid configuration */
1537 if (!num_cs
|| src_clk_nr
< 0) {
1538 pr_err("%s: Invalid SPI configuration\n", __func__
);
1542 pd
->num_cs
= num_cs
;
1543 pd
->src_clk_nr
= src_clk_nr
;
1545 pd
->cfg_gpio
= s3c64xx_spi0_cfg_gpio
;
1547 s3c_set_platdata(pd
, sizeof(*pd
), &s3c64xx_device_spi0
);
1549 #endif /* CONFIG_S3C64XX_DEV_SPI0 */
1551 #ifdef CONFIG_S3C64XX_DEV_SPI1
1552 static struct resource s3c64xx_spi1_resource
[] = {
1553 [0] = DEFINE_RES_MEM(S3C_PA_SPI1
, SZ_256
),
1554 [1] = DEFINE_RES_DMA(DMACH_SPI1_TX
),
1555 [2] = DEFINE_RES_DMA(DMACH_SPI1_RX
),
1556 [3] = DEFINE_RES_IRQ(IRQ_SPI1
),
1559 struct platform_device s3c64xx_device_spi1
= {
1560 .name
= "s3c64xx-spi",
1562 .num_resources
= ARRAY_SIZE(s3c64xx_spi1_resource
),
1563 .resource
= s3c64xx_spi1_resource
,
1565 .dma_mask
= &samsung_device_dma_mask
,
1566 .coherent_dma_mask
= DMA_BIT_MASK(32),
1570 void __init
s3c64xx_spi1_set_platdata(struct s3c64xx_spi_info
*pd
,
1571 int src_clk_nr
, int num_cs
)
1574 pr_err("%s:Need to pass platform data\n", __func__
);
1578 /* Reject invalid configuration */
1579 if (!num_cs
|| src_clk_nr
< 0) {
1580 pr_err("%s: Invalid SPI configuration\n", __func__
);
1584 pd
->num_cs
= num_cs
;
1585 pd
->src_clk_nr
= src_clk_nr
;
1587 pd
->cfg_gpio
= s3c64xx_spi1_cfg_gpio
;
1589 s3c_set_platdata(pd
, sizeof(*pd
), &s3c64xx_device_spi1
);
1591 #endif /* CONFIG_S3C64XX_DEV_SPI1 */
1593 #ifdef CONFIG_S3C64XX_DEV_SPI2
1594 static struct resource s3c64xx_spi2_resource
[] = {
1595 [0] = DEFINE_RES_MEM(S3C_PA_SPI2
, SZ_256
),
1596 [1] = DEFINE_RES_DMA(DMACH_SPI2_TX
),
1597 [2] = DEFINE_RES_DMA(DMACH_SPI2_RX
),
1598 [3] = DEFINE_RES_IRQ(IRQ_SPI2
),
1601 struct platform_device s3c64xx_device_spi2
= {
1602 .name
= "s3c64xx-spi",
1604 .num_resources
= ARRAY_SIZE(s3c64xx_spi2_resource
),
1605 .resource
= s3c64xx_spi2_resource
,
1607 .dma_mask
= &samsung_device_dma_mask
,
1608 .coherent_dma_mask
= DMA_BIT_MASK(32),
1612 void __init
s3c64xx_spi2_set_platdata(struct s3c64xx_spi_info
*pd
,
1613 int src_clk_nr
, int num_cs
)
1616 pr_err("%s:Need to pass platform data\n", __func__
);
1620 /* Reject invalid configuration */
1621 if (!num_cs
|| src_clk_nr
< 0) {
1622 pr_err("%s: Invalid SPI configuration\n", __func__
);
1626 pd
->num_cs
= num_cs
;
1627 pd
->src_clk_nr
= src_clk_nr
;
1629 pd
->cfg_gpio
= s3c64xx_spi2_cfg_gpio
;
1631 s3c_set_platdata(pd
, sizeof(*pd
), &s3c64xx_device_spi2
);
1633 #endif /* CONFIG_S3C64XX_DEV_SPI2 */