2 * Skyline SL-R7205 Wireless 3G Router support
4 * Copyright (C) 2012 Haipoh Teoh <hpteoh@ceedtec.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 SL_R7205_GPIO_BUTTON_WPS 0
23 #define SL_R7205_GPIO_BUTTON_RESET 10 /* active low */
25 #define SL_R7205_GPIO_LED_WIFI 7
27 #define SL_R7205_KEYS_POLL_INTERVAL 20
28 #define SL_R7205_KEYS_DEBOUNCE_INTERVAL (3 * SL_R7205_KEYS_POLL_INTERVAL)
30 static struct gpio_led sl_r7205_leds_gpio
[] __initdata
= {
32 .name
= "sl-r7205:green:wifi",
33 .gpio
= SL_R7205_GPIO_LED_WIFI
,
38 static struct gpio_keys_button sl_r7205_gpio_buttons
[] __initdata
= {
43 .debounce_interval
= SL_R7205_KEYS_DEBOUNCE_INTERVAL
,
44 .gpio
= SL_R7205_GPIO_BUTTON_RESET
,
49 .code
= KEY_WPS_BUTTON
,
50 .debounce_interval
= SL_R7205_KEYS_DEBOUNCE_INTERVAL
,
51 .gpio
= SL_R7205_GPIO_BUTTON_WPS
,
56 static void __init
sl_r7205_init(void)
58 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO
<< RT305X_GPIO_MODE_UART0_SHIFT
);
60 rt305x_register_flash(0);
62 rt305x_esw_data
.vlan_config
= RT305X_ESW_VLAN_CONFIG_WLLLL
;
63 rt305x_register_ethernet();
64 ramips_register_gpio_leds(-1, ARRAY_SIZE(sl_r7205_leds_gpio
),
66 ramips_register_gpio_buttons(-1, SL_R7205_KEYS_POLL_INTERVAL
,
67 ARRAY_SIZE(sl_r7205_gpio_buttons
),
68 sl_r7205_gpio_buttons
);
69 rt305x_register_wifi();
70 rt305x_register_wdt();
71 rt305x_register_usb();
74 MIPS_MACHINE(RAMIPS_MACH_SL_R7205
, "SL-R7205",
75 "Skyline SL-R7205 Wireless 3G Router",