diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-01-05 12:45:09 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-15 03:10:13 -0500 |
commit | b6a604137bb978d9f65b1228cf0bb691ece45cba (patch) | |
tree | 9fe4d3df50c44249d7a4344bb137b96904d627fb /arch/arm/plat-s3c | |
parent | 9745626b65b856bf58e70feb4eee1e5471db699e (diff) |
ARM: SAMSUNG: Move device definitions in plat-samsung
Move all the platform device definitions from plat-s3c into plat-samsung
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c')
-rw-r--r-- | arch/arm/plat-s3c/Kconfig | 42 | ||||
-rw-r--r-- | arch/arm/plat-s3c/Makefile | 12 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-fb.c | 73 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-hsmmc.c | 68 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-hsmmc1.c | 68 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-hsmmc2.c | 69 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-i2c0.c | 71 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-i2c1.c | 68 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-nand.c | 129 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-usb-hsotg.c | 41 | ||||
-rw-r--r-- | arch/arm/plat-s3c/dev-usb.c | 50 |
11 files changed, 0 insertions, 691 deletions
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig index 9e9d0286e48f..cd979b1f6120 100644 --- a/arch/arm/plat-s3c/Kconfig +++ b/arch/arm/plat-s3c/Kconfig | |||
@@ -170,46 +170,4 @@ config S3C_DMA | |||
170 | help | 170 | help |
171 | Internal configuration for S3C DMA core | 171 | Internal configuration for S3C DMA core |
172 | 172 | ||
173 | # device definitions to compile in | ||
174 | |||
175 | config S3C_DEV_HSMMC | ||
176 | bool | ||
177 | help | ||
178 | Compile in platform device definitions for HSMMC code | ||
179 | |||
180 | config S3C_DEV_HSMMC1 | ||
181 | bool | ||
182 | help | ||
183 | Compile in platform device definitions for HSMMC channel 1 | ||
184 | |||
185 | config S3C_DEV_HSMMC2 | ||
186 | bool | ||
187 | help | ||
188 | Compile in platform device definitions for HSMMC channel 2 | ||
189 | |||
190 | config S3C_DEV_I2C1 | ||
191 | bool | ||
192 | help | ||
193 | Compile in platform device definitions for I2C channel 1 | ||
194 | |||
195 | config S3C_DEV_FB | ||
196 | bool | ||
197 | help | ||
198 | Compile in platform device definition for framebuffer | ||
199 | |||
200 | config S3C_DEV_USB_HOST | ||
201 | bool | ||
202 | help | ||
203 | Compile in platform device definition for USB host. | ||
204 | |||
205 | config S3C_DEV_USB_HSOTG | ||
206 | bool | ||
207 | help | ||
208 | Compile in platform device definition for USB high-speed OtG | ||
209 | |||
210 | config S3C_DEV_NAND | ||
211 | bool | ||
212 | help | ||
213 | Compile in platform device definition for NAND controller | ||
214 | |||
215 | endif | 173 | endif |
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile index ef10a9131bba..d86299556552 100644 --- a/arch/arm/plat-s3c/Makefile +++ b/arch/arm/plat-s3c/Makefile | |||
@@ -29,15 +29,3 @@ obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o | |||
29 | # PWM support | 29 | # PWM support |
30 | 30 | ||
31 | obj-$(CONFIG_HAVE_PWM) += pwm.o | 31 | obj-$(CONFIG_HAVE_PWM) += pwm.o |
32 | |||
33 | # devices | ||
34 | |||
35 | obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o | ||
36 | obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o | ||
37 | obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o | ||
38 | obj-y += dev-i2c0.o | ||
39 | obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o | ||
40 | obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o | ||
41 | obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o | ||
42 | obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o | ||
43 | obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o | ||
diff --git a/arch/arm/plat-s3c/dev-fb.c b/arch/arm/plat-s3c/dev-fb.c deleted file mode 100644 index a90198fc4b0f..000000000000 --- a/arch/arm/plat-s3c/dev-fb.c +++ /dev/null | |||
@@ -1,73 +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 | |||
19 | #include <mach/irqs.h> | ||
20 | #include <mach/map.h> | ||
21 | #include <mach/regs-fb.h> | ||
22 | |||
23 | #include <plat/fb.h> | ||
24 | #include <plat/devs.h> | ||
25 | #include <plat/cpu.h> | ||
26 | |||
27 | static 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 | |||
50 | struct 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 | |||
59 | void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd) | ||
60 | { | ||
61 | struct s3c_fb_platdata *npd; | ||
62 | |||
63 | if (!pd) { | ||
64 | printk(KERN_ERR "%s: no platform data\n", __func__); | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | npd = kmemdup(pd, sizeof(struct s3c_fb_platdata), GFP_KERNEL); | ||
69 | if (!npd) | ||
70 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
71 | |||
72 | s3c_device_fb.dev.platform_data = npd; | ||
73 | } | ||
diff --git a/arch/arm/plat-s3c/dev-hsmmc.c b/arch/arm/plat-s3c/dev-hsmmc.c deleted file mode 100644 index 4c05b39810e2..000000000000 --- a/arch/arm/plat-s3c/dev-hsmmc.c +++ /dev/null | |||
@@ -1,68 +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 | |||
25 | static 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 | |||
38 | static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL; | ||
39 | |||
40 | struct 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 | }; | ||
45 | |||
46 | struct platform_device s3c_device_hsmmc0 = { | ||
47 | .name = "s3c-sdhci", | ||
48 | .id = 0, | ||
49 | .num_resources = ARRAY_SIZE(s3c_hsmmc_resource), | ||
50 | .resource = s3c_hsmmc_resource, | ||
51 | .dev = { | ||
52 | .dma_mask = &s3c_device_hsmmc_dmamask, | ||
53 | .coherent_dma_mask = 0xffffffffUL, | ||
54 | .platform_data = &s3c_hsmmc0_def_platdata, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd) | ||
59 | { | ||
60 | struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata; | ||
61 | |||
62 | set->max_width = pd->max_width; | ||
63 | |||
64 | if (pd->cfg_gpio) | ||
65 | set->cfg_gpio = pd->cfg_gpio; | ||
66 | if (pd->cfg_card) | ||
67 | set->cfg_card = pd->cfg_card; | ||
68 | } | ||
diff --git a/arch/arm/plat-s3c/dev-hsmmc1.c b/arch/arm/plat-s3c/dev-hsmmc1.c deleted file mode 100644 index e49bc4cd0ee6..000000000000 --- a/arch/arm/plat-s3c/dev-hsmmc1.c +++ /dev/null | |||
@@ -1,68 +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 | |||
25 | static 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 | |||
38 | static u64 s3c_device_hsmmc1_dmamask = 0xffffffffUL; | ||
39 | |||
40 | struct 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 | }; | ||
45 | |||
46 | struct platform_device s3c_device_hsmmc1 = { | ||
47 | .name = "s3c-sdhci", | ||
48 | .id = 1, | ||
49 | .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource), | ||
50 | .resource = s3c_hsmmc1_resource, | ||
51 | .dev = { | ||
52 | .dma_mask = &s3c_device_hsmmc1_dmamask, | ||
53 | .coherent_dma_mask = 0xffffffffUL, | ||
54 | .platform_data = &s3c_hsmmc1_def_platdata, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd) | ||
59 | { | ||
60 | struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata; | ||
61 | |||
62 | set->max_width = pd->max_width; | ||
63 | |||
64 | if (pd->cfg_gpio) | ||
65 | set->cfg_gpio = pd->cfg_gpio; | ||
66 | if (pd->cfg_card) | ||
67 | set->cfg_card = pd->cfg_card; | ||
68 | } | ||
diff --git a/arch/arm/plat-s3c/dev-hsmmc2.c b/arch/arm/plat-s3c/dev-hsmmc2.c deleted file mode 100644 index 824580bc0e06..000000000000 --- a/arch/arm/plat-s3c/dev-hsmmc2.c +++ /dev/null | |||
@@ -1,69 +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 | |||
26 | static 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 | |||
39 | static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL; | ||
40 | |||
41 | struct 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 | }; | ||
46 | |||
47 | struct platform_device s3c_device_hsmmc2 = { | ||
48 | .name = "s3c-sdhci", | ||
49 | .id = 2, | ||
50 | .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource), | ||
51 | .resource = s3c_hsmmc2_resource, | ||
52 | .dev = { | ||
53 | .dma_mask = &s3c_device_hsmmc2_dmamask, | ||
54 | .coherent_dma_mask = 0xffffffffUL, | ||
55 | .platform_data = &s3c_hsmmc2_def_platdata, | ||
56 | }, | ||
57 | }; | ||
58 | |||
59 | void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd) | ||
60 | { | ||
61 | struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata; | ||
62 | |||
63 | set->max_width = pd->max_width; | ||
64 | |||
65 | if (pd->cfg_gpio) | ||
66 | set->cfg_gpio = pd->cfg_gpio; | ||
67 | if (pd->cfg_card) | ||
68 | set->cfg_card = pd->cfg_card; | ||
69 | } | ||
diff --git a/arch/arm/plat-s3c/dev-i2c0.c b/arch/arm/plat-s3c/dev-i2c0.c deleted file mode 100644 index 4c761529b949..000000000000 --- a/arch/arm/plat-s3c/dev-i2c0.c +++ /dev/null | |||
@@ -1,71 +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/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 | |||
26 | static struct resource s3c_i2c_resource[] = { | ||
27 | [0] = { | ||
28 | .start = S3C_PA_IIC, | ||
29 | .end = S3C_PA_IIC + SZ_4K - 1, | ||
30 | .flags = IORESOURCE_MEM, | ||
31 | }, | ||
32 | [1] = { | ||
33 | .start = IRQ_IIC, | ||
34 | .end = IRQ_IIC, | ||
35 | .flags = IORESOURCE_IRQ, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | struct platform_device s3c_device_i2c0 = { | ||
40 | .name = "s3c2410-i2c", | ||
41 | #ifdef CONFIG_S3C_DEV_I2C1 | ||
42 | .id = 0, | ||
43 | #else | ||
44 | .id = -1, | ||
45 | #endif | ||
46 | .num_resources = ARRAY_SIZE(s3c_i2c_resource), | ||
47 | .resource = s3c_i2c_resource, | ||
48 | }; | ||
49 | |||
50 | static struct s3c2410_platform_i2c default_i2c_data0 __initdata = { | ||
51 | .flags = 0, | ||
52 | .slave_addr = 0x10, | ||
53 | .frequency = 100*1000, | ||
54 | .sda_delay = 100, | ||
55 | }; | ||
56 | |||
57 | void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd) | ||
58 | { | ||
59 | struct s3c2410_platform_i2c *npd; | ||
60 | |||
61 | if (!pd) | ||
62 | pd = &default_i2c_data0; | ||
63 | |||
64 | npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); | ||
65 | if (!npd) | ||
66 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
67 | else if (!npd->cfg_gpio) | ||
68 | npd->cfg_gpio = s3c_i2c0_cfg_gpio; | ||
69 | |||
70 | s3c_device_i2c0.dev.platform_data = npd; | ||
71 | } | ||
diff --git a/arch/arm/plat-s3c/dev-i2c1.c b/arch/arm/plat-s3c/dev-i2c1.c deleted file mode 100644 index d44f79110506..000000000000 --- a/arch/arm/plat-s3c/dev-i2c1.c +++ /dev/null | |||
@@ -1,68 +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/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 | |||
26 | static struct resource s3c_i2c_resource[] = { | ||
27 | [0] = { | ||
28 | .start = S3C_PA_IIC1, | ||
29 | .end = S3C_PA_IIC1 + SZ_4K - 1, | ||
30 | .flags = IORESOURCE_MEM, | ||
31 | }, | ||
32 | [1] = { | ||
33 | .start = IRQ_IIC1, | ||
34 | .end = IRQ_IIC1, | ||
35 | .flags = IORESOURCE_IRQ, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | struct platform_device s3c_device_i2c1 = { | ||
40 | .name = "s3c2410-i2c", | ||
41 | .id = 1, | ||
42 | .num_resources = ARRAY_SIZE(s3c_i2c_resource), | ||
43 | .resource = s3c_i2c_resource, | ||
44 | }; | ||
45 | |||
46 | static struct s3c2410_platform_i2c default_i2c_data1 __initdata = { | ||
47 | .flags = 0, | ||
48 | .bus_num = 1, | ||
49 | .slave_addr = 0x10, | ||
50 | .frequency = 100*1000, | ||
51 | .sda_delay = 100, | ||
52 | }; | ||
53 | |||
54 | void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd) | ||
55 | { | ||
56 | struct s3c2410_platform_i2c *npd; | ||
57 | |||
58 | if (!pd) | ||
59 | pd = &default_i2c_data1; | ||
60 | |||
61 | npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); | ||
62 | if (!npd) | ||
63 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
64 | else if (!npd->cfg_gpio) | ||
65 | npd->cfg_gpio = s3c_i2c1_cfg_gpio; | ||
66 | |||
67 | s3c_device_i2c1.dev.platform_data = npd; | ||
68 | } | ||
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c deleted file mode 100644 index a52fb6cf618f..000000000000 --- a/arch/arm/plat-s3c/dev-nand.c +++ /dev/null | |||
@@ -1,129 +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/kernel.h> | ||
10 | #include <linux/platform_device.h> | ||
11 | |||
12 | #include <linux/mtd/mtd.h> | ||
13 | #include <linux/mtd/partitions.h> | ||
14 | |||
15 | #include <mach/map.h> | ||
16 | #include <plat/devs.h> | ||
17 | #include <plat/nand.h> | ||
18 | |||
19 | static struct resource s3c_nand_resource[] = { | ||
20 | [0] = { | ||
21 | .start = S3C_PA_NAND, | ||
22 | .end = S3C_PA_NAND + SZ_1M, | ||
23 | .flags = IORESOURCE_MEM, | ||
24 | } | ||
25 | }; | ||
26 | |||
27 | struct platform_device s3c_device_nand = { | ||
28 | .name = "s3c2410-nand", | ||
29 | .id = -1, | ||
30 | .num_resources = ARRAY_SIZE(s3c_nand_resource), | ||
31 | .resource = s3c_nand_resource, | ||
32 | }; | ||
33 | |||
34 | EXPORT_SYMBOL(s3c_device_nand); | ||
35 | |||
36 | /** | ||
37 | * s3c_nand_copy_set() - copy nand set data | ||
38 | * @set: The new structure, directly copied from the old. | ||
39 | * | ||
40 | * Copy all the fields from the NAND set field from what is probably __initdata | ||
41 | * to new kernel memory. The code returns 0 if the copy happened correctly or | ||
42 | * an error code for the calling function to display. | ||
43 | * | ||
44 | * Note, we currently do not try and look to see if we've already copied the | ||
45 | * data in a previous set. | ||
46 | */ | ||
47 | static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set) | ||
48 | { | ||
49 | void *ptr; | ||
50 | int size; | ||
51 | |||
52 | size = sizeof(struct mtd_partition) * set->nr_partitions; | ||
53 | if (size) { | ||
54 | ptr = kmemdup(set->partitions, size, GFP_KERNEL); | ||
55 | set->partitions = ptr; | ||
56 | |||
57 | if (!ptr) | ||
58 | return -ENOMEM; | ||
59 | } | ||
60 | |||
61 | if (set->nr_map && set->nr_chips) { | ||
62 | size = sizeof(int) * set->nr_chips; | ||
63 | ptr = kmemdup(set->nr_map, size, GFP_KERNEL); | ||
64 | set->nr_map = ptr; | ||
65 | |||
66 | if (!ptr) | ||
67 | return -ENOMEM; | ||
68 | } | ||
69 | |||
70 | if (set->ecc_layout) { | ||
71 | ptr = kmemdup(set->ecc_layout, | ||
72 | sizeof(struct nand_ecclayout), GFP_KERNEL); | ||
73 | set->ecc_layout = ptr; | ||
74 | |||
75 | if (!ptr) | ||
76 | return -ENOMEM; | ||
77 | } | ||
78 | |||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand) | ||
83 | { | ||
84 | struct s3c2410_platform_nand *npd; | ||
85 | int size; | ||
86 | int ret; | ||
87 | |||
88 | /* note, if we get a failure in allocation, we simply drop out of the | ||
89 | * function. If there is so little memory available at initialisation | ||
90 | * time then there is little chance the system is going to run. | ||
91 | */ | ||
92 | |||
93 | npd = kmemdup(nand, sizeof(struct s3c2410_platform_nand), GFP_KERNEL); | ||
94 | if (!npd) { | ||
95 | printk(KERN_ERR "%s: failed copying platform data\n", __func__); | ||
96 | return; | ||
97 | } | ||
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 | |||
126 | s3c_device_nand.dev.platform_data = npd; | ||
127 | } | ||
128 | |||
129 | EXPORT_SYMBOL_GPL(s3c_nand_set_platdata); | ||
diff --git a/arch/arm/plat-s3c/dev-usb-hsotg.c b/arch/arm/plat-s3c/dev-usb-hsotg.c deleted file mode 100644 index e2f604b51c86..000000000000 --- a/arch/arm/plat-s3c/dev-usb-hsotg.c +++ /dev/null | |||
@@ -1,41 +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 | |||
18 | #include <mach/irqs.h> | ||
19 | #include <mach/map.h> | ||
20 | |||
21 | #include <plat/devs.h> | ||
22 | |||
23 | static struct resource s3c_usb_hsotg_resources[] = { | ||
24 | [0] = { | ||
25 | .start = S3C_PA_USB_HSOTG, | ||
26 | .end = S3C_PA_USB_HSOTG + 0x10000 - 1, | ||
27 | .flags = IORESOURCE_MEM, | ||
28 | }, | ||
29 | [1] = { | ||
30 | .start = IRQ_OTG, | ||
31 | .end = IRQ_OTG, | ||
32 | .flags = IORESOURCE_IRQ, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | struct platform_device s3c_device_usb_hsotg = { | ||
37 | .name = "s3c-hsotg", | ||
38 | .id = -1, | ||
39 | .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources), | ||
40 | .resource = s3c_usb_hsotg_resources, | ||
41 | }; | ||
diff --git a/arch/arm/plat-s3c/dev-usb.c b/arch/arm/plat-s3c/dev-usb.c deleted file mode 100644 index 2ee85abed6d9..000000000000 --- a/arch/arm/plat-s3c/dev-usb.c +++ /dev/null | |||
@@ -1,50 +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/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/devs.h> | ||
22 | |||
23 | |||
24 | static struct resource s3c_usb_resource[] = { | ||
25 | [0] = { | ||
26 | .start = S3C_PA_USBHOST, | ||
27 | .end = S3C_PA_USBHOST + 0x100 - 1, | ||
28 | .flags = IORESOURCE_MEM, | ||
29 | }, | ||
30 | [1] = { | ||
31 | .start = IRQ_USBH, | ||
32 | .end = IRQ_USBH, | ||
33 | .flags = IORESOURCE_IRQ, | ||
34 | } | ||
35 | }; | ||
36 | |||
37 | static u64 s3c_device_usb_dmamask = 0xffffffffUL; | ||
38 | |||
39 | struct platform_device s3c_device_usb = { | ||
40 | .name = "s3c2410-ohci", | ||
41 | .id = -1, | ||
42 | .num_resources = ARRAY_SIZE(s3c_usb_resource), | ||
43 | .resource = s3c_usb_resource, | ||
44 | .dev = { | ||
45 | .dma_mask = &s3c_device_usb_dmamask, | ||
46 | .coherent_dma_mask = 0xffffffffUL | ||
47 | } | ||
48 | }; | ||
49 | |||
50 | EXPORT_SYMBOL(s3c_device_usb); | ||