Path: blob/master/ALFA-W1F1/RTL8814AU/platform/platform_aml_s905_sdio.c
1307 views
/******************************************************************************1*2* Copyright(c) 2016 - 2018 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 <linux/printk.h> /* pr_info(() */15#include <linux/delay.h> /* msleep() */16#include "platform_aml_s905_sdio.h" /* sdio_reinit() and etc */171819/*20* Return:21* 0: power on successfully22* others: power on failed23*/24int platform_wifi_power_on(void)25{26int ret = 0;2728#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))29ret = wifi_setup_dt();30if (ret) {31pr_err("%s: setup dt failed!!(%d)\n", __func__, ret);32return -1;33}34#endif /* kernel < 3.14.0 */3536#if 0 /* Seems redundancy? Already done before insert driver */37pr_info("######%s:\n", __func__);38extern_wifi_set_enable(0);39msleep(500);40extern_wifi_set_enable(1);41msleep(500);42sdio_reinit();43#endif4445return ret;46}4748void platform_wifi_power_off(void)49{50#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))51wifi_teardown_dt();52#endif /* kernel < 3.14.0 */53}545556