Commit 7fa6282a authored by Kalle Valo's avatar Kalle Valo Committed by John W. Linville

wl1251: simplify ELP wakeup time calculation

The wakeup time calculation was too complicated, simplify it.
Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b5a16794
...@@ -68,7 +68,7 @@ void wl1251_ps_elp_sleep(struct wl1251 *wl) ...@@ -68,7 +68,7 @@ void wl1251_ps_elp_sleep(struct wl1251 *wl)
int wl1251_ps_elp_wakeup(struct wl1251 *wl) int wl1251_ps_elp_wakeup(struct wl1251 *wl)
{ {
unsigned long timeout; unsigned long timeout, start;
u32 elp_reg; u32 elp_reg;
if (!wl->elp) if (!wl->elp)
...@@ -76,6 +76,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl) ...@@ -76,6 +76,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl)
wl1251_debug(DEBUG_PSM, "waking up chip from elp"); wl1251_debug(DEBUG_PSM, "waking up chip from elp");
start = jiffies;
timeout = jiffies + msecs_to_jiffies(WL1251_WAKEUP_TIMEOUT); timeout = jiffies + msecs_to_jiffies(WL1251_WAKEUP_TIMEOUT);
wl1251_write32(wl, HW_ACCESS_ELP_CTRL_REG_ADDR, ELPCTRL_WAKE_UP); wl1251_write32(wl, HW_ACCESS_ELP_CTRL_REG_ADDR, ELPCTRL_WAKE_UP);
...@@ -96,8 +97,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl) ...@@ -96,8 +97,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl)
} }
wl1251_debug(DEBUG_PSM, "wakeup time: %u ms", wl1251_debug(DEBUG_PSM, "wakeup time: %u ms",
jiffies_to_msecs(jiffies) - jiffies_to_msecs(jiffies - start));
(jiffies_to_msecs(timeout) - WL1251_WAKEUP_TIMEOUT));
wl->elp = false; wl->elp = false;
......
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