aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-05-07 04:07:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-07 14:57:17 -0400
commit2ff6575b1e497f88acf2c7de7e1ba015267b689d (patch)
tree5509cb57ce4eba2e2d36f8df7039e87f8c83d867 /drivers/net
parentbc6fb35644ee46725f51ef27e901bd5d7e52c101 (diff)
ath9k_htc: Handle IDLE LED properly
Switch LED off/on when handling CONF_CHANGE_IDLE. Not doing this would leave the radio LED on even though the chip would be in full sleep mode. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 7c9e33ba95ab..f50358605266 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1099,7 +1099,7 @@ fail_tx:
1099 return 0; 1099 return 0;
1100} 1100}
1101 1101
1102static int ath9k_htc_radio_enable(struct ieee80211_hw *hw) 1102static int ath9k_htc_radio_enable(struct ieee80211_hw *hw, bool led)
1103{ 1103{
1104 struct ath9k_htc_priv *priv = hw->priv; 1104 struct ath9k_htc_priv *priv = hw->priv;
1105 struct ath_hw *ah = priv->ah; 1105 struct ath_hw *ah = priv->ah;
@@ -1147,6 +1147,13 @@ static int ath9k_htc_radio_enable(struct ieee80211_hw *hw)
1147 priv->tx_queues_stop = false; 1147 priv->tx_queues_stop = false;
1148 spin_unlock_bh(&priv->tx_lock); 1148 spin_unlock_bh(&priv->tx_lock);
1149 1149
1150 if (led) {
1151 /* Enable LED */
1152 ath9k_hw_cfg_output(ah, ah->led_pin,
1153 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
1154 ath9k_hw_set_gpio(ah, ah->led_pin, 0);
1155 }
1156
1150 ieee80211_wake_queues(hw); 1157 ieee80211_wake_queues(hw);
1151 1158
1152 return ret; 1159 return ret;
@@ -1158,13 +1165,13 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
1158 int ret = 0; 1165 int ret = 0;
1159 1166
1160 mutex_lock(&priv->mutex); 1167 mutex_lock(&priv->mutex);
1161 ret = ath9k_htc_radio_enable(hw); 1168 ret = ath9k_htc_radio_enable(hw, false);
1162 mutex_unlock(&priv->mutex); 1169 mutex_unlock(&priv->mutex);
1163 1170
1164 return ret; 1171 return ret;
1165} 1172}
1166 1173
1167static void ath9k_htc_radio_disable(struct ieee80211_hw *hw) 1174static void ath9k_htc_radio_disable(struct ieee80211_hw *hw, bool led)
1168{ 1175{
1169 struct ath9k_htc_priv *priv = hw->priv; 1176 struct ath9k_htc_priv *priv = hw->priv;
1170 struct ath_hw *ah = priv->ah; 1177 struct ath_hw *ah = priv->ah;
@@ -1177,6 +1184,12 @@ static void ath9k_htc_radio_disable(struct ieee80211_hw *hw)
1177 return; 1184 return;
1178 } 1185 }
1179 1186
1187 if (led) {
1188 /* Disable LED */
1189 ath9k_hw_set_gpio(ah, ah->led_pin, 1);
1190 ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
1191 }
1192
1180 /* Cancel all the running timers/work .. */ 1193 /* Cancel all the running timers/work .. */
1181 cancel_work_sync(&priv->ps_work); 1194 cancel_work_sync(&priv->ps_work);
1182 cancel_delayed_work_sync(&priv->ath9k_ani_work); 1195 cancel_delayed_work_sync(&priv->ath9k_ani_work);
@@ -1217,7 +1230,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
1217 struct ath9k_htc_priv *priv = hw->priv; 1230 struct ath9k_htc_priv *priv = hw->priv;
1218 1231
1219 mutex_lock(&priv->mutex); 1232 mutex_lock(&priv->mutex);
1220 ath9k_htc_radio_disable(hw); 1233 ath9k_htc_radio_disable(hw, false);
1221 mutex_unlock(&priv->mutex); 1234 mutex_unlock(&priv->mutex);
1222} 1235}
1223 1236
@@ -1337,7 +1350,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1337 1350
1338 if (enable_radio) { 1351 if (enable_radio) {
1339 ath9k_htc_setpower(priv, ATH9K_PM_AWAKE); 1352 ath9k_htc_setpower(priv, ATH9K_PM_AWAKE);
1340 ath9k_htc_radio_enable(hw); 1353 ath9k_htc_radio_enable(hw, true);
1341 ath_print(common, ATH_DBG_CONFIG, 1354 ath_print(common, ATH_DBG_CONFIG,
1342 "not-idle: enabling radio\n"); 1355 "not-idle: enabling radio\n");
1343 } 1356 }
@@ -1389,10 +1402,9 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1389 if (priv->ps_idle) { 1402 if (priv->ps_idle) {
1390 ath_print(common, ATH_DBG_CONFIG, 1403 ath_print(common, ATH_DBG_CONFIG,
1391 "idle: disabling radio\n"); 1404 "idle: disabling radio\n");
1392 ath9k_htc_radio_disable(hw); 1405 ath9k_htc_radio_disable(hw, true);
1393 } 1406 }
1394 1407
1395
1396 mutex_unlock(&priv->mutex); 1408 mutex_unlock(&priv->mutex);
1397 1409
1398 return 0; 1410 return 0;