]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
net: wireless: bcm4335: power off card when not in use
authorOm Prakash Singh <omp@nvidia.com>
Thu, 14 Feb 2013 04:24:52 +0000 (20:24 -0800)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 20:01:26 +0000 (13:01 -0700)
Power off the card when wifi is off and power up only when wifi
is turned on

Bug 1011349

Change-Id: I018c3757280c81c9077dd07949422bf572fc3a0d
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: http://git-master/r/200684
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
drivers/net/wireless/bcm4335/bcmsdh_sdmmc.c
drivers/net/wireless/bcm4335/bcmsdh_sdmmc_linux.c

index 3810056159d22a9e70e437ef0ad8c811a94755f0..3451e55de2ef9be21de1ab7b743777857f62c1d7 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <linux/mmc/core.h>
 #include <linux/mmc/card.h>
+#include <linux/mmc/host.h>
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
 
@@ -1534,7 +1535,9 @@ sdioh_start(sdioh_info_t *si, int stage)
                   2.6.27. The implementation prior to that is buggy, and needs broadcom's
                   patch for it
                */
-               if ((ret = sdio_reset_comm(gInstance->func[0]->card))) {
+               ret = mmc_power_restore_host((gInstance->func[0])->card->host);
+
+               if (ret) {
                        sd_err(("%s Failed, error = %d\n", __FUNCTION__, ret));
                        return ret;
                }
@@ -1619,6 +1622,8 @@ sdioh_stop(sdioh_info_t *si)
 #endif
                bcmsdh_oob_intr_set(FALSE);
 #endif /* !defined(OOB_INTR_ONLY) */
+               if (mmc_power_save_host((gInstance->func[0])->card->host))
+                       sd_err(("%s card power save fail\n", __func__));
        }
        else
                sd_err(("%s Failed\n", __FUNCTION__));
index a341ec5d687bc337c3c76d3988d19735d0e83c06..29afa399f9c7c6365cfbb9faf2b19360089c96b3 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <linux/mmc/core.h>
 #include <linux/mmc/card.h>
+#include <linux/mmc/host.h>
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
 
@@ -136,6 +137,8 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
        #endif
                        sd_trace(("F2 found, calling bcmsdh_probe...\n"));
                        ret = bcmsdh_probe(&func->dev);
+                       if (mmc_power_save_host(func->card->host))
+                               sd_err(("%s: card power save fail", __func__));
                }
        } else {
                ret = -ENODEV;