aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2012-05-02 14:25:59 -0700
committerDmitry Shmidt <dimitrysh@google.com>2012-05-02 14:30:35 -0700
commitb7f01a5788d4c188b25b05fc5756f97acbfec673 (patch)
tree556477cb67c1d8a24e5e227509e50784c1a1b388 /drivers/net/wireless
parentd60ec08410dd639e48d00a8c22214a0cde40fd75 (diff)
downloadkernel_samsung_aries-b7f01a5788d4c188b25b05fc5756f97acbfec673.zip
kernel_samsung_aries-b7f01a5788d4c188b25b05fc5756f97acbfec673.tar.gz
kernel_samsung_aries-b7f01a5788d4c188b25b05fc5756f97acbfec673.tar.bz2
net: wireless: bcmdhd: Set MMC_PM_KEEP_POWER flag on suspend
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c
index 602523d..a78faeb 100644
--- a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c
+++ b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c
@@ -178,6 +178,8 @@ MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids);
static int bcmsdh_sdmmc_suspend(struct device *pdev)
{
struct sdio_func *func = dev_to_sdio_func(pdev);
+ mmc_pm_flag_t sdio_flags;
+ int ret;
if (func->num != 2)
return 0;
@@ -186,6 +188,21 @@ 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) */