mips: bmips: add Huawei HG556a gpio-leds
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Sun, 7 May 2017 18:09:34 +0000 (20:09 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 10 May 2017 14:16:09 +0000 (16:16 +0200)
This board has several LEDs attached to gpio0.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/mips/dts/huawei,hg556a.dts
configs/huawei_hg556a_ram_defconfig

index 6775909a03e508ab85bef0213deed126c22e1946..31c7d7ed5ce5c1c286a331b772db0cd169709212 100644 (file)
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               message_red {
+                       label = "HG556a:red:message";
+                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+               };
+
+               hspa_red {
+                       label = "HG556a:red:hspa";
+                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+               };
+
+               dsl_red {
+                       label = "HG556a:red:dsl";
+                       gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+               };
+
+               power_red {
+                       label = "HG556a:red:power";
+                       gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+               };
+
+               all_red {
+                       label = "HG556a:red:all";
+                       gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+               };
+
+               lan1_green {
+                       label = "HG556a:green:lan1";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+               };
+
+               lan1_red {
+                       label = "HG556a:red:lan1";
+                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+               };
+
+               lan2_green {
+                       label = "HG556a:green:lan2";
+                       gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
+               };
+
+               lan2_red {
+                       label = "HG556a:red:lan2";
+                       gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
+               };
+
+               lan3_green {
+                       label = "HG556a:green:lan3";
+                       gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
+               };
+
+               lan3_red {
+                       label = "HG556a:red:lan3";
+                       gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
+               };
+
+               lan4_green {
+                       label = "HG556a:green:lan4";
+                       gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
+               };
+
+               lan4_red {
+                       label = "HG556a:red:lan4";
+                       gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&gpio0 {
+       status = "okay";
 };
 
 &pflash {
index ca00c4d6756cdcc3a5380af4e650e70e1dff42f8..ccfdf1d60775c3249819d9af7846f412d5831d43 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARCH_BMIPS=y
 CONFIG_BAUDRATE=115200
+CONFIG_BCM6345_GPIO=y
 CONFIG_BCM6345_SERIAL=y
 CONFIG_BMIPS_BOOT_RAM=y
 CONFIG_BOARD_HUAWEI_HG556A=y
@@ -17,6 +18,7 @@ CONFIG_CMD_FLASH=y
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_LED=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_LOADB=y
 # CONFIG_CMD_LOADS is not set
@@ -32,6 +34,8 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
 CONFIG_MIPS=y
 # CONFIG_MIPS_BOOT_CMDLINE_LEGACY is not set
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set