1 /******************************************************************************
3 * Copyright(c) 2013 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #include <drv_types.h>
22 extern void sdhci_bus_scan(void);
24 extern int sdhci_device_attached(void);
29 * 0: power on successfully
30 * others: power on failed
32 int platform_wifi_power_on(void)
37 #ifdef CONFIG_RTL8188E
38 rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_ON);
39 #endif /* CONFIG_RTL8188E */
41 /* Pull up pwd pin, make wifi leave power down mode. */
43 rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_ON);
45 #if (MP_DRIVER == 1) && (defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B))
46 /* Pull up BT reset pin. */
47 rtw_wifi_gpio_wlan_ctrl(WLAN_BT_PWDN_ON);
52 #ifdef CONFIG_RTL8723B
58 #else /* !ANDROID_2X */
62 for (i = 0; i <= 50; i++) {
64 if (sdhci_device_attached())
66 printk("%s delay times:%d\n", __func__, i);
69 #endif /* !ANDROID_2X */
74 void platform_wifi_power_off(void)
76 /* Pull down pwd pin, make wifi enter power down mode. */
77 rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_OFF);
79 rtw_wifi_gpio_deinit();
81 #ifdef CONFIG_RTL8188E
82 rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_OFF);
83 #endif /* CONFIG_RTL8188E */
87 mmc_host->pm_flags &= ~MMC_PM_KEEP_POWER;
88 #endif /* CONFIG_WOWLAN */