From a7352aa663260267febf036ce9fbb59140b14122 Mon Sep 17 00:00:00 2001 From: xiaoyao Date: Wed, 27 Jul 2016 10:39:47 +0800 Subject: [PATCH] wifi: power save: turn off the reset pin when wifi is closed Change-Id: I06b188d9a67319d2508f016595e73b2f1d97fa99 Signed-off-by: xiaoyao --- drivers/mmc/core/host.c | 2 +- net/rfkill/rfkill-wlan.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 11e9a9692670..a346775929c8 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -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; diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index 5a13d02a5984..4c63219376d5 100644 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef CONFIG_OF #include #include @@ -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 extern int mmc_host_rescan(struct mmc_host *host, int val, int irq_type); int rockchip_wifi_set_carddetect(int val) { -- 2.34.1