2 * Argus ATP-52B router support
3 * http://www.argus-co.com/english/productsview.php?id=70&cid=81
5 * Copyright (C) 2011 Roman Yeryomin <roman@advem.lv>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
15 #include <asm/mach-ralink/machine.h>
16 #include <asm/mach-ralink/dev-gpio-buttons.h>
17 #include <asm/mach-ralink/dev-gpio-leds.h>
18 #include <asm/mach-ralink/rt305x.h>
19 #include <asm/mach-ralink/rt305x_regs.h>
23 #define ARGUS_ATP52B_GPIO_LED_RUN 9
24 #define ARGUS_ATP52B_GPIO_LED_NET 13
25 #define ARGUS_ATP52B_GPIO_BUTTON_WPS 0
26 #define ARGUS_ATP52B_GPIO_BUTTON_RESET 10
27 #define ARGUS_ATP52B_KEYS_POLL_INTERVAL 20
28 #define ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL (3 * ARGUS_ATP52B_KEYS_POLL_INTERVAL)
30 static struct gpio_led argus_atp52b_leds_gpio
[] __initdata
= {
32 .name
= "argus-atp52b:green:run",
33 .gpio
= ARGUS_ATP52B_GPIO_LED_RUN
,
37 .name
= "argus-atp52b:amber:net",
38 .gpio
= ARGUS_ATP52B_GPIO_LED_NET
,
43 static struct gpio_keys_button argus_atp52b_gpio_buttons
[] __initdata
= {
47 .code
= KEY_WPS_BUTTON
,
48 .debounce_interval
= ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL
,
49 .gpio
= ARGUS_ATP52B_GPIO_BUTTON_WPS
,
56 .debounce_interval
= ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL
,
57 .gpio
= ARGUS_ATP52B_GPIO_BUTTON_RESET
,
62 static void __init
argus_atp52b_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(argus_atp52b_leds_gpio
),
69 argus_atp52b_leds_gpio
);
70 ramips_register_gpio_buttons(-1, ARGUS_ATP52B_KEYS_POLL_INTERVAL
,
71 ARRAY_SIZE(argus_atp52b_gpio_buttons
),
72 argus_atp52b_gpio_buttons
);
73 rt305x_esw_data
.vlan_config
= RT305X_ESW_VLAN_CONFIG_WLLLL
;
74 rt305x_register_ethernet();
75 rt305x_register_wifi();
76 rt305x_register_wdt();
77 rt305x_register_usb();
80 MIPS_MACHINE(RAMIPS_MACH_ARGUS_ATP52B
, "ARGUS_ATP52B", "Argus ATP-52B",