net: wireless: bcmdhd: Set MMC_PM_KEEP_POWER flag on suspend
Dmitry Shmidt [Wed, 2 May 2012 21:25:59 +0000 (14:25 -0700)]
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c

index 1fdb7c9..a9b6629 100644 (file)
@@ -185,6 +185,22 @@ static int bcmsdh_sdmmc_suspend(struct device *pdev)
 
        if (dhd_os_check_wakelock(bcmsdh_get_drvdata()))
                return -EBUSY;
+
+
+       sdio_flags = sdio_get_host_pm_caps(func);
+
+       if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
+               sd_err(("%s: can't keep power while host is suspended\n", __FUNCTION__));
+               return  -EINVAL;
+       }
+
+       /* keep power while host suspended */
+       ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
+       if (ret) {
+               sd_err(("%s: error while trying to keep power\n", __FUNCTION__));
+               return ret;
+       }
+
 #if defined(OOB_INTR_ONLY)
        bcmsdh_oob_intr_set(0);
 #endif /* defined(OOB_INTR_ONLY) */