aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/sdio.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-05-13 04:57:10 -0400
committerLuciano Coelho <coelho@ti.com>2011-05-13 07:55:48 -0400
commit039bdb1494d1d514987ce596a4898494021c7af2 (patch)
tree42b23bfa8ee1c585901e5c9403963b6e72c95992 /drivers/net/wireless/wl12xx/sdio.c
parent402e48616078c1e56f55a69d314b77f1d750d6ad (diff)
wl12xx_sdio: set MMC_PM_KEEP_POWER flag on suspend
if a wow trigger was configured, set the MMC_PM_KEEP_POWER flag on suspend, so our power will be kept while the system is suspended. We needed to set this flag on each suspend attempt (when we want to keep power) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/sdio.c')
-rw-r--r--drivers/net/wireless/wl12xx/sdio.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index 1298461c45d1..5b03fd5ee33f 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -314,7 +314,34 @@ static int wl1271_suspend(struct device *dev)
314{ 314{
315 /* Tell MMC/SDIO core it's OK to power down the card 315 /* Tell MMC/SDIO core it's OK to power down the card
316 * (if it isn't already), but not to remove it completely */ 316 * (if it isn't already), but not to remove it completely */
317 return 0; 317 struct sdio_func *func = dev_to_sdio_func(dev);
318 struct wl1271 *wl = sdio_get_drvdata(func);
319 mmc_pm_flag_t sdio_flags;
320 int ret = 0;
321
322 wl1271_debug(DEBUG_MAC80211, "wl1271 suspend. wow_enabled: %d",
323 wl->wow_enabled);
324
325 /* check whether sdio should keep power */
326 if (wl->wow_enabled) {
327 sdio_flags = sdio_get_host_pm_caps(func);
328
329 if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
330 wl1271_error("can't keep power while host "
331 "is suspended");
332 ret = -EINVAL;
333 goto out;
334 }
335
336 /* keep power while host suspended */
337 ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
338 if (ret) {
339 wl1271_error("error while trying to keep power");
340 goto out;
341 }
342 }
343out:
344 return ret;
318} 345}
319 346
320static int wl1271_resume(struct device *dev) 347static int wl1271_resume(struct device *dev)