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