summaryrefslogtreecommitdiff
authorRongjun Chen <rongjun.chen@amlogic.com>2016-11-18 08:05:33 (GMT)
committer Rongjun Chen <rongjun.chen@amlogic.com>2016-11-18 08:06:40 (GMT)
commit3970cc9f7aad9023a5fdff66bdfbebe5c6c93a75 (patch)
treede7aeb00653d979f7ec5bf8bdb00cea3fadf4691
parent0ed44788ffa4045c11df56a97a2c57e81b7a921d (diff)
download8822bs-3970cc9f7aad9023a5fdff66bdfbebe5c6c93a75.zip
8822bs-3970cc9f7aad9023a5fdff66bdfbebe5c6c93a75.tar.gz
8822bs-3970cc9f7aad9023a5fdff66bdfbebe5c6c93a75.tar.bz2
wifi: fix 8822bs make fail issue
Change-Id: I06485853e04fbf70dbfd59895acd1541c55b643e
Diffstat
-rw-r--r--rtl8822BS/platform/platform_AML_S905_sdio.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/rtl8822BS/platform/platform_AML_S905_sdio.c b/rtl8822BS/platform/platform_AML_S905_sdio.c
new file mode 100644
index 0000000..6786e74
--- a/dev/null
+++ b/rtl8822BS/platform/platform_AML_S905_sdio.c
@@ -0,0 +1,72 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+#ifdef CONFIG_PLATFORM_AML_S905
+#include <linux/version.h> /* Linux vresion */
+#include <linux/printk.h> /* printk() */
+#include <linux/delay.h> /* msleep() */
+
+extern void sdio_reinit(void);
+extern void extern_wifi_set_enable(int is_on);
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
+extern void wifi_teardown_dt(void);
+extern int wifi_setup_dt(void);
+#endif /* kernel < 3.14.0 */
+#endif /* CONFIG_PLATFORM_AML_S905 */
+
+
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+
+#ifdef CONFIG_PLATFORM_AML_S905
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
+ ret = wifi_setup_dt();
+ if (ret) {
+ printk("%s: setup dt failed!!(%d)\n", __func__, ret);
+ return -1;
+ }
+#endif /* kernel < 3.14.0 */
+
+/* Seems redundancy? Already done before insert driver */
+ printk("######%s: \n",__func__);
+ extern_wifi_set_enable(0);
+ msleep(500);
+ extern_wifi_set_enable(1);
+ msleep(500);
+ sdio_reinit();
+#endif /* CONFIG_PLATFORM_AML_S905 */
+
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+#ifdef CONFIG_PLATFORM_AML_S905
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
+ wifi_teardown_dt();
+#endif /* kernel < 3.14.0 */
+#endif /* CONFIG_PLATFORM_AML_S905 */
+}