Revert some brain damage.  The rx and tx LEDs on the eval board are
not connected to the CPU, but to the FTDI chip instead.  Therefore,
they are not and cannot be under GPIO control.  The LINK_0, LINK_1
LEDs are configured to be driven by the switch, and are not under GPIO
control either, though they could be pinmux'd that way if needed.  The
WLAN LED is driven by the radio phy.  Removes the completely
fictitious ld1 and ld2 from AWM002.dtsi.

Renames the remaining LED to a more generic "asiarf", rather than the
module name, because it is on the eval board and not on either of the
AWM002 or AWM003.

Renamed the "reset_wps" button to just "reset", since it does not in
practice function as a WPS button.

This patch adds support for a "mode" event associated with the slider
switch on the eval board, through the gpio-button-hotplug
infrastructure.

It also enables GPIO control of the second GPIO controller, in
rt5350.dtsi, but does not use it.

Signed-off-by: Russell Senior <russ...@personaltelco.net>
---
 .../gpio-button-hotplug/src/gpio-button-hotplug.c      |  1 +
 target/linux/ramips/base-files/etc/board.d/01_leds     |  4 +++-
 target/linux/ramips/dts/AWM002-EVB-4M.dts              | 18 +++++-------------
 target/linux/ramips/dts/AWM002-EVB-8M.dts              | 18 +++++-------------
 target/linux/ramips/dts/AWM002.dtsi                    | 12 ------------
 target/linux/ramips/dts/AWM003-EVB.dts                 | 18 +++++-------------
 target/linux/ramips/dts/rt5350.dtsi                    |  2 --
 7 files changed, 19 insertions(+), 54 deletions(-)

diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c 
b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index c997e35..891dd96 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -97,6 +97,7 @@ static struct bh_map button_map[] = {
        BH_MAP(KEY_RFKILL,      "rfkill"),
        BH_MAP(KEY_WPS_BUTTON,  "wps"),
        BH_MAP(KEY_WIMAX,       "wwan"),
+       BH_MAP(BTN_MODE,        "mode"),
 };
 
 /* -------------------------------------------------------------------------*/
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 01e2363..906769e 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -38,7 +38,9 @@ case $board in
                ucidef_set_led_rssi "rssihigh" "RSSIHIGH" 
"all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
                set_wifi_led "rt2800pci-phy0::radio"
                ;;
-       awapn2403)
+       awapn2403|\
+       awm002-evb|\
+       awm003-evb)
                set_wifi_led "rt2800soc-phy0::radio"
                ;;
        ar725w)
diff --git a/target/linux/ramips/dts/AWM002-EVB-4M.dts 
b/target/linux/ramips/dts/AWM002-EVB-4M.dts
index 0738f04..77621dc 100644
--- a/target/linux/ramips/dts/AWM002-EVB-4M.dts
+++ b/target/linux/ramips/dts/AWM002-EVB-4M.dts
@@ -15,17 +15,9 @@
 
        gpio-leds {
                compatible = "gpio-leds";
-               tx {
-                       label = "awm002-evb:green:tx";
-                       gpios = <&gpio0 15 1>;
-               };
-               rx {
-                       label = "awm002-evb:green:rx";
-                       gpios = <&gpio0 16 1>;
-               };
                wps {
-                       label = "awm002-evb:green:wps";
-                       gpios = <&gpio0 21 1>;
+                       label = "asiarf-evb:green:wps";
+                       gpios = <&gpio0 21 0>;
                };
        };
 
@@ -34,15 +26,15 @@
                #address-cells = <1>;
                #size-cells = <0>;
                poll-interval = <20>;
-               reset_wps {
-                       label = "reset_wps";
+               reset {
+                       label = "reset";
                        gpios = <&gpio0 0 1>;
                        linux,code = <0x198>;
                };
                mode {
                        label = "mode";
                        gpios = <&gpio0 20 1>;
-                       linux,code = <0x32>;
+                       linux,code = <0x13c>;
                };
        };
 };
