aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2011-10-02 20:47:58 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-10-05 22:15:11 -0400
commitbad1e6aadd17c97b0d10e8ccd9205ea5b7858c53 (patch)
treea3aed0a1fc21fae6d9416dd37ac203613f34ffb9 /arch/arm/plat-samsung
parent5716714927b789a27853eaacdbba1f2675505af0 (diff)
ARM: SAMSUNG: Cleanup plat-samsung/devs.c and devs.h
This patch merges each dev files to one devs.c file in plat-samsung directory and this help to keep it more easily to reduce plat- directories such as plat-s3c24xx and plat-s5p. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r--arch/arm/plat-samsung/Makefile28
-rw-r--r--arch/arm/plat-samsung/dev-adc.c46
-rw-r--r--arch/arm/plat-samsung/dev-asocdma.c35
-rw-r--r--arch/arm/plat-samsung/dev-fb.c63
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc.c62
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc1.c62
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc2.c63
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc3.c66
-rw-r--r--arch/arm/plat-samsung/dev-hwmon.c32
-rw-r--r--arch/arm/plat-samsung/dev-i2c0.c70
-rw-r--r--arch/arm/plat-samsung/dev-i2c1.c61
-rw-r--r--arch/arm/plat-samsung/dev-i2c2.c62
-rw-r--r--arch/arm/plat-samsung/dev-i2c3.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c4.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c5.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c6.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c7.c60
-rw-r--r--arch/arm/plat-samsung/dev-ide.c44
-rw-r--r--arch/arm/plat-samsung/dev-keypad.c50
-rw-r--r--arch/arm/plat-samsung/dev-nand.c125
-rw-r--r--arch/arm/plat-samsung/dev-onenand.c43
-rw-r--r--arch/arm/plat-samsung/dev-pwm.c53
-rw-r--r--arch/arm/plat-samsung/dev-rtc.c43
-rw-r--r--arch/arm/plat-samsung/dev-ts.c59
-rw-r--r--arch/arm/plat-samsung/dev-usb-hsotg.c48
-rw-r--r--arch/arm/plat-samsung/dev-usb.c65
-rw-r--r--arch/arm/plat-samsung/dev-wdt.c40
-rw-r--r--arch/arm/plat-samsung/devs.c987
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h156
29 files changed, 1058 insertions, 1605 deletions
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 410a090cf663..a524fab221dd 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -15,7 +15,6 @@ obj-y += init.o cpu.o
15obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o 15obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o
16obj-y += clock.o 16obj-y += clock.o
17obj-y += pwm-clock.o 17obj-y += pwm-clock.o
18obj-y += dev-asocdma.o
19 18
20obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o 19obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o
21 20
@@ -31,33 +30,8 @@ obj-$(CONFIG_S3C_ADC) += adc.o
31obj-y += platformdata.o 30obj-y += platformdata.o
32 31
33obj-y += devs.o 32obj-y += devs.o
34obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
35obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
36obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
37obj-$(CONFIG_S3C_DEV_HSMMC3) += dev-hsmmc3.o
38obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o
39obj-y += dev-i2c0.o
40obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
41obj-$(CONFIG_S3C_DEV_I2C2) += dev-i2c2.o
42obj-$(CONFIG_S3C_DEV_I2C3) += dev-i2c3.o
43obj-$(CONFIG_S3C_DEV_I2C4) += dev-i2c4.o
44obj-$(CONFIG_S3C_DEV_I2C5) += dev-i2c5.o
45obj-$(CONFIG_S3C_DEV_I2C6) += dev-i2c6.o
46obj-$(CONFIG_S3C_DEV_I2C7) += dev-i2c7.o
47obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
48obj-y += dev-uart.o 33obj-y += dev-uart.o
49obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o 34
50obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
51obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
52obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
53obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o
54obj-$(CONFIG_S3C_DEV_RTC) += dev-rtc.o
55
56obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o
57obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o
58obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o
59obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o
60obj-$(CONFIG_SAMSUNG_DEV_PWM) += dev-pwm.o
61obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT) += dev-backlight.o 35obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT) += dev-backlight.o
62 36
63# DMA support 37# DMA support
diff --git a/arch/arm/plat-samsung/dev-adc.c b/arch/arm/plat-samsung/dev-adc.c
deleted file mode 100644
index 9d903d4095ed..000000000000
--- a/arch/arm/plat-samsung/dev-adc.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-adc.c
2 *
3 * Copyright 2010 Maurus Cuelenaere
4 *
5 * S3C64xx series device definition for ADC device
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/platform_device.h>
15
16#include <mach/irqs.h>
17#include <mach/map.h>
18
19#include <plat/adc.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23static struct resource s3c_adc_resource[] = {
24 [0] = {
25 .start = SAMSUNG_PA_ADC,
26 .end = SAMSUNG_PA_ADC + SZ_256 - 1,
27 .flags = IORESOURCE_MEM,
28 },
29 [1] = {
30 .start = IRQ_TC,
31 .end = IRQ_TC,
32 .flags = IORESOURCE_IRQ,
33 },
34 [2] = {
35 .start = IRQ_ADC,
36 .end = IRQ_ADC,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41struct platform_device s3c_device_adc = {
42 .name = "samsung-adc",
43 .id = -1,
44 .num_resources = ARRAY_SIZE(s3c_adc_resource),
45 .resource = s3c_adc_resource,
46};
diff --git a/arch/arm/plat-samsung/dev-asocdma.c b/arch/arm/plat-samsung/dev-asocdma.c
deleted file mode 100644
index 97e35d3c064d..000000000000
--- a/arch/arm/plat-samsung/dev-asocdma.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-asocdma.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/platform_device.h>
12#include <linux/dma-mapping.h>
13#include <plat/devs.h>
14
15static u64 audio_dmamask = DMA_BIT_MASK(32);
16
17struct platform_device samsung_asoc_dma = {
18 .name = "samsung-audio",
19 .id = -1,
20 .dev = {
21 .dma_mask = &audio_dmamask,
22 .coherent_dma_mask = DMA_BIT_MASK(32),
23 }
24};
25EXPORT_SYMBOL(samsung_asoc_dma);
26
27struct platform_device samsung_asoc_idma = {
28 .name = "samsung-idma",
29 .id = -1,
30 .dev = {
31 .dma_mask = &audio_dmamask,
32 .coherent_dma_mask = DMA_BIT_MASK(32),
33 }
34};
35EXPORT_SYMBOL(samsung_asoc_idma);
diff --git a/arch/arm/plat-samsung/dev-fb.c b/arch/arm/plat-samsung/dev-fb.c
deleted file mode 100644
index 49a1362fd25b..000000000000
--- a/arch/arm/plat-samsung/dev-fb.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-fb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for framebuffer device
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
18#include <linux/gfp.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/fb.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s3c_fb_resource[] = {
28 [0] = {
29 .start = S3C_PA_FB,
30 .end = S3C_PA_FB + SZ_16K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_LCD_VSYNC,
35 .end = IRQ_LCD_VSYNC,
36 .flags = IORESOURCE_IRQ,
37 },
38 [2] = {
39 .start = IRQ_LCD_FIFO,
40 .end = IRQ_LCD_FIFO,
41 .flags = IORESOURCE_IRQ,
42 },
43 [3] = {
44 .start = IRQ_LCD_SYSTEM,
45 .end = IRQ_LCD_SYSTEM,
46 .flags = IORESOURCE_IRQ,
47 },
48};
49
50struct platform_device s3c_device_fb = {
51 .name = "s3c-fb",
52 .id = -1,
53 .num_resources = ARRAY_SIZE(s3c_fb_resource),
54 .resource = s3c_fb_resource,
55 .dev.dma_mask = &s3c_device_fb.dev.coherent_dma_mask,
56 .dev.coherent_dma_mask = 0xffffffffUL,
57};
58
59void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
60{
61 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
62 &s3c_device_fb);
63}
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
deleted file mode 100644
index 06825c4276de..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for hsmmc devices
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/mmc/host.h>
17
18#include <mach/map.h>
19#include <plat/sdhci.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC0,
28 .end = S3C_PA_HSMMC0 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC0,
33 .end = IRQ_HSMMC0,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL;
39
40struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
45};
46
47struct platform_device s3c_device_hsmmc0 = {
48 .name = "s3c-sdhci",
49 .id = 0,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
51 .resource = s3c_hsmmc_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc0_def_platdata,
56 },
57};
58
59void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
62}
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
deleted file mode 100644
index 4524ef440010..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc1.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc1.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for hsmmc device 1
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/mmc/host.h>
17
18#include <mach/map.h>
19#include <plat/sdhci.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc1_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC1,
28 .end = S3C_PA_HSMMC1 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC1,
33 .end = IRQ_HSMMC1,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc1_dmamask = 0xffffffffUL;
39
40struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
45};
46
47struct platform_device s3c_device_hsmmc1 = {
48 .name = "s3c-sdhci",
49 .id = 1,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
51 .resource = s3c_hsmmc1_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc1_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc1_def_platdata,
56 },
57};
58
59void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
62}
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
deleted file mode 100644
index 9cede9615e48..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc2.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc2.c
2 *
3 * Copyright (c) 2009 Samsung Electronics
4 * Copyright (c) 2009 Maurus Cuelenaere
5 *
6 * Based on arch/arm/plat-s3c/dev-hsmmc1.c
7 * original file Copyright (c) 2008 Simtec Electronics
8 *
9 * S3C series device definition for hsmmc device 2
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
18#include <linux/mmc/host.h>
19
20#include <mach/map.h>
21#include <plat/sdhci.h>
22#include <plat/devs.h>
23
24#define S3C_SZ_HSMMC (0x1000)
25
26static struct resource s3c_hsmmc2_resource[] = {
27 [0] = {
28 .start = S3C_PA_HSMMC2,
29 .end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_HSMMC2,
34 .end = IRQ_HSMMC2,
35 .flags = IORESOURCE_IRQ,
36 }
37};
38
39static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL;
40
41struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
42 .max_width = 4,
43 .host_caps = (MMC_CAP_4_BIT_DATA |
44 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
45 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
46};
47
48struct platform_device s3c_device_hsmmc2 = {
49 .name = "s3c-sdhci",
50 .id = 2,
51 .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
52 .resource = s3c_hsmmc2_resource,
53 .dev = {
54 .dma_mask = &s3c_device_hsmmc2_dmamask,
55 .coherent_dma_mask = 0xffffffffUL,
56 .platform_data = &s3c_hsmmc2_def_platdata,
57 },
58};
59
60void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
61{
62 s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
63}
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c
deleted file mode 100644
index 0358ef4a8f66..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc3.c
+++ /dev/null
@@ -1,66 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-hsmmc3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2008 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 * http://armlinux.simtec.co.uk/
9 *
10 * Based on arch/arm/plat-samsung/dev-hsmmc1.c
11 *
12 * Samsung device definition for hsmmc device 3
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17*/
18
19#include <linux/kernel.h>
20#include <linux/platform_device.h>
21#include <linux/mmc/host.h>
22
23#include <mach/map.h>
24#include <plat/sdhci.h>
25#include <plat/devs.h>
26
27#define S3C_SZ_HSMMC (0x1000)
28
29static struct resource s3c_hsmmc3_resource[] = {
30 [0] = {
31 .start = S3C_PA_HSMMC3,
32 .end = S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1,
33 .flags = IORESOURCE_MEM,
34 },
35 [1] = {
36 .start = IRQ_HSMMC3,
37 .end = IRQ_HSMMC3,
38 .flags = IORESOURCE_IRQ,
39 }
40};
41
42static u64 s3c_device_hsmmc3_dmamask = 0xffffffffUL;
43
44struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
45 .max_width = 4,
46 .host_caps = (MMC_CAP_4_BIT_DATA |
47 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
48 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
49};
50
51struct platform_device s3c_device_hsmmc3 = {
52 .name = "s3c-sdhci",
53 .id = 3,
54 .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource),
55 .resource = s3c_hsmmc3_resource,
56 .dev = {
57 .dma_mask = &s3c_device_hsmmc3_dmamask,
58 .coherent_dma_mask = 0xffffffffUL,
59 .platform_data = &s3c_hsmmc3_def_platdata,
60 },
61};
62
63void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
64{
65 s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
66}
diff --git a/arch/arm/plat-samsung/dev-hwmon.c b/arch/arm/plat-samsung/dev-hwmon.c
deleted file mode 100644
index c91a79ce8f39..000000000000
--- a/arch/arm/plat-samsung/dev-hwmon.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-hwmon.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * Adapted for HWMON by Maurus Cuelenaere
8 *
9 * Samsung series device definition for HWMON
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
18
19#include <plat/devs.h>
20#include <plat/hwmon.h>
21
22struct platform_device s3c_device_hwmon = {
23 .name = "s3c-hwmon",
24 .id = -1,
25 .dev.parent = &s3c_device_adc.dev,
26};
27
28void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
29{
30 s3c_set_platdata(pd, sizeof(struct s3c_hwmon_pdata),
31 &s3c_device_hwmon);
32}
diff --git a/arch/arm/plat-samsung/dev-i2c0.c b/arch/arm/plat-samsung/dev-i2c0.c
deleted file mode 100644
index f8251f5098bd..000000000000
--- a/arch/arm/plat-samsung/dev-i2c0.c
+++ /dev/null
@@ -1,70 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-i2c0.c
2 *
3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for i2c device 0
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/gfp.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/platform_device.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/regs-iic.h>
23#include <plat/iic.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s3c_i2c_resource[] = {
28 [0] = {
29 .start = S3C_PA_IIC,
30 .end = S3C_PA_IIC + SZ_4K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_IIC,
35 .end = IRQ_IIC,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40struct platform_device s3c_device_i2c0 = {
41 .name = "s3c2410-i2c",
42#ifdef CONFIG_S3C_DEV_I2C1
43 .id = 0,
44#else
45 .id = -1,
46#endif
47 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
48 .resource = s3c_i2c_resource,
49};
50
51struct s3c2410_platform_i2c default_i2c_data __initdata = {
52 .flags = 0,
53 .slave_addr = 0x10,
54 .frequency = 100*1000,
55 .sda_delay = 100,
56};
57
58void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
59{
60 struct s3c2410_platform_i2c *npd;
61
62 if (!pd)
63 pd = &default_i2c_data;
64
65 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
66 &s3c_device_i2c0);
67
68 if (!npd->cfg_gpio)
69 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
70}
diff --git a/arch/arm/plat-samsung/dev-i2c1.c b/arch/arm/plat-samsung/dev-i2c1.c
deleted file mode 100644
index 3b7c7bec1cf9..000000000000
--- a/arch/arm/plat-samsung/dev-i2c1.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-i2c1.c
2 *
3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for i2c device 1
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/gfp.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/platform_device.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/regs-iic.h>
23#include <plat/iic.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s3c_i2c_resource[] = {
28 [0] = {
29 .start = S3C_PA_IIC1,
30 .end = S3C_PA_IIC1 + SZ_4K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_IIC1,
35 .end = IRQ_IIC1,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40struct platform_device s3c_device_i2c1 = {
41 .name = "s3c2410-i2c",
42 .id = 1,
43 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
44 .resource = s3c_i2c_resource,
45};
46
47void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
48{
49 struct s3c2410_platform_i2c *npd;
50
51 if (!pd) {
52 pd = &default_i2c_data;
53 pd->bus_num = 1;
54 }
55
56 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
57 &s3c_device_i2c1);
58
59 if (!npd->cfg_gpio)
60 npd->cfg_gpio = s3c_i2c1_cfg_gpio;
61}
diff --git a/arch/arm/plat-samsung/dev-i2c2.c b/arch/arm/plat-samsung/dev-i2c2.c
deleted file mode 100644
index 07e9fd0b1b8b..000000000000
--- a/arch/arm/plat-samsung/dev-i2c2.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-i2c2.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S3C series device definition for i2c device 2
7 *
8 * Based on plat-samsung/dev-i2c0.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/gfp.h>
16#include <linux/kernel.h>
17#include <linux/string.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/regs-iic.h>
24#include <plat/iic.h>
25#include <plat/devs.h>
26#include <plat/cpu.h>
27
28static struct resource s3c_i2c_resource[] = {
29 [0] = {
30 .start = S3C_PA_IIC2,
31 .end = S3C_PA_IIC2 + SZ_4K - 1,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = IRQ_IIC2,
36 .end = IRQ_IIC2,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41struct platform_device s3c_device_i2c2 = {
42 .name = "s3c2410-i2c",
43 .id = 2,
44 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
45 .resource = s3c_i2c_resource,
46};
47
48void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
49{
50 struct s3c2410_platform_i2c *npd;
51
52 if (!pd) {
53 pd = &default_i2c_data;
54 pd->bus_num = 2;
55 }
56
57 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
58 &s3c_device_i2c2);
59
60 if (!npd->cfg_gpio)
61 npd->cfg_gpio = s3c_i2c2_cfg_gpio;
62}
diff --git a/arch/arm/plat-samsung/dev-i2c3.c b/arch/arm/plat-samsung/dev-i2c3.c
deleted file mode 100644
index d48efa93c6e7..000000000000
--- a/arch/arm/plat-samsung/dev-i2c3.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 3
7 *
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.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC3,
29 .end = S3C_PA_IIC3 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC3,
34 .end = IRQ_IIC3,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c3 = {
40 .name = "s3c2440-i2c",
41 .id = 3,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 3;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c3);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c3_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c4.c b/arch/arm/plat-samsung/dev-i2c4.c
deleted file mode 100644
index 07e26444efe6..000000000000
--- a/arch/arm/plat-samsung/dev-i2c4.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c4.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 3
7 *
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.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC4,
29 .end = S3C_PA_IIC4 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC4,
34 .end = IRQ_IIC4,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c4 = {
40 .name = "s3c2440-i2c",
41 .id = 4,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 4;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c4);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c4_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c5.c b/arch/arm/plat-samsung/dev-i2c5.c
deleted file mode 100644
index f49655784563..000000000000
--- a/arch/arm/plat-samsung/dev-i2c5.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 3
7 *
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.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC5,
29 .end = S3C_PA_IIC5 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC5,
34 .end = IRQ_IIC5,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c5 = {
40 .name = "s3c2440-i2c",
41 .id = 5,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 5;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c5);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c5_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c6.c b/arch/arm/plat-samsung/dev-i2c6.c
deleted file mode 100644
index 141d799944e2..000000000000
--- a/arch/arm/plat-samsung/dev-i2c6.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c6.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 6
7 *
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.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC6,
29 .end = S3C_PA_IIC6 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC6,
34 .end = IRQ_IIC6,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c6 = {
40 .name = "s3c2440-i2c",
41 .id = 6,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 6;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c6);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c6_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c7.c b/arch/arm/plat-samsung/dev-i2c7.c
deleted file mode 100644
index 9dddcd1665b5..000000000000
--- a/arch/arm/plat-samsung/dev-i2c7.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c7.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 7
7 *
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.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC7,
29 .end = S3C_PA_IIC7 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC7,
34 .end = IRQ_IIC7,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c7 = {
40 .name = "s3c2440-i2c",
41 .id = 7,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 7;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c7);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c7_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-ide.c b/arch/arm/plat-samsung/dev-ide.c
deleted file mode 100644
index b497982795a7..000000000000
--- a/arch/arm/plat-samsung/dev-ide.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-ide.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung CF-ATA device definition.
7 *
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.
11*/
12
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/platform_device.h>
16
17#include <mach/map.h>
18#include <plat/ata.h>
19#include <plat/devs.h>
20
21static struct resource s3c_cfcon_resource[] = {
22 [0] = {
23 .start = SAMSUNG_PA_CFCON,
24 .end = SAMSUNG_PA_CFCON + SZ_16K - 1,
25 .flags = IORESOURCE_MEM,
26 },
27 [1] = {
28 .start = IRQ_CFCON,
29 .end = IRQ_CFCON,
30 .flags = IORESOURCE_IRQ,
31 },
32};
33
34struct platform_device s3c_device_cfcon = {
35 .id = 0,
36 .num_resources = ARRAY_SIZE(s3c_cfcon_resource),
37 .resource = s3c_cfcon_resource,
38};
39
40void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
41{
42 s3c_set_platdata(pdata, sizeof(struct s3c_ide_platdata),
43 &s3c_device_cfcon);
44}
diff --git a/arch/arm/plat-samsung/dev-keypad.c b/arch/arm/plat-samsung/dev-keypad.c
deleted file mode 100644
index 677c2d731b65..000000000000
--- a/arch/arm/plat-samsung/dev-keypad.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * linux/arch/arm/plat-samsung/dev-keypad.c
3 *
4 * Copyright (C) 2010 Samsung Electronics Co.Ltd
5 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#include <linux/platform_device.h>
15#include <mach/irqs.h>
16#include <mach/map.h>
17#include <plat/cpu.h>
18#include <plat/devs.h>
19#include <plat/keypad.h>
20
21static struct resource samsung_keypad_resources[] = {
22 [0] = {
23 .start = SAMSUNG_PA_KEYPAD,
24 .end = SAMSUNG_PA_KEYPAD + 0x20 - 1,
25 .flags = IORESOURCE_MEM,
26 },
27 [1] = {
28 .start = IRQ_KEYPAD,
29 .end = IRQ_KEYPAD,
30 .flags = IORESOURCE_IRQ,
31 },
32};
33
34struct platform_device samsung_device_keypad = {
35 .name = "samsung-keypad",
36 .id = -1,
37 .num_resources = ARRAY_SIZE(samsung_keypad_resources),
38 .resource = samsung_keypad_resources,
39};
40
41void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
42{
43 struct samsung_keypad_platdata *npd;
44
45 npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata),
46 &samsung_device_keypad);
47
48 if (!npd->cfg_gpio)
49 npd->cfg_gpio = samsung_keypad_cfg_gpio;
50}
diff --git a/arch/arm/plat-samsung/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
deleted file mode 100644
index b8e30ec6ac26..000000000000
--- a/arch/arm/plat-samsung/dev-nand.c
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * S3C series device definition for nand device
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7*/
8
9#include <linux/gfp.h>
10#include <linux/kernel.h>
11#include <linux/platform_device.h>
12
13#include <linux/mtd/mtd.h>
14#include <linux/mtd/partitions.h>
15
16#include <mach/map.h>
17#include <plat/devs.h>
18#include <plat/nand.h>
19
20static struct resource s3c_nand_resource[] = {
21 [0] = {
22 .start = S3C_PA_NAND,
23 .end = S3C_PA_NAND + SZ_1M,
24 .flags = IORESOURCE_MEM,
25 }
26};
27
28struct platform_device s3c_device_nand = {
29 .name = "s3c2410-nand",
30 .id = -1,
31 .num_resources = ARRAY_SIZE(s3c_nand_resource),
32 .resource = s3c_nand_resource,
33};
34
35EXPORT_SYMBOL(s3c_device_nand);
36
37/**
38 * s3c_nand_copy_set() - copy nand set data
39 * @set: The new structure, directly copied from the old.
40 *
41 * Copy all the fields from the NAND set field from what is probably __initdata
42 * to new kernel memory. The code returns 0 if the copy happened correctly or
43 * an error code for the calling function to display.
44 *
45 * Note, we currently do not try and look to see if we've already copied the
46 * data in a previous set.
47 */
48static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
49{
50 void *ptr;
51 int size;
52
53 size = sizeof(struct mtd_partition) * set->nr_partitions;
54 if (size) {
55 ptr = kmemdup(set->partitions, size, GFP_KERNEL);
56 set->partitions = ptr;
57
58 if (!ptr)
59 return -ENOMEM;
60 }
61
62 if (set->nr_map && set->nr_chips) {
63 size = sizeof(int) * set->nr_chips;
64 ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
65 set->nr_map = ptr;
66
67 if (!ptr)
68 return -ENOMEM;
69 }
70
71 if (set->ecc_layout) {
72 ptr = kmemdup(set->ecc_layout,
73 sizeof(struct nand_ecclayout), GFP_KERNEL);
74 set->ecc_layout = ptr;
75
76 if (!ptr)
77 return -ENOMEM;
78 }
79
80 return 0;
81}
82
83void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
84{
85 struct s3c2410_platform_nand *npd;
86 int size;
87 int ret;
88
89 /* note, if we get a failure in allocation, we simply drop out of the
90 * function. If there is so little memory available at initialisation
91 * time then there is little chance the system is going to run.
92 */
93
94 npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand),
95 &s3c_device_nand);
96 if (!npd)
97 return;
98
99 /* now see if we need to copy any of the nand set data */
100
101 size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
102 if (size) {
103 struct s3c2410_nand_set *from = npd->sets;
104 struct s3c2410_nand_set *to;
105 int i;
106
107 to = kmemdup(from, size, GFP_KERNEL);
108 npd->sets = to; /* set, even if we failed */
109
110 if (!to) {
111 printk(KERN_ERR "%s: no memory for sets\n", __func__);
112 return;
113 }
114
115 for (i = 0; i < npd->nr_sets; i++) {
116 ret = s3c_nand_copy_set(to);
117 if (ret) {
118 printk(KERN_ERR "%s: failed to copy set %d\n",
119 __func__, i);
120 return;
121 }
122 to++;
123 }
124 }
125}
diff --git a/arch/arm/plat-samsung/dev-onenand.c b/arch/arm/plat-samsung/dev-onenand.c
deleted file mode 100644
index f54ae71f0cd2..000000000000
--- a/arch/arm/plat-samsung/dev-onenand.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * linux/arch/arm/plat-samsung/dev-onenand.c
3 *
4 * Copyright (c) 2008-2010 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * S3C64XX/S5PC100 series device definition for OneNAND devices
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16
17#include <mach/irqs.h>
18#include <mach/map.h>
19
20static struct resource s3c_onenand_resources[] = {
21 [0] = {
22 .start = S3C_PA_ONENAND,
23 .end = S3C_PA_ONENAND + 0x400 - 1,
24 .flags = IORESOURCE_MEM,
25 },
26 [1] = {
27 .start = S3C_PA_ONENAND_BUF,
28 .end = S3C_PA_ONENAND_BUF + S3C_SZ_ONENAND_BUF - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [2] = {
32 .start = IRQ_ONENAND,
33 .end = IRQ_ONENAND,
34 .flags = IORESOURCE_IRQ,
35 },
36};
37
38struct platform_device s3c_device_onenand = {
39 .name = "samsung-onenand",
40 .id = 0,
41 .num_resources = ARRAY_SIZE(s3c_onenand_resources),
42 .resource = s3c_onenand_resources,
43};
diff --git a/arch/arm/plat-samsung/dev-pwm.c b/arch/arm/plat-samsung/dev-pwm.c
deleted file mode 100644
index dab47b0e1900..000000000000
--- a/arch/arm/plat-samsung/dev-pwm.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-pwm.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2007 Ben Dooks
7 * Copyright (c) 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
9 *
10 * S3C series device definition for the PWM timer
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/kernel.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21
22#include <plat/devs.h>
23
24#define TIMER_RESOURCE_SIZE (1)
25
26#define TIMER_RESOURCE(_tmr, _irq) \
27 (struct resource [TIMER_RESOURCE_SIZE]) { \
28 [0] = { \
29 .start = _irq, \
30 .end = _irq, \
31 .flags = IORESOURCE_IRQ \
32 } \
33 }
34
35#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
36 .name = "s3c24xx-pwm", \
37 .id = _tmr_no, \
38 .num_resources = TIMER_RESOURCE_SIZE, \
39 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
40
41/*
42 * since we already have an static mapping for the timer,
43 * we do not bother setting any IO resource for the base.
44 */
45
46struct platform_device s3c_device_timer[] = {
47 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
48 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
49 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
50 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
51 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
52};
53EXPORT_SYMBOL(s3c_device_timer);
diff --git a/arch/arm/plat-samsung/dev-rtc.c b/arch/arm/plat-samsung/dev-rtc.c
deleted file mode 100644
index bf4e2267333c..000000000000
--- a/arch/arm/plat-samsung/dev-rtc.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-rtc.c
2 *
3 * Copyright 2009 by Maurus Cuelenaere <mcuelenaere@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/kernel.h>
11#include <linux/string.h>
12#include <linux/platform_device.h>
13
14#include <mach/irqs.h>
15#include <mach/map.h>
16
17#include <plat/devs.h>
18
19static struct resource s3c_rtc_resource[] = {
20 [0] = {
21 .start = S3C_PA_RTC,
22 .end = S3C_PA_RTC + 0xff,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_RTC_ALARM,
27 .end = IRQ_RTC_ALARM,
28 .flags = IORESOURCE_IRQ,
29 },
30 [2] = {
31 .start = IRQ_RTC_TIC,
32 .end = IRQ_RTC_TIC,
33 .flags = IORESOURCE_IRQ
34 }
35};
36
37struct platform_device s3c_device_rtc = {
38 .name = "s3c64xx-rtc",
39 .id = -1,
40 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
41 .resource = s3c_rtc_resource,
42};
43EXPORT_SYMBOL(s3c_device_rtc);
diff --git a/arch/arm/plat-samsung/dev-ts.c b/arch/arm/plat-samsung/dev-ts.c
deleted file mode 100644
index 5f3d46a9bd88..000000000000
--- a/arch/arm/plat-samsung/dev-ts.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/* linux/arch/arm/mach-s3c64xx/dev-ts.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
6 *
7 * Adapted by Maurus Cuelenaere for s3c64xx
8 *
9 * S3C64XX series device definition for touchscreen device
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/string.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/devs.h>
24#include <plat/ts.h>
25
26static struct resource s3c_ts_resource[] = {
27 [0] = {
28 .start = SAMSUNG_PA_ADC,
29 .end = SAMSUNG_PA_ADC + SZ_256 - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_TC,
34 .end = IRQ_TC,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_ts = {
40 .name = "s3c64xx-ts",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_ts_resource),
43 .resource = s3c_ts_resource,
44};
45
46static struct s3c2410_ts_mach_info default_ts_data __initdata = {
47 .delay = 10000,
48 .presc = 49,
49 .oversampling_shift = 2,
50};
51
52void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
53{
54 if (!pd)
55 pd = &default_ts_data;
56
57 s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
58 &s3c_device_ts);
59}
diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
deleted file mode 100644
index 33a844ab6917..000000000000
--- a/arch/arm/plat-samsung/dev-usb-hsotg.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-usb-hsotg.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB high-speed UDC/OtG block
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17#include <linux/dma-mapping.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/devs.h>
23
24static struct resource s3c_usb_hsotg_resources[] = {
25 [0] = {
26 .start = S3C_PA_USB_HSOTG,
27 .end = S3C_PA_USB_HSOTG + 0x10000 - 1,
28 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .start = IRQ_OTG,
32 .end = IRQ_OTG,
33 .flags = IORESOURCE_IRQ,
34 },
35};
36
37static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
38
39struct platform_device s3c_device_usb_hsotg = {
40 .name = "s3c-hsotg",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
43 .resource = s3c_usb_hsotg_resources,
44 .dev = {
45 .dma_mask = &s3c_hsotg_dmamask,
46 .coherent_dma_mask = DMA_BIT_MASK(32),
47 },
48};
diff --git a/arch/arm/plat-samsung/dev-usb.c b/arch/arm/plat-samsung/dev-usb.c
deleted file mode 100644
index 33fbaa967700..000000000000
--- a/arch/arm/plat-samsung/dev-usb.c
+++ /dev/null
@@ -1,65 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-usb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB host
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/gfp.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/platform_device.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/devs.h>
23#include <plat/usb-control.h>
24
25static struct resource s3c_usb_resource[] = {
26 [0] = {
27 .start = S3C_PA_USBHOST,
28 .end = S3C_PA_USBHOST + 0x100 - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_USBH,
33 .end = IRQ_USBH,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_usb_dmamask = 0xffffffffUL;
39
40struct platform_device s3c_device_ohci = {
41 .name = "s3c2410-ohci",
42 .id = -1,
43 .num_resources = ARRAY_SIZE(s3c_usb_resource),
44 .resource = s3c_usb_resource,
45 .dev = {
46 .dma_mask = &s3c_device_usb_dmamask,
47 .coherent_dma_mask = 0xffffffffUL
48 }
49};
50
51EXPORT_SYMBOL(s3c_device_ohci);
52
53/**
54 * s3c_ohci_set_platdata - initialise OHCI device platform data
55 * @info: The platform data.
56 *
57 * This call copies the @info passed in and sets the device .platform_data
58 * field to that copy. The @info is copied so that the original can be marked
59 * __initdata.
60 */
61void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
62{
63 s3c_set_platdata(info, sizeof(struct s3c2410_hcd_info),
64 &s3c_device_ohci);
65}
diff --git a/arch/arm/plat-samsung/dev-wdt.c b/arch/arm/plat-samsung/dev-wdt.c
deleted file mode 100644
index 019b5b8cf14c..000000000000
--- a/arch/arm/plat-samsung/dev-wdt.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-wdt.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C series device definition for the watchdog timer
7 *
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.
11*/
12
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15
16#include <mach/irqs.h>
17#include <mach/map.h>
18
19#include <plat/devs.h>
20
21static struct resource s3c_wdt_resource[] = {
22 [0] = {
23 .start = S3C_PA_WDT,
24 .end = S3C_PA_WDT + SZ_1K,
25 .flags = IORESOURCE_MEM,
26 },
27 [1] = {
28 .start = IRQ_WDT,
29 .end = IRQ_WDT,
30 .flags = IORESOURCE_IRQ,
31 }
32};
33
34struct platform_device s3c_device_wdt = {
35 .name = "s3c2410-wdt",
36 .id = -1,
37 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
38 .resource = s3c_wdt_resource,
39};
40EXPORT_SYMBOL(s3c_device_wdt);
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index d8bd7ad6367c..a2112aa88c1f 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -26,6 +26,8 @@
26#include <linux/gfp.h> 26#include <linux/gfp.h>
27#include <linux/mtd/mtd.h> 27#include <linux/mtd/mtd.h>
28#include <linux/mtd/onenand.h> 28#include <linux/mtd/onenand.h>
29#include <linux/mtd/partitions.h>
30#include <linux/mmc/host.h>
29#include <linux/ioport.h> 31#include <linux/ioport.h>
30 32
31#include <asm/irq.h> 33#include <asm/irq.h>
@@ -41,13 +43,20 @@
41 43
42#include <plat/cpu.h> 44#include <plat/cpu.h>
43#include <plat/devs.h> 45#include <plat/devs.h>
46#include <plat/adc.h>
47#include <plat/ata.h>
44#include <plat/ehci.h> 48#include <plat/ehci.h>
45#include <plat/fb.h> 49#include <plat/fb.h>
46#include <plat/fb-s3c2410.h> 50#include <plat/fb-s3c2410.h>
51#include <plat/hwmon.h>
47#include <plat/iic.h> 52#include <plat/iic.h>
53#include <plat/keypad.h>
48#include <plat/mci.h> 54#include <plat/mci.h>
55#include <plat/nand.h>
56#include <plat/sdhci.h>
49#include <plat/ts.h> 57#include <plat/ts.h>
50#include <plat/udc.h> 58#include <plat/udc.h>
59#include <plat/usb-control.h>
51#include <plat/usb-phy.h> 60#include <plat/usb-phy.h>
52#include <plat/regs-iic.h> 61#include <plat/regs-iic.h>
53#include <plat/regs-serial.h> 62#include <plat/regs-serial.h>
@@ -129,6 +138,33 @@ struct platform_device s3c_device_adc = {
129}; 138};
130#endif /* CONFIG_PLAT_S3C24XX */ 139#endif /* CONFIG_PLAT_S3C24XX */
131 140
141#if defined(CONFIG_SAMSUNG_DEV_ADC)
142static struct resource s3c_adc_resource[] = {
143 [0] = {
144 .start = SAMSUNG_PA_ADC,
145 .end = SAMSUNG_PA_ADC + SZ_256 - 1,
146 .flags = IORESOURCE_MEM,
147 },
148 [1] = {
149 .start = IRQ_TC,
150 .end = IRQ_TC,
151 .flags = IORESOURCE_IRQ,
152 },
153 [2] = {
154 .start = IRQ_ADC,
155 .end = IRQ_ADC,
156 .flags = IORESOURCE_IRQ,
157 },
158};
159
160struct platform_device s3c_device_adc = {
161 .name = "samsung-adc",
162 .id = -1,
163 .num_resources = ARRAY_SIZE(s3c_adc_resource),
164 .resource = s3c_adc_resource,
165};
166#endif /* CONFIG_SAMSUNG_DEV_ADC */
167
132/* Camif Controller */ 168/* Camif Controller */
133 169
134#ifdef CONFIG_CPU_S3C2440 170#ifdef CONFIG_CPU_S3C2440
@@ -157,6 +193,70 @@ struct platform_device s3c_device_camif = {
157}; 193};
158#endif /* CONFIG_CPU_S3C2440 */ 194#endif /* CONFIG_CPU_S3C2440 */
159 195
196/* ASOC DMA */
197
198struct platform_device samsung_asoc_dma = {
199 .name = "samsung-audio",
200 .id = -1,
201 .dev = {
202 .dma_mask = &samsung_device_dma_mask,
203 .coherent_dma_mask = DMA_BIT_MASK(32),
204 }
205};
206
207struct platform_device samsung_asoc_idma = {
208 .name = "samsung-idma",
209 .id = -1,
210 .dev = {
211 .dma_mask = &samsung_device_dma_mask,
212 .coherent_dma_mask = DMA_BIT_MASK(32),
213 }
214};
215
216/* FB */
217
218#ifdef CONFIG_S3C_DEV_FB
219static struct resource s3c_fb_resource[] = {
220 [0] = {
221 .start = S3C_PA_FB,
222 .end = S3C_PA_FB + SZ_16K - 1,
223 .flags = IORESOURCE_MEM,
224 },
225 [1] = {
226 .start = IRQ_LCD_VSYNC,
227 .end = IRQ_LCD_VSYNC,
228 .flags = IORESOURCE_IRQ,
229 },
230 [2] = {
231 .start = IRQ_LCD_FIFO,
232 .end = IRQ_LCD_FIFO,
233 .flags = IORESOURCE_IRQ,
234 },
235 [3] = {
236 .start = IRQ_LCD_SYSTEM,
237 .end = IRQ_LCD_SYSTEM,
238 .flags = IORESOURCE_IRQ,
239 },
240};
241
242struct platform_device s3c_device_fb = {
243 .name = "s3c-fb",
244 .id = -1,
245 .num_resources = ARRAY_SIZE(s3c_fb_resource),
246 .resource = s3c_fb_resource,
247 .dev = {
248 .dma_mask = &samsung_device_dma_mask,
249 .coherent_dma_mask = DMA_BIT_MASK(32),
250 },
251};
252
253void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
254{
255 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
256 &s3c_device_fb);
257}
258#endif /* CONFIG_S3C_DEV_FB */
259
160/* FIMC */ 260/* FIMC */
161 261
162#ifdef CONFIG_S5P_DEV_FIMC0 262#ifdef CONFIG_S5P_DEV_FIMC0
@@ -307,6 +407,497 @@ void __init s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd)
307} 407}
308#endif /* CONFIG_S5P_DEV_FIMD0 */ 408#endif /* CONFIG_S5P_DEV_FIMD0 */
309 409
410/* HWMON */
411
412#ifdef CONFIG_S3C_DEV_HWMON
413struct platform_device s3c_device_hwmon = {
414 .name = "s3c-hwmon",
415 .id = -1,
416 .dev.parent = &s3c_device_adc.dev,
417};
418
419void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
420{
421 s3c_set_platdata(pd, sizeof(struct s3c_hwmon_pdata),
422 &s3c_device_hwmon);
423}
424#endif /* CONFIG_S3C_DEV_HWMON */
425
426/* HSMMC */
427
428#define S3C_SZ_HSMMC 0x1000
429
430#ifdef CONFIG_S3C_DEV_HSMMC
431static struct resource s3c_hsmmc_resource[] = {
432 [0] = {
433 .start = S3C_PA_HSMMC0,
434 .end = S3C_PA_HSMMC0 + S3C_SZ_HSMMC - 1,
435 .flags = IORESOURCE_MEM,
436 },
437 [1] = {
438 .start = IRQ_HSMMC0,
439 .end = IRQ_HSMMC0,
440 .flags = IORESOURCE_IRQ,
441 }
442};
443
444struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
445 .max_width = 4,
446 .host_caps = (MMC_CAP_4_BIT_DATA |
447 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
448 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
449};
450
451struct platform_device s3c_device_hsmmc0 = {
452 .name = "s3c-sdhci",
453 .id = 0,
454 .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
455 .resource = s3c_hsmmc_resource,
456 .dev = {
457 .dma_mask = &samsung_device_dma_mask,
458 .coherent_dma_mask = DMA_BIT_MASK(32),
459 .platform_data = &s3c_hsmmc0_def_platdata,
460 },
461};
462
463void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
464{
465 s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
466}
467#endif /* CONFIG_S3C_DEV_HSMMC */
468
469#ifdef CONFIG_S3C_DEV_HSMMC1
470static struct resource s3c_hsmmc1_resource[] = {
471 [0] = {
472 .start = S3C_PA_HSMMC1,
473 .end = S3C_PA_HSMMC1 + S3C_SZ_HSMMC - 1,
474 .flags = IORESOURCE_MEM,
475 },
476 [1] = {
477 .start = IRQ_HSMMC1,
478 .end = IRQ_HSMMC1,
479 .flags = IORESOURCE_IRQ,
480 }
481};
482
483struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
484 .max_width = 4,
485 .host_caps = (MMC_CAP_4_BIT_DATA |
486 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
487 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
488};
489
490struct platform_device s3c_device_hsmmc1 = {
491 .name = "s3c-sdhci",
492 .id = 1,
493 .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
494 .resource = s3c_hsmmc1_resource,
495 .dev = {
496 .dma_mask = &samsung_device_dma_mask,
497 .coherent_dma_mask = DMA_BIT_MASK(32),
498 .platform_data = &s3c_hsmmc1_def_platdata,
499 },
500};
501
502void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
503{
504 s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
505}
506#endif /* CONFIG_S3C_DEV_HSMMC1 */
507
508/* HSMMC2 */
509
510#ifdef CONFIG_S3C_DEV_HSMMC2
511static struct resource s3c_hsmmc2_resource[] = {
512 [0] = {
513 .start = S3C_PA_HSMMC2,
514 .end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
515 .flags = IORESOURCE_MEM,
516 },
517 [1] = {
518 .start = IRQ_HSMMC2,
519 .end = IRQ_HSMMC2,
520 .flags = IORESOURCE_IRQ,
521 }
522};
523
524struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
525 .max_width = 4,
526 .host_caps = (MMC_CAP_4_BIT_DATA |
527 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
528 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
529};
530
531struct platform_device s3c_device_hsmmc2 = {
532 .name = "s3c-sdhci",
533 .id = 2,
534 .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
535 .resource = s3c_hsmmc2_resource,
536 .dev = {
537 .dma_mask = &samsung_device_dma_mask,
538 .coherent_dma_mask = DMA_BIT_MASK(32),
539 .platform_data = &s3c_hsmmc2_def_platdata,
540 },
541};
542
543void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
544{
545 s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
546}
547#endif /* CONFIG_S3C_DEV_HSMMC2 */
548
549#ifdef CONFIG_S3C_DEV_HSMMC3
550static struct resource s3c_hsmmc3_resource[] = {
551 [0] = {
552 .start = S3C_PA_HSMMC3,
553 .end = S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1,
554 .flags = IORESOURCE_MEM,
555 },
556 [1] = {
557 .start = IRQ_HSMMC3,
558 .end = IRQ_HSMMC3,
559 .flags = IORESOURCE_IRQ,
560 }
561};
562
563struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
564 .max_width = 4,
565 .host_caps = (MMC_CAP_4_BIT_DATA |
566 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
567 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
568};
569
570struct platform_device s3c_device_hsmmc3 = {
571 .name = "s3c-sdhci",
572 .id = 3,
573 .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource),
574 .resource = s3c_hsmmc3_resource,
575 .dev = {
576 .dma_mask = &samsung_device_dma_mask,
577 .coherent_dma_mask = DMA_BIT_MASK(32),
578 .platform_data = &s3c_hsmmc3_def_platdata,
579 },
580};
581
582void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
583{
584 s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
585}
586#endif /* CONFIG_S3C_DEV_HSMMC3 */
587
588/* I2C */
589
590static struct resource s3c_i2c0_resource[] = {
591 [0] = {
592 .start = S3C_PA_IIC,
593 .end = S3C_PA_IIC + SZ_4K - 1,
594 .flags = IORESOURCE_MEM,
595 },
596 [1] = {
597 .start = IRQ_IIC,
598 .end = IRQ_IIC,
599 .flags = IORESOURCE_IRQ,
600 },
601};
602
603struct platform_device s3c_device_i2c0 = {
604 .name = "s3c2410-i2c",
605#ifdef CONFIG_S3C_DEV_I2C1
606 .id = 0,
607#else
608 .id = -1,
609#endif
610 .num_resources = ARRAY_SIZE(s3c_i2c0_resource),
611 .resource = s3c_i2c0_resource,
612};
613
614struct s3c2410_platform_i2c default_i2c_data __initdata = {
615 .flags = 0,
616 .slave_addr = 0x10,
617 .frequency = 100*1000,
618 .sda_delay = 100,
619};
620
621void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
622{
623 struct s3c2410_platform_i2c *npd;
624
625 if (!pd)
626 pd = &default_i2c_data;
627
628 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
629 &s3c_device_i2c0);
630
631 if (!npd->cfg_gpio)
632 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
633}
634
635#ifdef CONFIG_S3C_DEV_I2C1
636static struct resource s3c_i2c1_resource[] = {
637 [0] = {
638 .start = S3C_PA_IIC1,
639 .end = S3C_PA_IIC1 + SZ_4K - 1,
640 .flags = IORESOURCE_MEM,
641 },
642 [1] = {
643 .start = IRQ_IIC1,
644 .end = IRQ_IIC1,
645 .flags = IORESOURCE_IRQ,
646 },
647};
648
649struct platform_device s3c_device_i2c1 = {
650 .name = "s3c2410-i2c",
651 .id = 1,
652 .num_resources = ARRAY_SIZE(s3c_i2c1_resource),
653 .resource = s3c_i2c1_resource,
654};
655
656void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
657{
658 struct s3c2410_platform_i2c *npd;
659
660 if (!pd) {
661 pd = &default_i2c_data;
662 pd->bus_num = 1;
663 }
664
665 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
666 &s3c_device_i2c1);
667
668 if (!npd->cfg_gpio)
669 npd->cfg_gpio = s3c_i2c1_cfg_gpio;
670}
671#endif /* CONFIG_S3C_DEV_I2C1 */
672
673#ifdef CONFIG_S3C_DEV_I2C2
674static struct resource s3c_i2c2_resource[] = {
675 [0] = {
676 .start = S3C_PA_IIC2,
677 .end = S3C_PA_IIC2 + SZ_4K - 1,
678 .flags = IORESOURCE_MEM,
679 },
680 [1] = {
681 .start = IRQ_IIC2,
682 .end = IRQ_IIC2,
683 .flags = IORESOURCE_IRQ,
684 },
685};
686
687struct platform_device s3c_device_i2c2 = {
688 .name = "s3c2410-i2c",
689 .id = 2,
690 .num_resources = ARRAY_SIZE(s3c_i2c2_resource),
691 .resource = s3c_i2c2_resource,
692};
693
694void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
695{
696 struct s3c2410_platform_i2c *npd;
697
698 if (!pd) {
699 pd = &default_i2c_data;
700 pd->bus_num = 2;
701 }
702
703 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
704 &s3c_device_i2c2);
705
706 if (!npd->cfg_gpio)
707 npd->cfg_gpio = s3c_i2c2_cfg_gpio;
708}
709#endif /* CONFIG_S3C_DEV_I2C2 */
710
711#ifdef CONFIG_S3C_DEV_I2C3
712static struct resource s3c_i2c3_resource[] = {
713 [0] = {
714 .start = S3C_PA_IIC3,
715 .end = S3C_PA_IIC3 + SZ_4K - 1,
716 .flags = IORESOURCE_MEM,
717 },
718 [1] = {
719 .start = IRQ_IIC3,
720 .end = IRQ_IIC3,
721 .flags = IORESOURCE_IRQ,
722 },
723};
724
725struct platform_device s3c_device_i2c3 = {
726 .name = "s3c2440-i2c",
727 .id = 3,
728 .num_resources = ARRAY_SIZE(s3c_i2c3_resource),
729 .resource = s3c_i2c3_resource,
730};
731
732void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
733{
734 struct s3c2410_platform_i2c *npd;
735
736 if (!pd) {
737 pd = &default_i2c_data;
738 pd->bus_num = 3;
739 }
740
741 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
742 &s3c_device_i2c3);
743
744 if (!npd->cfg_gpio)
745 npd->cfg_gpio = s3c_i2c3_cfg_gpio;
746}
747#endif /*CONFIG_S3C_DEV_I2C3 */
748
749#ifdef CONFIG_S3C_DEV_I2C4
750static struct resource s3c_i2c4_resource[] = {
751 [0] = {
752 .start = S3C_PA_IIC4,
753 .end = S3C_PA_IIC4 + SZ_4K - 1,
754 .flags = IORESOURCE_MEM,
755 },
756 [1] = {
757 .start = IRQ_IIC4,
758 .end = IRQ_IIC4,
759 .flags = IORESOURCE_IRQ,
760 },
761};
762
763struct platform_device s3c_device_i2c4 = {
764 .name = "s3c2440-i2c",
765 .id = 4,
766 .num_resources = ARRAY_SIZE(s3c_i2c4_resource),
767 .resource = s3c_i2c4_resource,
768};
769
770void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
771{
772 struct s3c2410_platform_i2c *npd;
773
774 if (!pd) {
775 pd = &default_i2c_data;
776 pd->bus_num = 4;
777 }
778
779 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
780 &s3c_device_i2c4);
781
782 if (!npd->cfg_gpio)
783 npd->cfg_gpio = s3c_i2c4_cfg_gpio;
784}
785#endif /*CONFIG_S3C_DEV_I2C4 */
786
787#ifdef CONFIG_S3C_DEV_I2C5
788static struct resource s3c_i2c5_resource[] = {
789 [0] = {
790 .start = S3C_PA_IIC5,
791 .end = S3C_PA_IIC5 + SZ_4K - 1,
792 .flags = IORESOURCE_MEM,
793 },
794 [1] = {
795 .start = IRQ_IIC5,
796 .end = IRQ_IIC5,
797 .flags = IORESOURCE_IRQ,
798 },
799};
800
801struct platform_device s3c_device_i2c5 = {
802 .name = "s3c2440-i2c",
803 .id = 5,
804 .num_resources = ARRAY_SIZE(s3c_i2c5_resource),
805 .resource = s3c_i2c5_resource,
806};
807
808void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
809{
810 struct s3c2410_platform_i2c *npd;
811
812 if (!pd) {
813 pd = &default_i2c_data;
814 pd->bus_num = 5;
815 }
816
817 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
818 &s3c_device_i2c5);
819
820 if (!npd->cfg_gpio)
821 npd->cfg_gpio = s3c_i2c5_cfg_gpio;
822}
823#endif /*CONFIG_S3C_DEV_I2C5 */
824
825#ifdef CONFIG_S3C_DEV_I2C6
826static struct resource s3c_i2c6_resource[] = {
827 [0] = {
828 .start = S3C_PA_IIC6,
829 .end = S3C_PA_IIC6 + SZ_4K - 1,
830 .flags = IORESOURCE_MEM,
831 },
832 [1] = {
833 .start = IRQ_IIC6,
834 .end = IRQ_IIC6,
835 .flags = IORESOURCE_IRQ,
836 },
837};
838
839struct platform_device s3c_device_i2c6 = {
840 .name = "s3c2440-i2c",
841 .id = 6,
842 .num_resources = ARRAY_SIZE(s3c_i2c6_resource),
843 .resource = s3c_i2c6_resource,
844};
845
846void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
847{
848 struct s3c2410_platform_i2c *npd;
849
850 if (!pd) {
851 pd = &default_i2c_data;
852 pd->bus_num = 6;
853 }
854
855 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
856 &s3c_device_i2c6);
857
858 if (!npd->cfg_gpio)
859 npd->cfg_gpio = s3c_i2c6_cfg_gpio;
860}
861#endif /* CONFIG_S3C_DEV_I2C6 */
862
863#ifdef CONFIG_S3C_DEV_I2C7
864static struct resource s3c_i2c7_resource[] = {
865 [0] = {
866 .start = S3C_PA_IIC7,
867 .end = S3C_PA_IIC7 + SZ_4K - 1,
868 .flags = IORESOURCE_MEM,
869 },
870 [1] = {
871 .start = IRQ_IIC7,
872 .end = IRQ_IIC7,
873 .flags = IORESOURCE_IRQ,
874 },
875};
876
877struct platform_device s3c_device_i2c7 = {
878 .name = "s3c2440-i2c",
879 .id = 7,
880 .num_resources = ARRAY_SIZE(s3c_i2c7_resource),
881 .resource = s3c_i2c7_resource,
882};
883
884void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
885{
886 struct s3c2410_platform_i2c *npd;
887
888 if (!pd) {
889 pd = &default_i2c_data;
890 pd->bus_num = 7;
891 }
892
893 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
894 &s3c_device_i2c7);
895
896 if (!npd->cfg_gpio)
897 npd->cfg_gpio = s3c_i2c7_cfg_gpio;
898}
899#endif /* CONFIG_S3C_DEV_I2C7 */
900
310/* I2C HDMIPHY */ 901/* I2C HDMIPHY */
311 902
312#ifdef CONFIG_S5P_DEV_I2C_HDMIPHY 903#ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
@@ -384,6 +975,70 @@ struct platform_device s3c2412_device_iis = {
384}; 975};
385#endif /* CONFIG_CPU_S3C2440 */ 976#endif /* CONFIG_CPU_S3C2440 */
386 977
978/* IDE CFCON */
979
980#ifdef CONFIG_SAMSUNG_DEV_IDE
981static struct resource s3c_cfcon_resource[] = {
982 [0] = {
983 .start = SAMSUNG_PA_CFCON,
984 .end = SAMSUNG_PA_CFCON + SZ_16K - 1,
985 .flags = IORESOURCE_MEM,
986 },
987 [1] = {
988 .start = IRQ_CFCON,
989 .end = IRQ_CFCON,
990 .flags = IORESOURCE_IRQ,
991 },
992};
993
994struct platform_device s3c_device_cfcon = {
995 .id = 0,
996 .num_resources = ARRAY_SIZE(s3c_cfcon_resource),
997 .resource = s3c_cfcon_resource,
998};
999
1000void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
1001{
1002 s3c_set_platdata(pdata, sizeof(struct s3c_ide_platdata),
1003 &s3c_device_cfcon);
1004}
1005#endif /* CONFIG_SAMSUNG_DEV_IDE */
1006
1007/* KEYPAD */
1008
1009#ifdef CONFIG_SAMSUNG_DEV_KEYPAD
1010static struct resource samsung_keypad_resources[] = {
1011 [0] = {
1012 .start = SAMSUNG_PA_KEYPAD,
1013 .end = SAMSUNG_PA_KEYPAD + 0x20 - 1,
1014 .flags = IORESOURCE_MEM,
1015 },
1016 [1] = {
1017 .start = IRQ_KEYPAD,
1018 .end = IRQ_KEYPAD,
1019 .flags = IORESOURCE_IRQ,
1020 },
1021};
1022
1023struct platform_device samsung_device_keypad = {
1024 .name = "samsung-keypad",
1025 .id = -1,
1026 .num_resources = ARRAY_SIZE(samsung_keypad_resources),
1027 .resource = samsung_keypad_resources,
1028};
1029
1030void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
1031{
1032 struct samsung_keypad_platdata *npd;
1033
1034 npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata),
1035 &samsung_device_keypad);
1036
1037 if (!npd->cfg_gpio)
1038 npd->cfg_gpio = samsung_keypad_cfg_gpio;
1039}
1040#endif /* CONFIG_SAMSUNG_DEV_KEYPAD */
1041
387/* LCD Controller */ 1042/* LCD Controller */
388 1043
389#ifdef CONFIG_PLAT_S3C24XX 1044#ifdef CONFIG_PLAT_S3C24XX
@@ -526,6 +1181,144 @@ struct platform_device s5p_device_mipi_csis1 = {
526}; 1181};
527#endif 1182#endif
528 1183
1184/* NAND */
1185
1186#ifdef CONFIG_S3C_DEV_NAND
1187static struct resource s3c_nand_resource[] = {
1188 [0] = {
1189 .start = S3C_PA_NAND,
1190 .end = S3C_PA_NAND + SZ_1M,
1191 .flags = IORESOURCE_MEM,
1192 }
1193};
1194
1195struct platform_device s3c_device_nand = {
1196 .name = "s3c2410-nand",
1197 .id = -1,
1198 .num_resources = ARRAY_SIZE(s3c_nand_resource),
1199 .resource = s3c_nand_resource,
1200};
1201
1202/*
1203 * s3c_nand_copy_set() - copy nand set data
1204 * @set: The new structure, directly copied from the old.
1205 *
1206 * Copy all the fields from the NAND set field from what is probably __initdata
1207 * to new kernel memory. The code returns 0 if the copy happened correctly or
1208 * an error code for the calling function to display.
1209 *
1210 * Note, we currently do not try and look to see if we've already copied the
1211 * data in a previous set.
1212 */
1213static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
1214{
1215 void *ptr;
1216 int size;
1217
1218 size = sizeof(struct mtd_partition) * set->nr_partitions;
1219 if (size) {
1220 ptr = kmemdup(set->partitions, size, GFP_KERNEL);
1221 set->partitions = ptr;
1222
1223 if (!ptr)
1224 return -ENOMEM;
1225 }
1226
1227 if (set->nr_map && set->nr_chips) {
1228 size = sizeof(int) * set->nr_chips;
1229 ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
1230 set->nr_map = ptr;
1231
1232 if (!ptr)
1233 return -ENOMEM;
1234 }
1235
1236 if (set->ecc_layout) {
1237 ptr = kmemdup(set->ecc_layout,
1238 sizeof(struct nand_ecclayout), GFP_KERNEL);
1239 set->ecc_layout = ptr;
1240
1241 if (!ptr)
1242 return -ENOMEM;
1243 }
1244
1245 return 0;
1246}
1247
1248void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
1249{
1250 struct s3c2410_platform_nand *npd;
1251 int size;
1252 int ret;
1253
1254 /* note, if we get a failure in allocation, we simply drop out of the
1255 * function. If there is so little memory available at initialisation
1256 * time then there is little chance the system is going to run.
1257 */
1258
1259 npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand),
1260 &s3c_device_nand);
1261 if (!npd)
1262 return;
1263
1264 /* now see if we need to copy any of the nand set data */
1265
1266 size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
1267 if (size) {
1268 struct s3c2410_nand_set *from = npd->sets;
1269 struct s3c2410_nand_set *to;
1270 int i;
1271
1272 to = kmemdup(from, size, GFP_KERNEL);
1273 npd->sets = to; /* set, even if we failed */
1274
1275 if (!to) {
1276 printk(KERN_ERR "%s: no memory for sets\n", __func__);
1277 return;
1278 }
1279
1280 for (i = 0; i < npd->nr_sets; i++) {
1281 ret = s3c_nand_copy_set(to);
1282 if (ret) {
1283 printk(KERN_ERR "%s: failed to copy set %d\n",
1284 __func__, i);
1285 return;
1286 }
1287 to++;
1288 }
1289 }
1290}
1291#endif /* CONFIG_S3C_DEV_NAND */
1292
1293/* ONENAND */
1294
1295#ifdef CONFIG_S3C_DEV_ONENAND
1296static struct resource s3c_onenand_resources[] = {
1297 [0] = {
1298 .start = S3C_PA_ONENAND,
1299 .end = S3C_PA_ONENAND + 0x400 - 1,
1300 .flags = IORESOURCE_MEM,
1301 },
1302 [1] = {
1303 .start = S3C_PA_ONENAND_BUF,
1304 .end = S3C_PA_ONENAND_BUF + S3C_SZ_ONENAND_BUF - 1,
1305 .flags = IORESOURCE_MEM,
1306 },
1307 [2] = {
1308 .start = IRQ_ONENAND,
1309 .end = IRQ_ONENAND,
1310 .flags = IORESOURCE_IRQ,
1311 },
1312};
1313
1314struct platform_device s3c_device_onenand = {
1315 .name = "samsung-onenand",
1316 .id = 0,
1317 .num_resources = ARRAY_SIZE(s3c_onenand_resources),
1318 .resource = s3c_onenand_resources,
1319};
1320#endif /* CONFIG_S3C_DEV_ONENAND */
1321
529#ifdef CONFIG_S3C64XX_DEV_ONENAND1 1322#ifdef CONFIG_S3C64XX_DEV_ONENAND1
530static struct resource s3c64xx_onenand1_resources[] = { 1323static struct resource s3c64xx_onenand1_resources[] = {
531 [0] = { 1324 [0] = {
@@ -610,6 +1403,41 @@ static int __init s5p_pmu_init(void)
610arch_initcall(s5p_pmu_init); 1403arch_initcall(s5p_pmu_init);
611#endif /* CONFIG_PLAT_S5P */ 1404#endif /* CONFIG_PLAT_S5P */
612 1405
1406/* PWM Timer */
1407
1408#ifdef CONFIG_SAMSUNG_DEV_PWM
1409
1410#define TIMER_RESOURCE_SIZE (1)
1411
1412#define TIMER_RESOURCE(_tmr, _irq) \
1413 (struct resource [TIMER_RESOURCE_SIZE]) { \
1414 [0] = { \
1415 .start = _irq, \
1416 .end = _irq, \
1417 .flags = IORESOURCE_IRQ \
1418 } \
1419 }
1420
1421#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
1422 .name = "s3c24xx-pwm", \
1423 .id = _tmr_no, \
1424 .num_resources = TIMER_RESOURCE_SIZE, \
1425 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
1426
1427/*
1428 * since we already have an static mapping for the timer,
1429 * we do not bother setting any IO resource for the base.
1430 */
1431
1432struct platform_device s3c_device_timer[] = {
1433 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
1434 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
1435 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
1436 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
1437 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
1438};
1439#endif /* CONFIG_SAMSUNG_DEV_PWM */
1440
613/* RTC */ 1441/* RTC */
614 1442
615#ifdef CONFIG_PLAT_S3C24XX 1443#ifdef CONFIG_PLAT_S3C24XX
@@ -639,6 +1467,33 @@ struct platform_device s3c_device_rtc = {
639}; 1467};
640#endif /* CONFIG_PLAT_S3C24XX */ 1468#endif /* CONFIG_PLAT_S3C24XX */
641 1469
1470#ifdef CONFIG_S3C_DEV_RTC
1471static struct resource s3c_rtc_resource[] = {
1472 [0] = {
1473 .start = S3C_PA_RTC,
1474 .end = S3C_PA_RTC + 0xff,
1475 .flags = IORESOURCE_MEM,
1476 },
1477 [1] = {
1478 .start = IRQ_RTC_ALARM,
1479 .end = IRQ_RTC_ALARM,
1480 .flags = IORESOURCE_IRQ,
1481 },
1482 [2] = {
1483 .start = IRQ_RTC_TIC,
1484 .end = IRQ_RTC_TIC,
1485 .flags = IORESOURCE_IRQ
1486 }
1487};
1488
1489struct platform_device s3c_device_rtc = {
1490 .name = "s3c64xx-rtc",
1491 .id = -1,
1492 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
1493 .resource = s3c_rtc_resource,
1494};
1495#endif /* CONFIG_S3C_DEV_RTC */
1496
642/* SDI */ 1497/* SDI */
643 1498
644#ifdef CONFIG_PLAT_S3C24XX 1499#ifdef CONFIG_PLAT_S3C24XX
@@ -753,6 +1608,43 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_
753} 1608}
754#endif /* CONFIG_PLAT_S3C24XX */ 1609#endif /* CONFIG_PLAT_S3C24XX */
755 1610
1611#ifdef CONFIG_SAMSUNG_DEV_TS
1612static struct resource s3c_ts_resource[] = {
1613 [0] = {
1614 .start = SAMSUNG_PA_ADC,
1615 .end = SAMSUNG_PA_ADC + SZ_256 - 1,
1616 .flags = IORESOURCE_MEM,
1617 },
1618 [1] = {
1619 .start = IRQ_TC,
1620 .end = IRQ_TC,
1621 .flags = IORESOURCE_IRQ,
1622 },
1623};
1624
1625static struct s3c2410_ts_mach_info default_ts_data __initdata = {
1626 .delay = 10000,
1627 .presc = 49,
1628 .oversampling_shift = 2,
1629};
1630
1631struct platform_device s3c_device_ts = {
1632 .name = "s3c64xx-ts",
1633 .id = -1,
1634 .num_resources = ARRAY_SIZE(s3c_ts_resource),
1635 .resource = s3c_ts_resource,
1636};
1637
1638void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
1639{
1640 if (!pd)
1641 pd = &default_ts_data;
1642
1643 s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
1644 &s3c_device_ts);
1645}
1646#endif /* CONFIG_SAMSUNG_DEV_TS */
1647
756/* TV */ 1648/* TV */
757 1649
758#ifdef CONFIG_S5P_DEV_TV 1650#ifdef CONFIG_S5P_DEV_TV
@@ -830,6 +1722,49 @@ struct platform_device s5p_device_mixer = {
830}; 1722};
831#endif /* CONFIG_S5P_DEV_TV */ 1723#endif /* CONFIG_S5P_DEV_TV */
832 1724
1725/* USB */
1726
1727#ifdef CONFIG_S3C_DEV_USB_HOST
1728static struct resource s3c_usb_resource[] = {
1729 [0] = {
1730 .start = S3C_PA_USBHOST,
1731 .end = S3C_PA_USBHOST + 0x100 - 1,
1732 .flags = IORESOURCE_MEM,
1733 },
1734 [1] = {
1735 .start = IRQ_USBH,
1736 .end = IRQ_USBH,
1737 .flags = IORESOURCE_IRQ,
1738 }
1739};
1740
1741struct platform_device s3c_device_ohci = {
1742 .name = "s3c2410-ohci",
1743 .id = -1,
1744 .num_resources = ARRAY_SIZE(s3c_usb_resource),
1745 .resource = s3c_usb_resource,
1746 .dev = {
1747 .dma_mask = &samsung_device_dma_mask,
1748 .coherent_dma_mask = DMA_BIT_MASK(32),
1749 }
1750};
1751
1752/*
1753 * s3c_ohci_set_platdata - initialise OHCI device platform data
1754 * @info: The platform data.
1755 *
1756 * This call copies the @info passed in and sets the device .platform_data
1757 * field to that copy. The @info is copied so that the original can be marked
1758 * __initdata.
1759 */
1760
1761void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
1762{
1763 s3c_set_platdata(info, sizeof(struct s3c2410_hcd_info),
1764 &s3c_device_ohci);
1765}
1766#endif /* CONFIG_S3C_DEV_USB_HOST */
1767
833/* USB Device (Gadget) */ 1768/* USB Device (Gadget) */
834 1769
835#ifdef CONFIG_PLAT_S3C24XX 1770#ifdef CONFIG_PLAT_S3C24XX
@@ -900,6 +1835,34 @@ void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
900} 1835}
901#endif /* CONFIG_S5P_DEV_USB_EHCI */ 1836#endif /* CONFIG_S5P_DEV_USB_EHCI */
902 1837
1838/* USB HSOTG */
1839
1840#ifdef CONFIG_S3C_DEV_USB_HSOTG
1841static struct resource s3c_usb_hsotg_resources[] = {
1842 [0] = {
1843 .start = S3C_PA_USB_HSOTG,
1844 .end = S3C_PA_USB_HSOTG + 0x10000 - 1,
1845 .flags = IORESOURCE_MEM,
1846 },
1847 [1] = {
1848 .start = IRQ_OTG,
1849 .end = IRQ_OTG,
1850 .flags = IORESOURCE_IRQ,
1851 },
1852};
1853
1854struct platform_device s3c_device_usb_hsotg = {
1855 .name = "s3c-hsotg",
1856 .id = -1,
1857 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
1858 .resource = s3c_usb_hsotg_resources,
1859 .dev = {
1860 .dma_mask = &samsung_device_dma_mask,
1861 .coherent_dma_mask = DMA_BIT_MASK(32),
1862 },
1863};
1864#endif /* CONFIG_S3C_DEV_USB_HSOTG */
1865
903/* USB High Spped 2.0 Device (Gadget) */ 1866/* USB High Spped 2.0 Device (Gadget) */
904 1867
905#ifdef CONFIG_PLAT_S3C24XX 1868#ifdef CONFIG_PLAT_S3C24XX
@@ -932,3 +1895,27 @@ void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
932 s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc); 1895 s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc);
933} 1896}
934#endif /* CONFIG_PLAT_S3C24XX */ 1897#endif /* CONFIG_PLAT_S3C24XX */
1898
1899/* WDT */
1900
1901#ifdef CONFIG_S3C_DEV_WDT
1902static struct resource s3c_wdt_resource[] = {
1903 [0] = {
1904 .start = S3C_PA_WDT,
1905 .end = S3C_PA_WDT + SZ_1K,
1906 .flags = IORESOURCE_MEM,
1907 },
1908 [1] = {
1909 .start = IRQ_WDT,
1910 .end = IRQ_WDT,
1911 .flags = IORESOURCE_IRQ,
1912 }
1913};
1914
1915struct platform_device s3c_device_wdt = {
1916 .name = "s3c2410-wdt",
1917 .id = -1,
1918 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
1919 .resource = s3c_wdt_resource,
1920};
1921#endif /* CONFIG_S3C_DEV_WDT */
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index ee5014a7cc96..8f19241a626f 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -30,30 +30,24 @@ extern struct s3c24xx_uart_resources s5p_uart_resources[];
30extern struct platform_device *s3c24xx_uart_devs[]; 30extern struct platform_device *s3c24xx_uart_devs[];
31extern struct platform_device *s3c24xx_uart_src[]; 31extern struct platform_device *s3c24xx_uart_src[];
32 32
33extern struct platform_device s3c_device_timer[]; 33extern struct platform_device s3c64xx_device_ac97;
34
35extern struct platform_device s3c64xx_device_iis0; 34extern struct platform_device s3c64xx_device_iis0;
36extern struct platform_device s3c64xx_device_iis1; 35extern struct platform_device s3c64xx_device_iis1;
37extern struct platform_device s3c64xx_device_iisv4; 36extern struct platform_device s3c64xx_device_iisv4;
38 37extern struct platform_device s3c64xx_device_onenand1;
39extern struct platform_device s3c64xx_device_spi0;
40extern struct platform_device s3c64xx_device_spi1;
41
42extern struct platform_device samsung_asoc_dma;
43extern struct platform_device samsung_asoc_idma;
44
45extern struct platform_device s3c64xx_device_pcm0; 38extern struct platform_device s3c64xx_device_pcm0;
46extern struct platform_device s3c64xx_device_pcm1; 39extern struct platform_device s3c64xx_device_pcm1;
40extern struct platform_device s3c64xx_device_spi0;
41extern struct platform_device s3c64xx_device_spi1;
47 42
48extern struct platform_device s3c64xx_device_ac97; 43extern struct platform_device s3c_device_adc;
49 44extern struct platform_device s3c_device_cfcon;
50extern struct platform_device s3c_device_ts;
51
52extern struct platform_device s3c_device_fb; 45extern struct platform_device s3c_device_fb;
53extern struct platform_device s5p_device_fimd0; 46extern struct platform_device s3c_device_hwmon;
54extern struct platform_device s3c_device_ohci; 47extern struct platform_device s3c_device_hsmmc0;
55extern struct platform_device s3c_device_lcd; 48extern struct platform_device s3c_device_hsmmc1;
56extern struct platform_device s3c_device_wdt; 49extern struct platform_device s3c_device_hsmmc2;
50extern struct platform_device s3c_device_hsmmc3;
57extern struct platform_device s3c_device_i2c0; 51extern struct platform_device s3c_device_i2c0;
58extern struct platform_device s3c_device_i2c1; 52extern struct platform_device s3c_device_i2c1;
59extern struct platform_device s3c_device_i2c2; 53extern struct platform_device s3c_device_i2c2;
@@ -62,99 +56,89 @@ extern struct platform_device s3c_device_i2c4;
62extern struct platform_device s3c_device_i2c5; 56extern struct platform_device s3c_device_i2c5;
63extern struct platform_device s3c_device_i2c6; 57extern struct platform_device s3c_device_i2c6;
64extern struct platform_device s3c_device_i2c7; 58extern struct platform_device s3c_device_i2c7;
65extern struct platform_device s5p_device_i2c_hdmiphy; 59extern struct platform_device s3c_device_iis;
60extern struct platform_device s3c_device_lcd;
61extern struct platform_device s3c_device_nand;
62extern struct platform_device s3c_device_ohci;
63extern struct platform_device s3c_device_onenand;
66extern struct platform_device s3c_device_rtc; 64extern struct platform_device s3c_device_rtc;
67extern struct platform_device s3c_device_adc;
68extern struct platform_device s3c_device_sdi; 65extern struct platform_device s3c_device_sdi;
69extern struct platform_device s3c_device_iis;
70extern struct platform_device s3c_device_hwmon;
71extern struct platform_device s3c_device_hsmmc0;
72extern struct platform_device s3c_device_hsmmc1;
73extern struct platform_device s3c_device_hsmmc2;
74extern struct platform_device s3c_device_hsmmc3;
75extern struct platform_device s3c_device_cfcon;
76
77extern struct platform_device s3c_device_spi0; 66extern struct platform_device s3c_device_spi0;
78extern struct platform_device s3c_device_spi1; 67extern struct platform_device s3c_device_spi1;
79 68extern struct platform_device s3c_device_ts;
80extern struct platform_device s5pc100_device_spi0; 69extern struct platform_device s3c_device_timer[];
81extern struct platform_device s5pc100_device_spi1;
82extern struct platform_device s5pc100_device_spi2;
83extern struct platform_device s5pv210_device_spi0;
84extern struct platform_device s5pv210_device_spi1;
85extern struct platform_device s5p64x0_device_spi0;
86extern struct platform_device s5p64x0_device_spi1;
87
88extern struct platform_device s3c_device_hwmon;
89
90extern struct platform_device s3c_device_nand;
91extern struct platform_device s3c_device_onenand;
92extern struct platform_device s3c64xx_device_onenand1;
93extern struct platform_device s5p_device_onenand;
94
95extern struct platform_device s3c_device_usbgadget; 70extern struct platform_device s3c_device_usbgadget;
96extern struct platform_device s3c_device_usb_hsudc;
97extern struct platform_device s3c_device_usb_hsotg; 71extern struct platform_device s3c_device_usb_hsotg;
72extern struct platform_device s3c_device_usb_hsudc;
73extern struct platform_device s3c_device_wdt;
98 74
99extern struct platform_device s5pv210_device_ac97; 75extern struct platform_device s5p_device_ehci;
100extern struct platform_device s5pv210_device_pcm0; 76extern struct platform_device s5p_device_fimc0;
101extern struct platform_device s5pv210_device_pcm1; 77extern struct platform_device s5p_device_fimc1;
102extern struct platform_device s5pv210_device_pcm2; 78extern struct platform_device s5p_device_fimc2;
103extern struct platform_device s5pv210_device_iis0; 79extern struct platform_device s5p_device_fimc3;
104extern struct platform_device s5pv210_device_iis1; 80extern struct platform_device s5p_device_fimd0;
105extern struct platform_device s5pv210_device_iis2; 81extern struct platform_device s5p_device_hdmi;
106extern struct platform_device s5pv210_device_spdif; 82extern struct platform_device s5p_device_i2c_hdmiphy;
107 83extern struct platform_device s5p_device_mfc;
108extern struct platform_device exynos4_device_ac97; 84extern struct platform_device s5p_device_mfc_l;
109extern struct platform_device exynos4_device_pcm0; 85extern struct platform_device s5p_device_mfc_r;
110extern struct platform_device exynos4_device_pcm1; 86extern struct platform_device s5p_device_mipi_csis0;
111extern struct platform_device exynos4_device_pcm2; 87extern struct platform_device s5p_device_mipi_csis1;
112extern struct platform_device exynos4_device_i2s0; 88extern struct platform_device s5p_device_mixer;
113extern struct platform_device exynos4_device_i2s1; 89extern struct platform_device s5p_device_onenand;
114extern struct platform_device exynos4_device_i2s2; 90extern struct platform_device s5p_device_sdo;
115extern struct platform_device exynos4_device_spdif;
116extern struct platform_device exynos4_device_pd[];
117extern struct platform_device exynos4_device_ahci;
118extern struct platform_device exynos4_device_dwmci;
119 91
120extern struct platform_device s5p6440_device_pcm;
121extern struct platform_device s5p6440_device_iis; 92extern struct platform_device s5p6440_device_iis;
93extern struct platform_device s5p6440_device_pcm;
122 94
123extern struct platform_device s5p6450_device_iis0; 95extern struct platform_device s5p6450_device_iis0;
124extern struct platform_device s5p6450_device_iis1; 96extern struct platform_device s5p6450_device_iis1;
125extern struct platform_device s5p6450_device_iis2; 97extern struct platform_device s5p6450_device_iis2;
126extern struct platform_device s5p6450_device_pcm0; 98extern struct platform_device s5p6450_device_pcm0;
127 99
100extern struct platform_device s5p64x0_device_spi0;
101extern struct platform_device s5p64x0_device_spi1;
102
128extern struct platform_device s5pc100_device_ac97; 103extern struct platform_device s5pc100_device_ac97;
129extern struct platform_device s5pc100_device_pcm0;
130extern struct platform_device s5pc100_device_pcm1;
131extern struct platform_device s5pc100_device_iis0; 104extern struct platform_device s5pc100_device_iis0;
132extern struct platform_device s5pc100_device_iis1; 105extern struct platform_device s5pc100_device_iis1;
133extern struct platform_device s5pc100_device_iis2; 106extern struct platform_device s5pc100_device_iis2;
107extern struct platform_device s5pc100_device_pcm0;
108extern struct platform_device s5pc100_device_pcm1;
134extern struct platform_device s5pc100_device_spdif; 109extern struct platform_device s5pc100_device_spdif;
110extern struct platform_device s5pc100_device_spi0;
111extern struct platform_device s5pc100_device_spi1;
112extern struct platform_device s5pc100_device_spi2;
135 113
136extern struct platform_device samsung_device_keypad; 114extern struct platform_device s5pv210_device_ac97;
137 115extern struct platform_device s5pv210_device_iis0;
138extern struct platform_device s5p_device_fimc0; 116extern struct platform_device s5pv210_device_iis1;
139extern struct platform_device s5p_device_fimc1; 117extern struct platform_device s5pv210_device_iis2;
140extern struct platform_device s5p_device_fimc2; 118extern struct platform_device s5pv210_device_pcm0;
141extern struct platform_device s5p_device_fimc3; 119extern struct platform_device s5pv210_device_pcm1;
142 120extern struct platform_device s5pv210_device_pcm2;
143extern struct platform_device s5p_device_mfc; 121extern struct platform_device s5pv210_device_spdif;
144extern struct platform_device s5p_device_mfc_l; 122extern struct platform_device s5pv210_device_spi0;
145extern struct platform_device s5p_device_mfc_r; 123extern struct platform_device s5pv210_device_spi1;
146
147extern struct platform_device s5p_device_hdmi;
148extern struct platform_device s5p_device_mixer;
149extern struct platform_device s5p_device_sdo;
150
151extern struct platform_device s5p_device_mipi_csis0;
152extern struct platform_device s5p_device_mipi_csis1;
153
154extern struct platform_device s5p_device_ehci;
155 124
125extern struct platform_device exynos4_device_ac97;
126extern struct platform_device exynos4_device_ahci;
127extern struct platform_device exynos4_device_dwmci;
128extern struct platform_device exynos4_device_i2s0;
129extern struct platform_device exynos4_device_i2s1;
130extern struct platform_device exynos4_device_i2s2;
131extern struct platform_device exynos4_device_pcm0;
132extern struct platform_device exynos4_device_pcm1;
133extern struct platform_device exynos4_device_pcm2;
134extern struct platform_device exynos4_device_pd[];
135extern struct platform_device exynos4_device_spdif;
156extern struct platform_device exynos4_device_sysmmu; 136extern struct platform_device exynos4_device_sysmmu;
157 137
138extern struct platform_device samsung_asoc_dma;
139extern struct platform_device samsung_asoc_idma;
140extern struct platform_device samsung_device_keypad;
141
158/* s3c2440 specific devices */ 142/* s3c2440 specific devices */
159 143
160#ifdef CONFIG_CPU_S3C2440 144#ifdef CONFIG_CPU_S3C2440