Commit e1972818 authored by Juuso Oikarinen's avatar Juuso Oikarinen Committed by John W. Linville

wl1271: Go to ELP in idle

Allow the wl1271 go to ELP mode also in idle. This will reduce current
consumption remarkably in idle mode (~12mA -> ~0.2mA)
Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: default avatarTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent aecb0565
...@@ -374,6 +374,7 @@ struct wl1271 { ...@@ -374,6 +374,7 @@ struct wl1271 {
#define WL1271_FLAG_PSM_REQUESTED (8) #define WL1271_FLAG_PSM_REQUESTED (8)
#define WL1271_FLAG_IRQ_PENDING (9) #define WL1271_FLAG_IRQ_PENDING (9)
#define WL1271_FLAG_IRQ_RUNNING (10) #define WL1271_FLAG_IRQ_RUNNING (10)
#define WL1271_FLAG_IDLE (11)
unsigned long flags; unsigned long flags;
struct wl1271_partition_set part; struct wl1271_partition_set part;
......
...@@ -1272,7 +1272,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1272,7 +1272,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
wl1271_acx_keep_alive_config( wl1271_acx_keep_alive_config(
wl, CMD_TEMPL_KLV_IDX_NULL_DATA, wl, CMD_TEMPL_KLV_IDX_NULL_DATA,
ACX_KEEP_ALIVE_TPL_INVALID); ACX_KEEP_ALIVE_TPL_INVALID);
} set_bit(WL1271_FLAG_IDLE, &wl->flags);
} else
clear_bit(WL1271_FLAG_IDLE, &wl->flags);
} }
if (conf->flags & IEEE80211_CONF_PS && if (conf->flags & IEEE80211_CONF_PS &&
......
...@@ -40,7 +40,8 @@ void wl1271_elp_work(struct work_struct *work) ...@@ -40,7 +40,8 @@ void wl1271_elp_work(struct work_struct *work)
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags) || if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags) ||
!test_bit(WL1271_FLAG_PSM, &wl->flags)) (!test_bit(WL1271_FLAG_PSM, &wl->flags) &&
!test_bit(WL1271_FLAG_IDLE, &wl->flags)))
goto out; goto out;
wl1271_debug(DEBUG_PSM, "chip to elp"); wl1271_debug(DEBUG_PSM, "chip to elp");
...@@ -56,7 +57,8 @@ void wl1271_elp_work(struct work_struct *work) ...@@ -56,7 +57,8 @@ void wl1271_elp_work(struct work_struct *work)
/* Routines to toggle sleep mode while in ELP */ /* Routines to toggle sleep mode while in ELP */
void wl1271_ps_elp_sleep(struct wl1271 *wl) void wl1271_ps_elp_sleep(struct wl1271 *wl)
{ {
if (test_bit(WL1271_FLAG_PSM, &wl->flags)) { if (test_bit(WL1271_FLAG_PSM, &wl->flags) ||
test_bit(WL1271_FLAG_IDLE, &wl->flags)) {
cancel_delayed_work(&wl->elp_work); cancel_delayed_work(&wl->elp_work);
ieee80211_queue_delayed_work(wl->hw, &wl->elp_work, ieee80211_queue_delayed_work(wl->hw, &wl->elp_work,
msecs_to_jiffies(ELP_ENTRY_DELAY)); msecs_to_jiffies(ELP_ENTRY_DELAY));
......
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