2 * Aztech HW550-3G board support
4 * Copyright (C) 2011 Layne Edwards <ledwards76@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 HW550_3G_GPIO_LED_USB 8
23 #define HW550_3G_GPIO_LED_3G 11
24 #define HW550_3G_GPIO_LED_STATUS 12
25 #define HW550_3G_GPIO_LED_WPS 14
27 #define HW550_3G_GPIO_BUTTON_RESET 10
28 #define HW550_3G_GPIO_BUTTON_CONNECT 7
29 #define HW550_3G_GPIO_BUTTON_WPS 0
31 #define HW550_3G_KEYS_POLL_INTERVAL 20
32 #define HW550_3G_KEYS_DEBOUNCE_INTERVAL (3 * HW550_3G_KEYS_POLL_INTERVAL)
34 static struct gpio_led hw550_3g_leds_gpio
[] __initdata
= {
36 .name
= "hw550-3g:green:usb",
37 .gpio
= HW550_3G_GPIO_LED_USB
,
40 .name
= "hw550-3g:green:3g",
41 .gpio
= HW550_3G_GPIO_LED_3G
,
44 .name
= "hw550-3g:green:status",
45 .gpio
= HW550_3G_GPIO_LED_STATUS
,
48 .name
= "hw550-3g:green:wps",
49 .gpio
= HW550_3G_GPIO_LED_WPS
,
54 static struct gpio_keys_button hw550_3g_gpio_buttons
[] __initdata
= {
59 .debounce_interval
= HW550_3G_KEYS_DEBOUNCE_INTERVAL
,
60 .gpio
= HW550_3G_GPIO_BUTTON_RESET
,
66 .debounce_interval
= HW550_3G_KEYS_DEBOUNCE_INTERVAL
,
67 .gpio
= HW550_3G_GPIO_BUTTON_CONNECT
,
72 .code
= KEY_WPS_BUTTON
,
73 .debounce_interval
= HW550_3G_KEYS_DEBOUNCE_INTERVAL
,
74 .gpio
= HW550_3G_GPIO_BUTTON_WPS
,
79 #define HW550_3G_GPIO_MODE \
80 ((RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT) | \
81 RT305X_GPIO_MODE_MDIO)
83 static void __init
hw550_3g_init(void)
85 rt305x_gpio_init(HW550_3G_GPIO_MODE
);
87 rt305x_register_flash(0);
89 rt305x_esw_data
.vlan_config
= RT305X_ESW_VLAN_CONFIG_WLLLL
;
90 rt305x_register_ethernet();
91 ramips_register_gpio_leds(-1, ARRAY_SIZE(hw550_3g_leds_gpio
),
93 ramips_register_gpio_buttons(-1, HW550_3G_KEYS_POLL_INTERVAL
,
94 ARRAY_SIZE(hw550_3g_gpio_buttons
),
95 hw550_3g_gpio_buttons
);
96 rt305x_register_wifi();
97 rt305x_register_wdt();
98 rt305x_register_usb();
101 MIPS_MACHINE(RAMIPS_MACH_HW550_3G
, "HW550-3G", "Aztech HW550-3G",