From: Grant Grundler Date: Fri, 18 Mar 2011 22:56:57 +0000 (-0700) Subject: STAGING: brcm80211 v2 keep power on in suspend state X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6b5a5a3eb77ea69382da9d2a64d74107e49cedaa;p=linux-beck.git STAGING: brcm80211 v2 keep power on in suspend state Keep WIFI power on during suspend. Consumes 10s of milliwatts but avoids having to reload firmware on resume. Tested on tegra2_seaboard. Signed-off-by: Venkat Rao Tested-by: Grant Grundler Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 65313fa0cf4a..0c89e854c4ce 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c @@ -68,6 +68,13 @@ DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait); int sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, u32 regaddr, int regsize, u32 *data); +void sdioh_sdio_set_host_pm_flags(int flag) +{ + if (sdio_set_host_pm_flags(gInstance->func[1], flag)) + printk(KERN_ERR "%s: Failed to set pm_flags 0x%08x\n",\ + __func__, (unsigned int)flag); +} + static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd) { int err_ret; diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c index 555b056b49b1..b44daf959e8f 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c @@ -39,6 +39,8 @@ #include #include +void sdioh_sdio_set_host_pm_flags(int flag); + static struct sdio_func *cfg80211_sdio_func; static struct wl_dev *wl_cfg80211_dev; static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255}; @@ -1988,6 +1990,8 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy) clear_bit(WL_STATUS_SCANNING, &wl->status); clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status); + sdioh_sdio_set_host_pm_flags(MMC_PM_KEEP_POWER); + return err; }