2 * Prolink PWH2004 support (or Abocom WR5205)
4 * Copyright (C) 2010 Esa Hyytia <esa@netlab.tkk.fi>
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 PWH2004_GPIO_BUTTON_WPS 12
23 #define PWH2004_GPIO_LED_POWER 9
24 #define PWH2004_GPIO_LED_WIFI 14
25 #define PWH2004_KEYS_POLL_INTERVAL 20
26 #define PWH2004_KEYS_DEBOUNCE_INTERVAL (3 * PWH2004_KEYS_POLL_INTERVAL)
28 static struct gpio_led pwh2004_leds_gpio
[] __initdata
= {
30 .name
= "pwh2004:red:wifi",
31 .gpio
= PWH2004_GPIO_LED_WIFI
,
34 .name
= "pwh2004:green:power",
35 .gpio
= PWH2004_GPIO_LED_POWER
,
40 static struct gpio_keys_button pwh2004_gpio_buttons
[] __initdata
= {
45 .debounce_interval
= PWH2004_KEYS_DEBOUNCE_INTERVAL
,
46 .gpio
= PWH2004_GPIO_BUTTON_WPS
,
51 static void __init
pwh2004_init(void)
53 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO
<< RT305X_GPIO_MODE_UART0_SHIFT
);
55 rt305x_register_flash(0);
57 ramips_register_gpio_leds(-1, ARRAY_SIZE(pwh2004_leds_gpio
),
59 ramips_register_gpio_buttons(-1, PWH2004_KEYS_POLL_INTERVAL
,
60 ARRAY_SIZE(pwh2004_gpio_buttons
),
61 pwh2004_gpio_buttons
);
62 rt305x_esw_data
.vlan_config
= RT305X_ESW_VLAN_CONFIG_LLLLW
;
63 rt305x_register_ethernet();
64 rt305x_register_wifi();
65 rt305x_register_wdt();
68 MIPS_MACHINE(RAMIPS_MACH_PWH2004
, "PWH2004", "Prolink PWH2004",