2 * Tenda W306R V2.0 board support
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
10 #include <linux/init.h>
11 #include <linux/platform_device.h>
12 #include <linux/ethtool.h>
14 #include <asm/mach-ralink/machine.h>
15 #include <asm/mach-ralink/dev-gpio-buttons.h>
16 #include <asm/mach-ralink/dev-gpio-leds.h>
17 #include <asm/mach-ralink/rt305x.h>
18 #include <asm/mach-ralink/rt305x_regs.h>
19 #include <asm/mach-ralink/ramips_eth_platform.h>
23 #define W306R_V20_GPIO_LED_SYS 9
24 #define W306R_V20_GPIO_LED_WPS 13
26 #define W306R_V20_GPIO_BUTTON_RESET 10
28 #define W306R_V20_KEYS_POLL_INTERVAL 20
29 #define W306R_V20_KEYS_DEBOUNCE_INTERVAL (3 * W306R_V20_KEYS_POLL_INTERVAL)
31 static struct gpio_led w306r_v20_leds_gpio[] __initdata = {
33 .name = "w306r-v20:green:sys",
34 .gpio = W306R_V20_GPIO_LED_SYS,
37 .name = "w306r-v20:green:wps",
38 .gpio = W306R_V20_GPIO_LED_WPS,
43 static struct gpio_keys_button w306r_v20_gpio_buttons[] __initdata = {
48 .debounce_interval = W306R_V20_KEYS_DEBOUNCE_INTERVAL,
49 .gpio = W306R_V20_GPIO_BUTTON_RESET,
54 static void __init w306r_v20_init(void)
56 rt305x_register_flash(0);
58 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
60 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
61 rt305x_register_ethernet();
62 ramips_register_gpio_leds(-1, ARRAY_SIZE(w306r_v20_leds_gpio),
64 ramips_register_gpio_buttons(-1, W306R_V20_KEYS_POLL_INTERVAL,
65 ARRAY_SIZE(w306r_v20_gpio_buttons),
66 w306r_v20_gpio_buttons);
67 rt305x_register_wifi();
68 rt305x_register_wdt();
71 MIPS_MACHINE(RAMIPS_MACH_W306R_V20, "W306R_V20", "Tenda W306R V2.0",