X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/2b913567e8157a4fd06ed4ec07761d695452e16f..40c07f37d9e065d656e88603f8c8b60a86506a2b:/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-omni-emb.c diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-omni-emb.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-omni-emb.c index 87acf4d53..50cc0bcb2 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-omni-emb.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-omni-emb.c @@ -25,12 +25,12 @@ #define OMNI_EMB_GPIO_BUTTON_RESET 12 /* active low */ -#define OMNI_EMB_BUTTONS_POLL_INTERVAL 20 +#define OMNI_EMB_KEYS_POLL_INTERVAL 20 +#define OMNI_EMB_KEYS_DEBOUNCE_INTERVAL (3 * OMNI_EMB_KEYS_POLL_INTERVAL) #define OMNI_EMB_GPIO_LED_STATUS 9 #define OMNI_EMB_GPIO_LED_WLAN 14 -#ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition emb_partitions[] = { { .name = "uboot", @@ -54,16 +54,12 @@ static struct mtd_partition emb_partitions[] = { .name = "rootfs", .offset = 0x150000, .size = 0x6B0000, + }, { + .name = "firmware", + .offset = 0x050000, + .size = 0x7B0000, } }; -#endif /* CONFIG_MTD_PARTITIONS */ - -static struct physmap_flash_data omni_emb_flash_data = { -#ifdef CONFIG_MTD_PARTITIONS - .nr_parts = ARRAY_SIZE(emb_partitions), - .parts = emb_partitions, -#endif -}; static struct gpio_led omni_emb_leds_gpio[] __initdata = { { @@ -77,12 +73,12 @@ static struct gpio_led omni_emb_leds_gpio[] __initdata = { } }; -static struct gpio_button omni_emb_gpio_buttons[] __initdata = { +static struct gpio_keys_button omni_emb_gpio_buttons[] __initdata = { { .desc = "reset", .type = EV_KEY, .code = KEY_RESTART, - .threshold = 3, + .debounce_interval = OMNI_EMB_KEYS_DEBOUNCE_INTERVAL, .gpio = OMNI_EMB_GPIO_BUTTON_RESET, .active_low = 1, } @@ -96,11 +92,14 @@ static void __init omni_emb_init(void) ramips_register_gpio_leds(-1, ARRAY_SIZE(omni_emb_leds_gpio), omni_emb_leds_gpio); - ramips_register_gpio_buttons(-1, OMNI_EMB_BUTTONS_POLL_INTERVAL, + ramips_register_gpio_buttons(-1, OMNI_EMB_KEYS_POLL_INTERVAL, ARRAY_SIZE(omni_emb_gpio_buttons), omni_emb_gpio_buttons); - rt305x_register_flash(0, &omni_emb_flash_data); + rt305x_flash0_data.nr_parts = ARRAY_SIZE(emb_partitions); + rt305x_flash0_data.parts = emb_partitions; + rt305x_register_flash(0); + rt305x_register_ethernet(); rt305x_register_wifi(); rt305x_register_wdt();