From: gwl Date: Mon, 12 Aug 2013 10:02:53 +0000 (+0800) Subject: add RK3026 platform wifi power control by PMU. X-Git-Tag: firefly_0821_release~6726^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f4af252135e8278bc6e3a472558b19240314aec6;p=firefly-linux-kernel-4.4.55.git add RK3026 platform wifi power control by PMU. --- diff --git a/arch/arm/plat-rk/rk-sdmmc-wifi.c b/arch/arm/plat-rk/rk-sdmmc-wifi.c index 60ac22690343..c2c25d1e916f 100755 --- a/arch/arm/plat-rk/rk-sdmmc-wifi.c +++ b/arch/arm/plat-rk/rk-sdmmc-wifi.c @@ -406,22 +406,32 @@ static int __init rk29sdk_wifi_bt_gpio_control_init(void) } #if (defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) || defined(CONFIG_RTL8723AU)) \ - && defined(CONFIG_ARCH_RK2928) + && (defined(CONFIG_ARCH_RK2928) || defined(CONFIG_ARCH_RK3026)) static int usbwifi_power_status = 1; int rk29sdk_wifi_power(int on) { pr_info("%s: %d\n", __func__, on); if (on){ + #if defined(CONFIG_USB_WIFI_POWER_CONTROLED_BY_GPIO) + gpio_set_value(rk_platform_wifi_gpio.power_n.io, rk_platform_wifi_gpio.power_n.enable); + mdelay(100); + #else if(usbwifi_power_status == 1) { rkusb_wifi_power(0); mdelay(50); } rkusb_wifi_power(1); + #endif usbwifi_power_status = 1; pr_info("wifi turn on power\n"); }else{ + #if defined(CONFIG_USB_WIFI_POWER_CONTROLED_BY_GPIO) + gpio_set_value(rk_platform_wifi_gpio.power_n.io, !(rk_platform_wifi_gpio.power_n.enable)); + mdelay(100); + #else rkusb_wifi_power(0); usbwifi_power_status = 0; + #endif pr_info("wifi shut off power\n"); } return 0;