[PATCH] STAGING: brcm80211 keep power on in suspend state

Grant Grundler grundler at google.com
Fri Mar 18 02:12:42 UTC 2011


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 <vrao at broadcom.com>
Tested-by: Grant Grundler <grundler at chromium.org>
---
FYI: four patches from Broadcom enable brcmfmac suspend and resume
to mostly work on tegra2_seaboard (ARM) platform.

The original four patches (including this one) are:
    http://codereview.chromium.org/6488018
    http://codereview.chromium.org/6474032
    http://codereview.chromium.org/6489022
    http://codereview.chromium.org/6484021

Assuming this patch is acceptable, only 6474032 needs to be sent upstream.


diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 65313fa..0c89e85 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 9e74beb..ba1c152 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1973,6 +1973,8 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 
 static s32 wl_cfg80211_suspend(struct wiphy *wiphy)
 {
+	void sdioh_sdio_set_host_pm_flags(int flag);
+
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
 	struct net_device *ndev = wl_to_ndev(wl);
 	s32 err = 0;
@@ -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;
 }
 



More information about the devel mailing list