wifi: power save: turn off the reset pin when wifi is closed
authorxiaoyao <xiaoyao@rock-chips.com>
Wed, 27 Jul 2016 02:39:47 +0000 (10:39 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Wed, 27 Jul 2016 12:20:39 +0000 (20:20 +0800)
Change-Id: I06b188d9a67319d2508f016595e73b2f1d97fa99
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
drivers/mmc/core/host.c
net/rfkill/rfkill-wlan.c

index 11e9a9692670ec73ac1c4e7a7e49905a8479be49..a346775929c8644d0b8e3745684df78cc5e78a1b 100644 (file)
@@ -386,7 +386,7 @@ EXPORT_SYMBOL(mmc_alloc_host);
  *     prepared to start servicing requests before this function
  *     completes.
  */
-static struct mmc_host *primary_sdio_host;
+struct mmc_host *primary_sdio_host;
 int mmc_add_host(struct mmc_host *host)
 {
        int err;
index 5a13d02a5984945e97463bb643a4034cb13ccd18..4c63219376d59bd39825554c62886c4bc4ca01a9 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/rockchip/common.h>
 #include <linux/regmap.h>
 #include <linux/mfd/syscon.h>
+#include <linux/mmc/host.h>
 #ifdef CONFIG_OF
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -53,6 +54,9 @@
 
 #define LOG(x...)   printk(KERN_INFO "[WLAN_RFKILL]: "x)
 
+extern struct mmc_host *primary_sdio_host;
+extern void mmc_pwrseq_power_off(struct mmc_host *host);
+
 struct rfkill_wlan_data {
        struct rksdmmc_gpio_wifi_moudle *pdata;
     struct wake_lock            wlan_irq_wl;
@@ -290,6 +294,9 @@ int rockchip_wifi_power(int on)
 
     LOG("%s: %d\n", __func__, on);
 
+       if (!on && primary_sdio_host)
+               mmc_pwrseq_power_off(primary_sdio_host);
+
     if (mrfkill == NULL) {
         LOG("%s: rfkill-wlan driver has not Successful initialized\n", __func__);
         return -1;
@@ -380,7 +387,6 @@ EXPORT_SYMBOL(rockchip_wifi_power);
  * Wifi Sdio Detect Func
  *
  *************************************************************************/
-#include <linux/mmc/host.h>
 extern int mmc_host_rescan(struct mmc_host *host, int val, int irq_type);
 int rockchip_wifi_set_carddetect(int val)
 {