1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 20:53:22 +02:00

ramips: rt288x: remove per-board physmap_flash_data instances

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30474 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2012-02-12 12:52:12 +00:00
parent 40c07f37d9
commit 4c24144f1f
6 changed files with 30 additions and 28 deletions

View File

@ -35,10 +35,14 @@ static struct resource rt288x_flash0_resources[] = {
}, },
}; };
struct physmap_flash_data rt288x_flash0_data;
static struct platform_device rt288x_flash0_device = { static struct platform_device rt288x_flash0_device = {
.name = "physmap-flash", .name = "physmap-flash",
.resource = rt288x_flash0_resources, .resource = rt288x_flash0_resources,
.num_resources = ARRAY_SIZE(rt288x_flash0_resources), .num_resources = ARRAY_SIZE(rt288x_flash0_resources),
.dev = {
.platform_data = &rt288x_flash0_data,
},
}; };
static struct resource rt288x_flash1_resources[] = { 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 = { static struct platform_device rt288x_flash1_device = {
.name = "physmap-flash", .name = "physmap-flash",
.resource = rt288x_flash1_resources, .resource = rt288x_flash1_resources,
.num_resources = ARRAY_SIZE(rt288x_flash1_resources), .num_resources = ARRAY_SIZE(rt288x_flash1_resources),
.dev = {
.platform_data = &rt288x_flash1_data,
},
}; };
static int rt288x_flash_instance __initdata; static int rt288x_flash_instance __initdata;
void __init rt288x_register_flash(unsigned int id, void __init rt288x_register_flash(unsigned int id)
struct physmap_flash_data *pdata)
{ {
struct platform_device *pdev; struct platform_device *pdev;
struct physmap_flash_data *pdata;
u32 t; u32 t;
int reg; int reg;
@ -80,6 +88,7 @@ void __init rt288x_register_flash(unsigned int id,
t = rt288x_memc_rr(reg); t = rt288x_memc_rr(reg);
t = (t >> FLASH_CFG_WIDTH_SHIFT) & FLASH_CFG_WIDTH_MASK; t = (t >> FLASH_CFG_WIDTH_SHIFT) & FLASH_CFG_WIDTH_MASK;
pdata = pdev->dev.platform_data;
switch (t) { switch (t) {
case FLASH_CFG_WIDTH_8BIT: case FLASH_CFG_WIDTH_8BIT:
pdata->width = 1; pdata->width = 1;
@ -95,7 +104,6 @@ void __init rt288x_register_flash(unsigned int id,
return; return;
} }
pdev->dev.platform_data = pdata;
pdev->id = rt288x_flash_instance; pdev->id = rt288x_flash_instance;
platform_device_register(pdev); platform_device_register(pdev);

View File

@ -14,7 +14,10 @@
struct physmap_flash_data; 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); void rt288x_register_wifi(void);
extern struct ramips_eth_platform_data rt288x_eth_data; extern struct ramips_eth_platform_data rt288x_eth_data;

View File

@ -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 = { static struct rtl8366_platform_data f5d8235_rtl8366s_data = {
.gpio_sda = F5D8235_GPIO_RTL8366_SDA, .gpio_sda = F5D8235_GPIO_RTL8366_SDA,
.gpio_sck = F5D8235_GPIO_RTL8366_SCK, .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_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_wifi();
rt288x_register_wdt(); rt288x_register_wdt();

View File

@ -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 = { static struct gpio_led rt_n15_leds_gpio[] __initdata = {
{ {
.name = "rt-n15:blue:power", .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_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), ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n15_leds_gpio),
rt_n15_leds_gpio); rt_n15_leds_gpio);

View File

@ -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 = { static struct gpio_led wli_tx4_ag300n_leds_gpio[] __initdata = {
{ {
.name = "buffalo:blue:power", .name = "buffalo:blue:power",
@ -136,7 +131,10 @@ static void __init wli_tx4_ag300n_init(void)
ARRAY_SIZE(wli_tx4_ag300n_gpio_buttons), ARRAY_SIZE(wli_tx4_ag300n_gpio_buttons),
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_wifi();
rt288x_register_wdt(); rt288x_register_wdt();

View File

@ -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) static void __init wzr_agl300nh_init(void)
{ {
rt288x_gpio_init(RT2880_GPIO_MODE_UART0); 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_wifi();
rt288x_register_wdt(); rt288x_register_wdt();
} }