Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/platform/platform_ARM_WMT_sdio.c
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2013 - 2017 Realtek Corporation.
4
*
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.
8
*
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
12
* more details.
13
*
14
*****************************************************************************/
15
#include <drv_types.h>
16
#include <mach/wmt_iomux.h>
17
#include <linux/gpio.h>
18
19
extern void wmt_detect_sdio2(void);
20
extern void force_remove_sdio2(void);
21
22
int platform_wifi_power_on(void)
23
{
24
int err = 0;
25
err = gpio_request(WMT_PIN_GP62_SUSGPIO1, "wifi_chip_en");
26
if (err < 0) {
27
printk("request gpio for rtl8188eu failed!\n");
28
return err;
29
}
30
gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 0);/* pull sus_gpio1 to 0 to open vcc_wifi. */
31
printk("power on rtl8189.\n");
32
msleep(500);
33
wmt_detect_sdio2();
34
printk("[rtl8189es] %s: new card, power on.\n", __FUNCTION__);
35
return err;
36
}
37
38
void platform_wifi_power_off(void)
39
{
40
force_remove_sdio2();
41
42
gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 1);/* pull sus_gpio1 to 1 to close vcc_wifi. */
43
printk("power off rtl8189.\n");
44
gpio_free(WMT_PIN_GP62_SUSGPIO1);
45
printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__);
46
}
47
48