提交 22c810ab 编写于 作者: B Ben Dooks

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: NBen Dooks <ben-linux@fluff.org>
上级 3cd2fff5
......@@ -196,7 +196,7 @@ static struct platform_device h1940_device_bluetooth = {
.id = -1,
};
static struct s3c24xx_mci_pdata h1940_mmc_cfg = {
static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
.gpio_detect = S3C2410_GPF(5),
.gpio_wprotect = S3C2410_GPH(8),
.set_power = NULL,
......@@ -311,12 +311,11 @@ static void __init h1940_init(void)
u32 tmp;
s3c24xx_fb_set_platdata(&h1940_fb_info);
s3c24xx_mci_set_platdata(&h1940_mmc_cfg);
s3c24xx_udc_set_platdata(&h1940_udc_cfg);
s3c24xx_ts_set_platdata(&h1940_ts_cfg);
s3c_i2c0_set_platdata(NULL);
s3c_device_sdi.dev.platform_data = &h1940_mmc_cfg;
/* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode. */
......
......@@ -165,7 +165,7 @@ static struct platform_device at2440evb_device_eth = {
},
};
static struct s3c24xx_mci_pdata at2440evb_mci_pdata = {
static struct s3c24xx_mci_pdata at2440evb_mci_pdata __initdata = {
.gpio_detect = S3C2410_GPG(10),
};
......@@ -216,8 +216,6 @@ static struct platform_device *at2440evb_devices[] __initdata = {
static void __init at2440evb_map_io(void)
{
s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata;
s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc));
s3c24xx_init_clocks(16934400);
s3c24xx_init_uarts(at2440evb_uartcfgs, ARRAY_SIZE(at2440evb_uartcfgs));
......@@ -226,6 +224,7 @@ static void __init at2440evb_map_io(void)
static void __init at2440evb_init(void)
{
s3c24xx_fb_set_platdata(&at2440evb_fb_info);
s3c24xx_mci_set_platdata(&at2440evb_mci_pdata);
s3c_nand_set_platdata(&at2440evb_nand_info);
s3c_i2c0_set_platdata(NULL);
......
......@@ -528,8 +528,6 @@ static void __init mini2440_map_io(void)
s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc));
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs));
s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
}
/*
......@@ -675,6 +673,7 @@ static void __init mini2440_init(void)
}
s3c24xx_udc_set_platdata(&mini2440_udc_cfg);
s3c24xx_mci_set_platdata(&mini2440_mmc_cfg);
s3c_nand_set_platdata(&mini2440_nand_info);
s3c_i2c0_set_platdata(NULL);
......
......@@ -32,6 +32,7 @@
#include <plat/regs-serial.h>
#include <plat/udc.h>
#include <plat/mci.h>
#include <plat/devs.h>
#include <plat/cpu.h>
......@@ -351,6 +352,18 @@ struct platform_device s3c_device_sdi = {
EXPORT_SYMBOL(s3c_device_sdi);
void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
{
struct s3c24xx_mci_pdata *npd;
npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL);
if (!npd)
printk(KERN_ERR "%s: no memory to copy pdata", __func__);
s3c_device_sdi.dev.platform_data = npd;
}
/* SPI (0) */
static struct resource s3c_spi0_resource[] = {
......
......@@ -40,4 +40,13 @@ struct s3c24xx_mci_pdata {
unsigned short vdd);
};
/**
* s3c24xx_mci_set_platdata - set platform data for mmc/sdi device
* @pdata: The platform data
*
* Copy the platform data supplied by @pdata so that this can be marked
* __initdata.
*/
extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata);
#endif /* _ARCH_NCI_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册