Skip to content

Commit

Permalink
ath9k/ath9k_htc: Fix PS wrappers for RF kill
Browse files Browse the repository at this point in the history
ath9k_hw_gpio_get reads the GPIO in/out registers to get the status of
GPIO pins, so use PS wrappers

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Mohammed Shafi Shajakhan authored and John W. Linville committed Sep 30, 2011
1 parent 3b9ce80 commit 9082631
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion drivers/net/wireless/ath/ath9k/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ void ath_init_leds(struct ath_softc *sc)
static bool ath_is_rfkill_set(struct ath_softc *sc)
{
struct ath_hw *ah = sc->sc_ah;
bool is_blocked;

return ath9k_hw_gpio_get(ah, ah->rfkill_gpio) ==
ath9k_ps_wakeup(sc);
is_blocked = ath9k_hw_gpio_get(ah, ah->rfkill_gpio) ==
ah->rfkill_polarity;
ath9k_ps_restore(sc);

return is_blocked;
}

void ath9k_rfkill_poll_state(struct ieee80211_hw *hw)
Expand Down
10 changes: 8 additions & 2 deletions drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,14 @@ void ath9k_init_leds(struct ath9k_htc_priv *priv)

static bool ath_is_rfkill_set(struct ath9k_htc_priv *priv)
{
return ath9k_hw_gpio_get(priv->ah, priv->ah->rfkill_gpio) ==
priv->ah->rfkill_polarity;
bool is_blocked;

ath9k_htc_ps_wakeup(priv);
is_blocked = ath9k_hw_gpio_get(priv->ah, priv->ah->rfkill_gpio) ==
priv->ah->rfkill_polarity;
ath9k_htc_ps_restore(priv);

return is_blocked;
}

void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw)
Expand Down

0 comments on commit 9082631

Please sign in to comment.