ramips: set usb led trigger via devicetree
[openwrt/staging/lynxis.git] / target / linux / ramips / dts / kng_rc.dts
index fefa1b7d8da7e726c24897070f68191c9303877f..325522ec90374a514c13bb2434c9d3fcbf85b085 100644 (file)
@@ -6,8 +6,13 @@
 #include <dt-bindings/input/input.h>
 
 / {
+       compatible = "zyxel,keenetic-viva", "ralink,mt7620a-soc";
        model = "ZyXEL Keenetic Viva";
 
+       aliases {
+               led-status = &led_power_green;
+       };
+
        gpio-leds {
                compatible = "gpio-leds";
 
@@ -19,6 +24,8 @@
                usb {
                        label = "kng_rc:green:usb";
                        gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+                       trigger-sources = <&ohci_port1>, <&ehci_port1>;
+                       linux,default-trigger = "usbport";
                };
 
                power_alert {
@@ -31,7 +38,7 @@
                        gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                };
 
-               power {
+               led_power_green: power {
                        label = "kng_rc:green:power";
                        gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
                };
@@ -39,8 +46,6 @@
 
        gpio-keys-polled {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <20>;
 
                reset {
                };
        };
 
+       gpio_export {
+               compatible = "gpio-export";
+               #size-cells = <0>;
+
+               usb_power {
+                       gpio-export,name = "usb";
+                       gpio-export,output = <1>;
+                       gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
        rtl8367rb {
                compatible = "realtek,rtl8367b";
                cpu_port = <7>;
                realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
-               mdio = <&mdio0>;
+               mii-bus = <&mdio0>;
        };
 };
 
        status = "okay";
 
        m25p80@0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
 
-               partition@0 {
-                       label = "u-boot";
-                       reg = <0x0 0x30000>;
-                       read-only;
-               };
-
-               partition@30000 {
-                       label = "u-boot-env";
-                       reg = <0x30000 0x10000>;
-                       read-only;
-               };
-
-               factory: partition@40000 {
-                       label = "factory";
-                       reg = <0x40000 0x10000>;
-                       read-only;
-               };
-
-               partition@50000 {
-                       label = "firmware";
-                       reg = <0x50000 0xfb0000>;
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@50000 {
+                               label = "firmware";
+                               reg = <0x50000 0xfb0000>;
+                       };
                };
        };
 };