2 * ASUS RT-N13U board support
4 * Copyright (C) 2012 lintel<lintel.huang@gmail.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <linux/init.h>
12 #include <linux/platform_device.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>
22 #define RT_N13U_GPIO_BUTTON_RESET 10
23 #define RT_N13U_GPIO_BUTTON_WPS 0
25 #define RT_N13U_GPIO_LED_POWER 7
26 #define RT_N13U_GPIO_LED_WIFI 8
29 #define RT_N13U_BUTTONS_POLL_INTERVAL 10
30 #define RT_N13U_BUTTONS_DEBOUNCE_INTERVAL (3 * RT_N13U_BUTTONS_POLL_INTERVAL)
32 static struct gpio_led rt_n13u_leds_gpio[] __initdata = {
34 .name = "rt-n13u:power",
35 .gpio = RT_N13U_GPIO_LED_POWER,
38 .name = "rt-n13u:wifi",
39 .gpio = RT_N13U_GPIO_LED_WIFI,
44 static struct gpio_keys_button rt_n13u_gpio_buttons[] __initdata = {
49 .debounce_interval = RT_N13U_BUTTONS_DEBOUNCE_INTERVAL,
50 .gpio = RT_N13U_GPIO_BUTTON_RESET,
55 .code = KEY_WPS_BUTTON,
56 .debounce_interval = RT_N13U_BUTTONS_DEBOUNCE_INTERVAL,
57 .gpio = RT_N13U_GPIO_BUTTON_WPS,
62 static void __init rt_n13u_init(void)
64 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
66 rt305x_register_flash(0);
68 ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n13u_leds_gpio),
71 ramips_register_gpio_buttons(-1, RT_N13U_BUTTONS_POLL_INTERVAL,
72 ARRAY_SIZE(rt_n13u_gpio_buttons),
73 rt_n13u_gpio_buttons);
75 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
76 rt305x_register_ethernet();
77 rt305x_register_wifi();
78 rt305x_register_wdt();
79 rt305x_register_usb();
82 MIPS_MACHINE(RAMIPS_MACH_RT_N13U, "RT-N13U", "Asus RT-N13U",