ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_bdcom_wap2100-sk.dts
index 878c720c3910a6bc990371e0bd9dfbf6f3e804ac..8652d6573c8973892242a5925fd57cbe76f0d362 100644 (file)
@@ -1,10 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
 
 #include "mt7620a.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        compatible = "bdcom,wap2100-sk", "ralink,mt7620a-soc";
                compatible = "gpio-leds";
 
                usb {
-                       label = "wap2100-sk:green:usb";
+                       function = LED_FUNCTION_USB;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&ohci_port1>, <&ehci_port1>;
                        linux,default-trigger = "usbport";
                };
 
                led_power: wps {
-                       label = "wap2100-sk:green:wps";
+                       function = LED_FUNCTION_WPS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
                };
 
                wlan2g {
-                       label = "wap2100-sk:green:wlan2g";
+                       label = "green:wlan2g";
                        gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
                };
        };
                                label = "factory";
                                reg = <0x40000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x200>;
+                                       };
+
+                                       eeprom_factory_8000: eeprom@8000 {
+                                               reg = <0x8000 0x200>;
+                                       };
+
+                                       macaddr_factory_4: macaddr@4 {
+                                               reg = <0x4 0x6>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
        };
 };
 
-&gpio0 {
-       status = "okay";
-};
-
 &gpio1 {
        status = "okay";
 };
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "llllw";
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+
+       mediatek,portmap = "wllll";
 };
 
 &wmac {
-       ralink,mtd-eeprom = <&factory 0x0>;
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
 };
 
 &pcie {
 &pcie0 {
        wifi@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x8000>;
+               nvmem-cells = <&eeprom_factory_8000>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <5000000 6000000>;
        };
 };