diff --git a/target/linux/ramips/dts/AWM002-EVB-8M.dts 
b/target/linux/ramips/dts/AWM002-EVB-8M.dts
index ebc4085..a5a5e84 100644
--- a/target/linux/ramips/dts/AWM002-EVB-8M.dts
+++ b/target/linux/ramips/dts/AWM002-EVB-8M.dts
@@ -15,17 +15,9 @@
 
        gpio-leds {
                compatible = "gpio-leds";
-               tx {
-                       label = "awm002-evb:green:tx";
-                       gpios = <&gpio0 15 1>;
-               };
-               rx {
-                       label = "awm002-evb:green:rx";
-                       gpios = <&gpio0 16 1>;
-               };
                wps {
-                       label = "awm002-evb:green:wps";
-                       gpios = <&gpio0 21 1>;
+                       label = "asiarf-evb:green:wps";
+                       gpios = <&gpio0 21 0>;
                };
        };
 
@@ -34,15 +26,15 @@
                #address-cells = <1>;
                #size-cells = <0>;
                poll-interval = <20>;
-               reset_wps {
-                       label = "reset_wps";
+               reset {
+                       label = "reset";
                        gpios = <&gpio0 0 1>;
                        linux,code = <0x198>;
                };
                mode {
                        label = "mode";
                        gpios = <&gpio0 20 1>;
-                       linux,code = <0x32>;
+                       linux,code = <0x13c>;
                };
        };
 };
diff --git a/target/linux/ramips/dts/AWM002.dtsi 
b/target/linux/ramips/dts/AWM002.dtsi
index e1579b5..5566d16 100644
--- a/target/linux/ramips/dts/AWM002.dtsi
+++ b/target/linux/ramips/dts/AWM002.dtsi
@@ -59,16 +59,4 @@
        ohci@101c1000 {
                status = "okay";
        };
-
-       gpio-leds {
-               compatible = "gpio-leds";
-               ld1 {
-                       label = "asiarf:green:ld1";
-                       gpios = <&gpio0 0 1>;
-               };
-               ld2 {
-                       label = "asiarf:green:ld2";
-                       gpios = <&gpio0 1 1>;
-               };
-       };
 };
diff --git a/target/linux/ramips/dts/AWM003-EVB.dts 
b/target/linux/ramips/dts/AWM003-EVB.dts
index 35d4886..2303858 100644
--- a/target/linux/ramips/dts/AWM003-EVB.dts
+++ b/target/linux/ramips/dts/AWM003-EVB.dts
@@ -30,17 +30,9 @@
 
        gpio-leds {
                compatible = "gpio-leds";
-               tx {
-                       label = "awm002-evb:green:tx";
-                       gpios = <&gpio0 15 1>;
-               };
-               rx {
-                       label = "awm002-evb:green:rx";
-                       gpios = <&gpio0 16 1>;
-               };
                wps {
-                       label = "awm002-evb:green:wps";
-                       gpios = <&gpio0 21 1>;
+                       label = "asiarf-evb:green:wps";
+                       gpios = <&gpio0 21 0>;
                };
        };
 
@@ -49,15 +41,15 @@
                #address-cells = <1>;
                #size-cells = <0>;
                poll-interval = <20>;
-               reset_wps {
-                       label = "reset_wps";
+               reset {
+                       label = "reset";
                        gpios = <&gpio0 0 1>;
                        linux,code = <0x198>;
                };
                mode {
                        label = "mode";
                        gpios = <&gpio0 20 1>;
-                       linux,code = <0x32>;
+                       linux,code = <0x13c>;
                };
        };
 };
diff --git a/target/linux/ramips/dts/rt5350.dtsi 
b/target/linux/ramips/dts/rt5350.dtsi
index 8ba20bb..0d7ff8e 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -130,8 +130,6 @@
                        ralink,register-map = [ 00 04 08 0c
                                                10 14 18 1c
                                                20 24 ];
-
-                       status = "disabled";
                };
 
                i2c@900 {
-- 
2.0.0


-- 
Russell Senior, President
russ...@personaltelco.net
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to