ramips: add sysupgrade and status LED support for HW550-3G
authorGabor Juhos <juhosg@openwrt.org>
Sun, 27 Mar 2011 19:19:40 +0000 (19:19 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 27 Mar 2011 19:19:40 +0000 (19:19 +0000)
This patch adds sysupgrade and status LED support for the Aztech
HW550-3G. Some LED GPIOs were changed for clarity.

Signed-off-by: Layne Edwards <ledwards76@gmail.com>
SVN-Revision: 26320

target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-hw550-3g.c

index c69cb9e1c4c76713c2be55fdb55fb1b16630436f..051c884de1dd76879fa0414d31066e45b2e8b743 100755 (executable)
@@ -42,7 +42,10 @@ get_status_led() {
        whr-g300n)
                status_led="whr-g300n:red:diag"
                ;;
-       esac;
+       hw550-3g)
+               status_led="hw550-3g:green:status"
+               ;;
+       esac
 }
 
 set_state() {
index d0094286b5389aeef62929deb4187439a66d5153..bf8a9865bed9fc7864dc3f839ce32861d567406c 100755 (executable)
@@ -14,7 +14,7 @@ platform_check_image() {
        [ "$ARGC" -gt 1 ] && return 1
 
        case "$board" in
-       dir-300-b1 | fonera20n | v22rw-2x2 | whr-g300n)
+       dir-300-b1 | fonera20n | v22rw-2x2 | whr-g300n | hw550-3g)
                [ "$magic" != "2705" ] && {
                        echo "Invalid image type."
                        return 1
index ffb209456a2435221b8266e70ae2b67ab4cd7a56..3770760fdcb00289973b6fd933c1718b9d7474a6 100644 (file)
 #include "devices.h"
 
 #define HW550_3G_GPIO_LED_USB          8
-#define HW550_3G_GPIO_LED_3G_STAT      11
-#define HW550_3G_GPIO_LED_3G_TOGGLE    12
+#define HW550_3G_GPIO_LED_3G           11
+#define HW550_3G_GPIO_LED_STATUS       12
 #define HW550_3G_GPIO_LED_WPS          14
 
 #define HW550_3G_GPIO_BUTTON_RESET     10
-#define HW550_3G_GPIO_BUTTON_3G                7
+#define HW550_3G_GPIO_BUTTON_CONNECT   7
 #define HW550_3G_GPIO_BUTTON_WPS       0
 
 #define HW550_3G_BUTTONS_POLL_INTERVAL 20
@@ -83,12 +83,12 @@ static struct gpio_led hw550_3g_leds_gpio[] __initdata = {
                .gpio           = HW550_3G_GPIO_LED_USB,
                .active_low     = 1,
        }, {
-               .name           = "hw550-3g:green:3g-stat",
-               .gpio           = HW550_3G_GPIO_LED_3G_STAT,
+               .name           = "hw550-3g:green:3g",
+               .gpio           = HW550_3G_GPIO_LED_3G,
                .active_low     = 1,
        }, {
-               .name           = "hw550-3g:green:3g-toggle",
-               .gpio           = HW550_3G_GPIO_LED_3G_TOGGLE,
+               .name           = "hw550-3g:green:status",
+               .gpio           = HW550_3G_GPIO_LED_STATUS,
                .active_low     = 1,
        }, {
                .name           = "hw550-3g:green:wps",
@@ -106,11 +106,11 @@ static struct gpio_button hw550_3g_gpio_buttons[] __initdata = {
                .gpio           = HW550_3G_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
-               .desc           = "3g",
+               .desc           = "connect",
                .type           = EV_KEY,
-               .code           = BTN_1,
+               .code           = KEY_CONNECT,
                .threshold      = 3,
-               .gpio           = HW550_3G_GPIO_BUTTON_3G,
+               .gpio           = HW550_3G_GPIO_BUTTON_CONNECT,
                .active_low     = 1,
        }, {
                .desc           = "wps",