},
};
+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[] = {
},
};
+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;
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;
return;
}
- pdev->dev.platform_data = pdata;
pdev->id = rt288x_flash_instance;
platform_device_register(pdev);
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;
}
};
-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,
{
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();
}
};
-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",
{
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);
},
};
-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",
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();
}
};
-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();
}