Commit e34f2ff4 authored by Giedrius Statkevičius's avatar Giedrius Statkevičius Committed by Kalle Valo

ath9k: bring back direction setting in ath9k_{start_stop}

A regression was introduced in commit id 79d4db12 ("ath9k: cleanup
led_pin initial") that broken the WLAN status led on my laptop with
AR9287 after suspending and resuming.

Steps to reproduce:
* Suspend (laptop)
* Resume (laptop)
* Observe that the WLAN led no longer turns ON/OFF depending on the
  status and is always red

Even though for my case it only needs to be set to OUT in ath9k_start
but for consistency bring back the IN direction setting as well.

Fixes: 79d4db12 ("ath9k: cleanup led_pin initial")
Cc: Miaoqing Pan <miaoqing@codeaurora.org>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: <stable@vger.kernel.org> # 4.7+
Link: https://bugzilla.kernel.org/show_bug.cgi?id=151711Signed-off-by: default avatarGiedrius Statkevičius <giedrius.statkevicius@gmail.com>
[kvalo@qca.qualcomm.com: improve commit log]
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent db7b542e
...@@ -718,9 +718,12 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -718,9 +718,12 @@ static int ath9k_start(struct ieee80211_hw *hw)
if (!ath_complete_reset(sc, false)) if (!ath_complete_reset(sc, false))
ah->reset_power_on = false; ah->reset_power_on = false;
if (ah->led_pin >= 0) if (ah->led_pin >= 0) {
ath9k_hw_set_gpio(ah, ah->led_pin, ath9k_hw_set_gpio(ah, ah->led_pin,
(ah->config.led_active_high) ? 1 : 0); (ah->config.led_active_high) ? 1 : 0);
ath9k_hw_gpio_request_out(ah, ah->led_pin, NULL,
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
}
/* /*
* Reset key cache to sane defaults (all entries cleared) instead of * Reset key cache to sane defaults (all entries cleared) instead of
...@@ -864,9 +867,11 @@ static void ath9k_stop(struct ieee80211_hw *hw) ...@@ -864,9 +867,11 @@ static void ath9k_stop(struct ieee80211_hw *hw)
spin_lock_bh(&sc->sc_pcu_lock); spin_lock_bh(&sc->sc_pcu_lock);
if (ah->led_pin >= 0) if (ah->led_pin >= 0) {
ath9k_hw_set_gpio(ah, ah->led_pin, ath9k_hw_set_gpio(ah, ah->led_pin,
(ah->config.led_active_high) ? 0 : 1); (ah->config.led_active_high) ? 0 : 1);
ath9k_hw_gpio_request_in(ah, ah->led_pin, NULL);
}
ath_prepare_reset(sc); ath_prepare_reset(sc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment