1 --- a/drivers/net/wireless/ath/ath9k/debug.c
2 +++ b/drivers/net/wireless/ath/ath9k/debug.c
3 @@ -920,6 +920,12 @@ int ath9k_init_debug(struct ath_hw *ah)
4 sc->debug.debugfs_phy, &ah->config.cwm_ignore_extcca))
7 + debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
8 + sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
10 + debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
11 + sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
16 --- a/drivers/net/wireless/ath/ath9k/hw.h
17 +++ b/drivers/net/wireless/ath/ath9k/hw.h
18 @@ -743,6 +743,8 @@ struct ath_hw {
25 struct ar5416IniArray iniModes;
26 struct ar5416IniArray iniCommon;
27 --- a/drivers/net/wireless/ath/ath9k/hw.c
28 +++ b/drivers/net/wireless/ath/ath9k/hw.c
29 @@ -1178,6 +1178,20 @@ static bool ath9k_hw_channel_change(stru
33 +static void ath9k_hw_apply_gpio_override(struct ath_hw *ah)
35 + u32 gpio_mask = ah->gpio_mask;
38 + for (i = 0; gpio_mask; i++, gpio_mask >>= 1) {
39 + if (!(gpio_mask & 1))
42 + ath9k_hw_cfg_output(ah, i, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
43 + ath9k_hw_set_gpio(ah, i, !!(ah->gpio_val & BIT(i)));
47 bool ath9k_hw_check_alive(struct ath_hw *ah)
50 @@ -1464,6 +1478,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
51 if (AR_SREV_9300_20_OR_LATER(ah))
52 ar9003_hw_bb_watchdog_config(ah);
54 + ath9k_hw_apply_gpio_override(ah);
58 EXPORT_SYMBOL(ath9k_hw_reset);