Skip to content

Commit a1f5273

Browse files
InsaneKnightrobimarko
authored andcommitted
mac80211: ath9k: patch hw.c for gpio mask from dt
"qca,gpio-mask" used to be read between ath9k_hw_init() and ath9k_init_queues(). After 12913c3 it is read in ath9k_of_init(), but it gets overwritten by ath9k_gpio_cap_init() during the call of ath9k_hw_init(), and causes openwrt#22340 If keeping the most of 12913c3, ath9k_gpio_cap_init() could be patched to keep the existing non-zero gpio mask (coming from device tree). Tested on Netgear WNDR4500 v3: [ 22.558083] ath9k 0000:00:00.0: enabling device (0000 -> 0002) [ 22.569548] ath: phy1: Use overridden gpio mask 0xf6ff Signed-off-by: Edward Chow <equu@openmail.cc> Link: openwrt#22376 Signed-off-by: Robert Marko <robimarko@gmail.com>
1 parent 44d06e3 commit a1f5273

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

package/kernel/mac80211/patches/ath9k/550-ath9k-of.patch

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,26 @@
164164
return 0;
165165
}
166166

167+
--- a/drivers/net/wireless/ath/ath9k/hw.c
168+
+++ b/drivers/net/wireless/ath/ath9k/hw.c
169+
@@ -2429,6 +2429,7 @@ static bool ath9k_hw_dfs_tested(struct ath_hw *ah)
170+
static void ath9k_gpio_cap_init(struct ath_hw *ah)
171+
{
172+
struct ath9k_hw_capabilities *pCap = &ah->caps;
173+
+ u32 gpio_mask = pCap->gpio_mask;
174+
175+
if (AR_SREV_9271(ah)) {
176+
pCap->num_gpio_pins = AR9271_NUM_GPIO;
177+
@@ -2479,6 +2480,12 @@ static void ath9k_gpio_cap_init(struct ath_hw *ah)
178+
pCap->num_gpio_pins = AR_NUM_GPIO;
179+
pCap->gpio_mask = AR_GPIO_MASK;
180+
}
181+
+
182+
+ if (gpio_mask) {
183+
+ pCap->gpio_mask = gpio_mask;
184+
+ ath_info(ath9k_hw_common(ah), "Use overridden gpio mask 0x%x\n",
185+
+ gpio_mask);
186+
+ }
187+
}
188+
189+
int ath9k_hw_fill_cap_info(struct ath_hw *ah)

0 commit comments

Comments
 (0)