]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ath9k/ath9k_htc: Fix PS wrappers for RF kill
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Wed, 28 Sep 2011 11:26:10 +0000 (16:56 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 30 Sep 2011 19:57:04 +0000 (15:57 -0400)
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>
drivers/net/wireless/ath/ath9k/gpio.c
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c

index afbf5400a52a55f46fd1a815a46aed93bade7565..fd0f84ebdb51994895966c988ae414acd2f797d5 100644 (file)
@@ -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)
index db2352e5cc0d5e660d005ac09204e7c0cc46e8c3..e3a02eb8e0cc768dd44f2b49db655ed9d705c02f 100644 (file)
@@ -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)