Path: blob/master/ALFA-W1F1/RTL8814AU/platform/platform_ARM_WMT_sdio.c
1307 views
/******************************************************************************1*2* Copyright(c) 2013 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13*****************************************************************************/14#include <drv_types.h>15#include <mach/wmt_iomux.h>16#include <linux/gpio.h>1718extern void wmt_detect_sdio2(void);19extern void force_remove_sdio2(void);2021int platform_wifi_power_on(void)22{23int err = 0;24err = gpio_request(WMT_PIN_GP62_SUSGPIO1, "wifi_chip_en");25if (err < 0) {26printk("request gpio for rtl8188eu failed!\n");27return err;28}29gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 0);/* pull sus_gpio1 to 0 to open vcc_wifi. */30printk("power on rtl8189.\n");31msleep(500);32wmt_detect_sdio2();33printk("[rtl8189es] %s: new card, power on.\n", __FUNCTION__);34return err;35}3637void platform_wifi_power_off(void)38{39force_remove_sdio2();4041gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 1);/* pull sus_gpio1 to 1 to close vcc_wifi. */42printk("power off rtl8189.\n");43gpio_free(WMT_PIN_GP62_SUSGPIO1);44printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__);45}464748