Преглед изворни кода

ath79: dir-842: use nvmem

Userspace handling is deprecated.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/17344
Signed-off-by: Robert Marko <[email protected]>
Rosen Penev пре 1 година
родитељ
комит
dafc49b233

+ 17 - 8
target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi

@@ -44,13 +44,6 @@
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
 		};
-
-		wlan {
-			function = LED_FUNCTION_WLAN;
-			color = <LED_COLOR_ID_GREEN>;
-			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy0tpt";
-		};
 	};
 };
 
@@ -111,6 +104,16 @@
 				label = "art";
 				reg = <0xfd0000 0x010000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_art_1000: calibration@1000 {
+						reg = <0x1000 0x440>;
+					};
+				};
 			};
 
 			partition@fe0000 {
@@ -154,5 +157,11 @@
 &wmac {
 	status = "okay";
 
-	qca,no-eeprom;
+	nvmem-cells = <&cal_art_1000>;
+	nvmem-cell-names = "calibration";
+
+	led {
+		led-sources = <19>;
+		led-active-low;
+	};
 };

+ 0 - 3
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

@@ -24,9 +24,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
 		;;
-	dlink,dir-842-c1|\
-	dlink,dir-842-c2|\
-	dlink,dir-842-c3|\
 	wd,mynet-n600|\
 	wd,mynet-n750)
 		caldata_extract "art" 0x1000 0x440

+ 0 - 1
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata

@@ -14,7 +14,6 @@ case "$FIRMWARE" in
 	dlink,dir-842-c3)
 		caldata_extract "art" 0x5000 0x2f20
 		caldata_valid "202f" || caldata_extract "reserved" 0x15000 0x2f20
-		ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
 		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
 			/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
 		;;

+ 3 - 0
target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

@@ -92,6 +92,9 @@ case "$board" in
 		[ "$PHYNBR" -eq 0 ] && \
 			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
 		;;
+	dlink,dir-842-c1|\
+	dlink,dir-842-c2|\
+	dlink,dir-842-c3|\
 	nec,wf1200cr|\
 	nec,wg1200cr|\
 	qihoo,c301)