2 * Sparklan WCR-150GN board support
4 * Copyright (C) 2010 Roman Yeryomin <roman@advem.lv>
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 WCR150GN_GPIO_LED_USER 12
23 #define WCR150GN_GPIO_LED_POWER 8
24 #define WCR150GN_GPIO_BUTTON_WPS 10
25 #define WCR150GN_GPIO_BUTTON_RESET 0
26 #define WCR150GN_KEYS_POLL_INTERVAL 20
27 #define WCR150GN_KEYS_DEBOUNCE_INTERVAL (3 * WCR150GN_KEYS_POLL_INTERVAL)
29 static struct gpio_led wcr150gn_leds_gpio
[] __initdata
= {
31 .name
= "wcr150gn:amber:user",
32 .gpio
= WCR150GN_GPIO_LED_USER
,
36 .name
= "wcr150gn:amber:power",
37 .gpio
= WCR150GN_GPIO_LED_POWER
,
42 static struct gpio_keys_button wcr150gn_gpio_buttons
[] __initdata
= {
46 .code
= KEY_WPS_BUTTON
,
47 .debounce_interval
= WCR150GN_KEYS_DEBOUNCE_INTERVAL
,
48 .gpio
= WCR150GN_GPIO_BUTTON_WPS
,
55 .debounce_interval
= WCR150GN_KEYS_DEBOUNCE_INTERVAL
,
56 .gpio
= WCR150GN_GPIO_BUTTON_RESET
,
61 static void __init
wcr150gn_init(void)
63 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO
<< RT305X_GPIO_MODE_UART0_SHIFT
);
65 rt305x_register_flash(0);
67 ramips_register_gpio_leds(-1, ARRAY_SIZE(wcr150gn_leds_gpio
),
69 ramips_register_gpio_buttons(-1, WCR150GN_KEYS_POLL_INTERVAL
,
70 ARRAY_SIZE(wcr150gn_gpio_buttons
),
71 wcr150gn_gpio_buttons
);
72 rt305x_esw_data
.vlan_config
= RT305X_ESW_VLAN_CONFIG_LLLLW
;
73 rt305x_register_ethernet();
74 rt305x_register_wifi();
75 rt305x_register_wdt();
76 rt305x_register_usb();
79 MIPS_MACHINE(RAMIPS_MACH_WCR150GN
, "WCR150GN", "Sparklan WCR-150GN",