diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-01-18 02:24:22 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-19 03:21:38 -0500 |
commit | 22c810ab3e25d16e6f128384d107b933b6fd8fff (patch) | |
tree | 6cc4c9112b86512d4093dde3e17ab5ec9fdefa90 | |
parent | 3cd2fff59fc924752611301f4ca7e8484f5744a5 (diff) |
ARM: S3C24XX: Add mci platform data set call s3c24xx_mci_set_platdata().
Add a s3c24xx_mci_set_platdata() call for all the machine files that have
platform data for the MCI driver. This brings the MCI device into line with
the other devices with __initdata and a specific call to ensure the right
structure type is being passed.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | arch/arm/mach-s3c2410/mach-h1940.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-at2440evb.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-mini2440.c | 3 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 13 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/mci.h | 9 |
5 files changed, 27 insertions, 8 deletions
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 3f9217d0abf7..fbedd0760941 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
@@ -196,7 +196,7 @@ static struct platform_device h1940_device_bluetooth = { | |||
196 | .id = -1, | 196 | .id = -1, |
197 | }; | 197 | }; |
198 | 198 | ||
199 | static struct s3c24xx_mci_pdata h1940_mmc_cfg = { | 199 | static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = { |
200 | .gpio_detect = S3C2410_GPF(5), | 200 | .gpio_detect = S3C2410_GPF(5), |
201 | .gpio_wprotect = S3C2410_GPH(8), | 201 | .gpio_wprotect = S3C2410_GPH(8), |
202 | .set_power = NULL, | 202 | .set_power = NULL, |
@@ -311,12 +311,11 @@ static void __init h1940_init(void) | |||
311 | u32 tmp; | 311 | u32 tmp; |
312 | 312 | ||
313 | s3c24xx_fb_set_platdata(&h1940_fb_info); | 313 | s3c24xx_fb_set_platdata(&h1940_fb_info); |
314 | s3c24xx_mci_set_platdata(&h1940_mmc_cfg); | ||
314 | s3c24xx_udc_set_platdata(&h1940_udc_cfg); | 315 | s3c24xx_udc_set_platdata(&h1940_udc_cfg); |
315 | s3c24xx_ts_set_platdata(&h1940_ts_cfg); | 316 | s3c24xx_ts_set_platdata(&h1940_ts_cfg); |
316 | s3c_i2c0_set_platdata(NULL); | 317 | s3c_i2c0_set_platdata(NULL); |
317 | 318 | ||
318 | s3c_device_sdi.dev.platform_data = &h1940_mmc_cfg; | ||
319 | |||
320 | /* Turn off suspend on both USB ports, and switch the | 319 | /* Turn off suspend on both USB ports, and switch the |
321 | * selectable USB port to USB device mode. */ | 320 | * selectable USB port to USB device mode. */ |
322 | 321 | ||
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c index 0defde6de38f..84725791e6bf 100644 --- a/arch/arm/mach-s3c2440/mach-at2440evb.c +++ b/arch/arm/mach-s3c2440/mach-at2440evb.c | |||
@@ -165,7 +165,7 @@ static struct platform_device at2440evb_device_eth = { | |||
165 | }, | 165 | }, |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static struct s3c24xx_mci_pdata at2440evb_mci_pdata = { | 168 | static struct s3c24xx_mci_pdata at2440evb_mci_pdata __initdata = { |
169 | .gpio_detect = S3C2410_GPG(10), | 169 | .gpio_detect = S3C2410_GPG(10), |
170 | }; | 170 | }; |
171 | 171 | ||
@@ -216,8 +216,6 @@ static struct platform_device *at2440evb_devices[] __initdata = { | |||
216 | 216 | ||
217 | static void __init at2440evb_map_io(void) | 217 | static void __init at2440evb_map_io(void) |
218 | { | 218 | { |
219 | s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata; | ||
220 | |||
221 | s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); | 219 | s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); |
222 | s3c24xx_init_clocks(16934400); | 220 | s3c24xx_init_clocks(16934400); |
223 | s3c24xx_init_uarts(at2440evb_uartcfgs, ARRAY_SIZE(at2440evb_uartcfgs)); | 221 | s3c24xx_init_uarts(at2440evb_uartcfgs, ARRAY_SIZE(at2440evb_uartcfgs)); |
@@ -226,6 +224,7 @@ static void __init at2440evb_map_io(void) | |||
226 | static void __init at2440evb_init(void) | 224 | static void __init at2440evb_init(void) |
227 | { | 225 | { |
228 | s3c24xx_fb_set_platdata(&at2440evb_fb_info); | 226 | s3c24xx_fb_set_platdata(&at2440evb_fb_info); |
227 | s3c24xx_mci_set_platdata(&at2440evb_mci_pdata); | ||
229 | s3c_nand_set_platdata(&at2440evb_nand_info); | 228 | s3c_nand_set_platdata(&at2440evb_nand_info); |
230 | s3c_i2c0_set_platdata(NULL); | 229 | s3c_i2c0_set_platdata(NULL); |
231 | 230 | ||
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c index 65ea3b5ee4fd..571b17683d96 100644 --- a/arch/arm/mach-s3c2440/mach-mini2440.c +++ b/arch/arm/mach-s3c2440/mach-mini2440.c | |||
@@ -528,8 +528,6 @@ static void __init mini2440_map_io(void) | |||
528 | s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc)); | 528 | s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc)); |
529 | s3c24xx_init_clocks(12000000); | 529 | s3c24xx_init_clocks(12000000); |
530 | s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs)); | 530 | s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs)); |
531 | |||
532 | s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg; | ||
533 | } | 531 | } |
534 | 532 | ||
535 | /* | 533 | /* |
@@ -675,6 +673,7 @@ static void __init mini2440_init(void) | |||
675 | } | 673 | } |
676 | 674 | ||
677 | s3c24xx_udc_set_platdata(&mini2440_udc_cfg); | 675 | s3c24xx_udc_set_platdata(&mini2440_udc_cfg); |
676 | s3c24xx_mci_set_platdata(&mini2440_mmc_cfg); | ||
678 | s3c_nand_set_platdata(&mini2440_nand_info); | 677 | s3c_nand_set_platdata(&mini2440_nand_info); |
679 | s3c_i2c0_set_platdata(NULL); | 678 | s3c_i2c0_set_platdata(NULL); |
680 | 679 | ||
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index 38c358c14aa2..986d4e5408f5 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | #include <plat/regs-serial.h> | 33 | #include <plat/regs-serial.h> |
34 | #include <plat/udc.h> | 34 | #include <plat/udc.h> |
35 | #include <plat/mci.h> | ||
35 | 36 | ||
36 | #include <plat/devs.h> | 37 | #include <plat/devs.h> |
37 | #include <plat/cpu.h> | 38 | #include <plat/cpu.h> |
@@ -351,6 +352,18 @@ struct platform_device s3c_device_sdi = { | |||
351 | 352 | ||
352 | EXPORT_SYMBOL(s3c_device_sdi); | 353 | EXPORT_SYMBOL(s3c_device_sdi); |
353 | 354 | ||
355 | void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) | ||
356 | { | ||
357 | struct s3c24xx_mci_pdata *npd; | ||
358 | |||
359 | npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL); | ||
360 | if (!npd) | ||
361 | printk(KERN_ERR "%s: no memory to copy pdata", __func__); | ||
362 | |||
363 | s3c_device_sdi.dev.platform_data = npd; | ||
364 | } | ||
365 | |||
366 | |||
354 | /* SPI (0) */ | 367 | /* SPI (0) */ |
355 | 368 | ||
356 | static struct resource s3c_spi0_resource[] = { | 369 | static struct resource s3c_spi0_resource[] = { |
diff --git a/arch/arm/plat-s3c24xx/include/plat/mci.h b/arch/arm/plat-s3c24xx/include/plat/mci.h index 36aaa10fad06..2ac2b21ec490 100644 --- a/arch/arm/plat-s3c24xx/include/plat/mci.h +++ b/arch/arm/plat-s3c24xx/include/plat/mci.h | |||
@@ -40,4 +40,13 @@ struct s3c24xx_mci_pdata { | |||
40 | unsigned short vdd); | 40 | unsigned short vdd); |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /** | ||
44 | * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device | ||
45 | * @pdata: The platform data | ||
46 | * | ||
47 | * Copy the platform data supplied by @pdata so that this can be marked | ||
48 | * __initdata. | ||
49 | */ | ||
50 | extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata); | ||
51 | |||
43 | #endif /* _ARCH_NCI_H */ | 52 | #endif /* _ARCH_NCI_H */ |