ramips: rt288x: remove per-board physmap_flash_data instances
SVN-Revision: 30474
This commit is contained in:
parent
3502e2b93f
commit
faae4235c4
6 changed files with 30 additions and 28 deletions
|
@ -35,10 +35,14 @@ static struct resource rt288x_flash0_resources[] = {
|
|||
},
|
||||
};
|
||||
|
||||
struct physmap_flash_data rt288x_flash0_data;
|
||||
static struct platform_device rt288x_flash0_device = {
|
||||
.name = "physmap-flash",
|
||||
.resource = rt288x_flash0_resources,
|
||||
.num_resources = ARRAY_SIZE(rt288x_flash0_resources),
|
||||
.dev = {
|
||||
.platform_data = &rt288x_flash0_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource rt288x_flash1_resources[] = {
|
||||
|
@ -50,17 +54,21 @@ static struct resource rt288x_flash1_resources[] = {
|
|||
},
|
||||
};
|
||||
|
||||
struct physmap_flash_data rt288x_flash1_data;
|
||||
static struct platform_device rt288x_flash1_device = {
|
||||
.name = "physmap-flash",
|
||||
.resource = rt288x_flash1_resources,
|
||||
.num_resources = ARRAY_SIZE(rt288x_flash1_resources),
|
||||
.dev = {
|
||||
.platform_data = &rt288x_flash1_data,
|
||||
},
|
||||
};
|
||||
|
||||
static int rt288x_flash_instance __initdata;
|
||||
void __init rt288x_register_flash(unsigned int id,
|
||||
struct physmap_flash_data *pdata)
|
||||
void __init rt288x_register_flash(unsigned int id)
|
||||
{
|
||||
struct platform_device *pdev;
|
||||
struct physmap_flash_data *pdata;
|
||||
u32 t;
|
||||
int reg;
|
||||
|
||||
|
@ -80,6 +88,7 @@ void __init rt288x_register_flash(unsigned int id,
|
|||
t = rt288x_memc_rr(reg);
|
||||
t = (t >> FLASH_CFG_WIDTH_SHIFT) & FLASH_CFG_WIDTH_MASK;
|
||||
|
||||
pdata = pdev->dev.platform_data;
|
||||
switch (t) {
|
||||
case FLASH_CFG_WIDTH_8BIT:
|
||||
pdata->width = 1;
|
||||
|
@ -95,7 +104,6 @@ void __init rt288x_register_flash(unsigned int id,
|
|||
return;
|
||||
}
|
||||
|
||||
pdev->dev.platform_data = pdata;
|
||||
pdev->id = rt288x_flash_instance;
|
||||
|
||||
platform_device_register(pdev);
|
||||
|
|
|
@ -14,7 +14,10 @@
|
|||
|
||||
struct physmap_flash_data;
|
||||
|
||||
void rt288x_register_flash(unsigned int id, struct physmap_flash_data *pdata);
|
||||
extern struct physmap_flash_data rt288x_flash0_data;
|
||||
extern struct physmap_flash_data rt288x_flash1_data;
|
||||
void rt288x_register_flash(unsigned int id);
|
||||
|
||||
void rt288x_register_wifi(void);
|
||||
|
||||
extern struct ramips_eth_platform_data rt288x_eth_data;
|
||||
|
|
|
@ -63,11 +63,6 @@ static struct mtd_partition f5d8235_partitions[] = {
|
|||
}
|
||||
};
|
||||
|
||||
static struct physmap_flash_data f5d8235_flash_data = {
|
||||
.nr_parts = ARRAY_SIZE(f5d8235_partitions),
|
||||
.parts = f5d8235_partitions,
|
||||
};
|
||||
|
||||
static struct rtl8366_platform_data f5d8235_rtl8366s_data = {
|
||||
.gpio_sda = F5D8235_GPIO_RTL8366_SDA,
|
||||
.gpio_sck = F5D8235_GPIO_RTL8366_SCK,
|
||||
|
@ -115,7 +110,10 @@ static void __init f5d8235_init(void)
|
|||
{
|
||||
rt288x_gpio_init(RT2880_GPIO_MODE_UART0 | RT2880_GPIO_MODE_I2C);
|
||||
|
||||
rt288x_register_flash(0, &f5d8235_flash_data);
|
||||
rt288x_flash0_data.nr_parts = ARRAY_SIZE(f5d8235_partitions);
|
||||
rt288x_flash0_data.parts = f5d8235_partitions;
|
||||
rt288x_register_flash(0);
|
||||
|
||||
rt288x_register_wifi();
|
||||
rt288x_register_wdt();
|
||||
|
||||
|
|
|
@ -66,11 +66,6 @@ static struct mtd_partition rt_n15_partitions[] = {
|
|||
}
|
||||
};
|
||||
|
||||
static struct physmap_flash_data rt_n15_flash_data = {
|
||||
.nr_parts = ARRAY_SIZE(rt_n15_partitions),
|
||||
.parts = rt_n15_partitions,
|
||||
};
|
||||
|
||||
static struct gpio_led rt_n15_leds_gpio[] __initdata = {
|
||||
{
|
||||
.name = "rt-n15:blue:power",
|
||||
|
@ -114,7 +109,9 @@ static void __init rt_n15_init(void)
|
|||
{
|
||||
rt288x_gpio_init(RT2880_GPIO_MODE_UART0 | RT2880_GPIO_MODE_I2C);
|
||||
|
||||
rt288x_register_flash(0, &rt_n15_flash_data);
|
||||
rt288x_flash0_data.nr_parts = ARRAY_SIZE(rt_n15_partitions);
|
||||
rt288x_flash0_data.parts = rt_n15_partitions;
|
||||
rt288x_register_flash(0);
|
||||
|
||||
ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n15_leds_gpio),
|
||||
rt_n15_leds_gpio);
|
||||
|
|
|
@ -76,11 +76,6 @@ static struct mtd_partition wli_tx4_ag300n_partitions[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct physmap_flash_data wli_tx4_ag300n_flash_data = {
|
||||
.nr_parts = ARRAY_SIZE(wli_tx4_ag300n_partitions),
|
||||
.parts = wli_tx4_ag300n_partitions,
|
||||
};
|
||||
|
||||
static struct gpio_led wli_tx4_ag300n_leds_gpio[] __initdata = {
|
||||
{
|
||||
.name = "buffalo:blue:power",
|
||||
|
@ -136,7 +131,10 @@ static void __init wli_tx4_ag300n_init(void)
|
|||
ARRAY_SIZE(wli_tx4_ag300n_gpio_buttons),
|
||||
wli_tx4_ag300n_gpio_buttons);
|
||||
|
||||
rt288x_register_flash(0, &wli_tx4_ag300n_flash_data);
|
||||
rt288x_flash0_data.nr_parts = ARRAY_SIZE(wli_tx4_ag300n_partitions);
|
||||
rt288x_flash0_data.parts = wli_tx4_ag300n_partitions;
|
||||
rt288x_register_flash(0);
|
||||
|
||||
rt288x_register_wifi();
|
||||
rt288x_register_wdt();
|
||||
|
||||
|
|
|
@ -61,16 +61,14 @@ static struct mtd_partition wzr_agl300nh_partitions[] = {
|
|||
}
|
||||
};
|
||||
|
||||
static struct physmap_flash_data wzr_agl300nh_flash_data = {
|
||||
.nr_parts = ARRAY_SIZE(wzr_agl300nh_partitions),
|
||||
.parts = wzr_agl300nh_partitions,
|
||||
};
|
||||
|
||||
static void __init wzr_agl300nh_init(void)
|
||||
{
|
||||
rt288x_gpio_init(RT2880_GPIO_MODE_UART0);
|
||||
|
||||
rt288x_register_flash(0, &wzr_agl300nh_flash_data);
|
||||
rt288x_flash0_data.nr_parts = ARRAY_SIZE(wzr_agl300nh_partitions);
|
||||
rt288x_flash0_data.parts = wzr_agl300nh_partitions;
|
||||
rt288x_register_flash(0);
|
||||
|
||||
rt288x_register_wifi();
|
||||
rt288x_register_wdt();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue