Skip to content

Commit 6b96130

Browse files
nehebhauke
authored andcommitted
ath79: moxa,awk-1137c: use nvmem for calibration
Userspace handling is deprecated. Use led-sources for simplicity. Signed-off-by: Rosen Penev <[email protected]> Link: openwrt/openwrt#21026 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 26ff8ef commit 6b96130

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,18 @@
4848
};
4949

5050
led-2 {
51-
color = <LED_COLOR_ID_GREEN>;
52-
function = LED_FUNCTION_WLAN;
53-
function-enumerator = <0>;
54-
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
55-
linux,default-trigger = "phy0tpt";
56-
};
57-
58-
led-3 {
5951
color = <LED_COLOR_ID_GREEN>;
6052
function = LED_FUNCTION_WAN;
6153
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
6254
};
6355

64-
led-4 {
56+
led-3 {
6557
color = <LED_COLOR_ID_GREEN>;
6658
function = LED_FUNCTION_LAN;
6759
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
6860
};
6961

70-
led-5 {
62+
led-4 {
7163
color = <LED_COLOR_ID_YELLOW>;
7264
function = LED_FUNCTION_WLAN;
7365
function-enumerator = <1>;
@@ -157,6 +149,16 @@
157149
label = "art";
158150
reg = <0xfe0000 0x010000>;
159151
read-only;
152+
153+
nvmem-layout {
154+
compatible = "fixed-layout";
155+
#address-cells = <1>;
156+
#size-cells = <1>;
157+
158+
cal_art_1000: calibration@1000 {
159+
reg = <0x1000 0x440>;
160+
};
161+
};
160162
};
161163

162164
partition@ff0000 {
@@ -174,5 +176,12 @@
174176

175177
&wmac {
176178
status = "okay";
177-
qca,no-eeprom;
179+
180+
nvmem-cells = <&cal_art_1000>;
181+
nvmem-cell-names = "calibration";
182+
183+
led {
184+
led-sources = <12>;
185+
led-active-low;
186+
};
178187
};

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ case "$FIRMWARE" in
1515
avm,fritzdvbc)
1616
caldata_extract_reverse "urlader" 0x1541 0x440
1717
;;
18-
moxa,awk-1137c)
19-
caldata_extract "art" 0x1000 0x440
20-
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
21-
;;
2218
*)
2319
caldata_die "board $board is not supported yet"
2420
;;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ case "$board" in
8080
# which would allow to patch the macaddress
8181
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" $PHYNBR > /sys${DEVPATH}/macaddress
8282
;;
83+
moxa,awk-1137c)
84+
[ "$PHYNBR" -eq 0 ] && \
85+
mtd_get_mac_ascii u-boot-env mac_addr > /sys${DEVPATH}/macaddress
86+
;;
8387
dlink,dir-842-c1|\
8488
dlink,dir-842-c2|\
8589
dlink,dir-842-c3|\

0 commit comments

Comments
 (0)