]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: tiny: use nvmem for engenius devices
authorRosen Penev <rosenp@gmail.com>
Fri, 12 Sep 2025 03:27:51 +0000 (20:27 -0700)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 26 Sep 2025 22:43:16 +0000 (00:43 +0200)
Userspace handling is deprecated.

Also convert custom LED to one handled by ath9k.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20112
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index 11e9c6853fd4aa8555b072bdea5ea21b160f1aba..18f29838ac489a07784de8b55e3be040a5e64716 100644 (file)
                        gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
                };
        };
-
-       ath9k-leds {
-               compatible = "gpio-leds";
-
-               wlan {
-                       function = LED_FUNCTION_WLAN;
-                       color = <LED_COLOR_ID_GREEN>;
-                       gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "phy0tpt";
-               };
-       };
 };
 
 &eth0 {
 &pcie {
        status = "okay";
 
-       ath9k: wifi@0,0 {
+       wifi@0,0 {
                compatible = "pci168c,002a";
                reg = <0x0000 0 0 0 0>;
-               qca,no-eeprom;
-               #gpio-cells = <2>;
-               gpio-controller;
+               nvmem-cells = <&cal_art_1000>;
+               nvmem-cell-names = "calibration";
+
+               led {
+                       led-sources = <1>;
+                       led-active-low;
+               };
        };
 };
 
                macaddr_art_0: macaddr@0 {
                        reg = <0x0 0x6>;
                };
+
+               cal_art_1000: calibration@1000 {
+                       reg = <0x1000 0xeb8>;
+               };
        };
 };
index 4c618956ac7ef81faf676615e17e34765a5aba51..08ffd69042c3ec4864ef1f88e9cc583b64bd2404 100644 (file)
                        default-state = "on";
                };
        };
-
-       ath9k-leds {
-               compatible = "gpio-leds";
-
-               wlan {
-                       function = LED_FUNCTION_WLAN;
-                       color = <LED_COLOR_ID_BLUE>;
-                       gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "phy0tpt";
-               };
-       };
 };
 
 &mdio0 {
 &pcie {
        status = "okay";
 
-       ath9k: wifi@0,0 {
+       wifi@0,0 {
                compatible = "pci168c,002a";
                reg = <0x0 0 0 0 0>;
-               nvmem-cells = <&macaddr_art_0 1>;
-               nvmem-cell-names = "mac-address";
-               qca,no-eeprom;
-               #gpio-cells = <2>;
-               gpio-controller;
+               nvmem-cells = <&cal_art_1000>, <&macaddr_art_0 1>;
+               nvmem-cell-names = "calibration", "mac-address";
+
+               led {
+                       led-sources = <1>;
+                       led-active-low;
+               };
        };
 };
 
                        reg = <0x0 0x6>;
                        #nvmem-cell-cells = <1>;
                };
+
+               cal_art_1000: calibration@1000 {
+                       reg = <0x1000 0xeb8>;
+               };
        };
 };
index 024cce6f0f4e2605a20945f7d2238561b20ada4e..13d8d3351129a7df6f6d4bf495b61c683ae324f4 100644 (file)
                        default-state = "on";
                };
        };
-
-       ath9k-leds {
-               compatible = "gpio-leds";
-
-               wlan {
-                       function = LED_FUNCTION_WLAN;
-                       color = <LED_COLOR_ID_GREEN>;
-                       gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "phy0tpt";
-               };
-       };
 };
 
 &mdio0 {
        ath9k: wifi@0,0 {
                compatible = "pci168c,002a";
                reg = <0x0 0 0 0 0>;
-               nvmem-cells = <&macaddr_art_0 (-1)>;
-               nvmem-cell-names = "mac-address";
-               qca,no-eeprom;
-               #gpio-cells = <2>;
-               gpio-controller;
+               nvmem-cells = <&cal_art_1000>, <&macaddr_art_0 (-1)>;
+               nvmem-cell-names = "calibration", "mac-address";
+
+               led {
+                       led-sources = <1>;
+                       led-active-low;
+               };
        };
 };
 
                        reg = <0x0 0x6>;
                        #nvmem-cell-cells = <1>;
                };
+
+               cal_art_1000: calibration@1000 {
+                       reg = <0x1000 0xeb8>;
+               };
        };
 };
index ccbaafda72db2dc58565cdfa1dc7b80a69594c87..5e9ff10eba8599b31f553e2edaf053b7814c49b5 100644 (file)
@@ -9,11 +9,6 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath9k-eeprom-pci-0000:00:00.0.bin")
        case $board in
-       engenius,eap350-v1|\
-       engenius,ecb350-v1|\
-       engenius,enh202-v1)
-               caldata_extract "art" 0x1000 0xeb8
-               ;;
        netgear,wnr2000-v3|\
        ubnt,airrouter|\
        ubnt,bullet-m-ar7240|\