1 /* Copyright (c) 2008 -2014 Espressif System.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 as
5 * published by the Free Software Foundation.
8 * init , call sdio_init or spi_init
14 #include "esp_debug.h"
15 #include "esp_version.h"
18 int esp_common_init(void)
21 #if (defined(CONFIG_DEBUG_FS) && defined(DEBUGFS_BOOTMODE)) || defined(ESP_CLASS)
22 if (sif_get_esp_run() != 0) {
27 ret = esp_sdio_init();
32 #if (defined(CONFIG_DEBUG_FS) && defined(DEBUGFS_BOOTMODE)) || defined(ESP_CLASS)
34 sif_record_esp_run(1);
39 void esp_common_exit(void)
41 #if (defined(CONFIG_DEBUG_FS) && defined(DEBUGFS_BOOTMODE)) || defined(ESP_CLASS)
42 if (sif_get_esp_run() == 0) {
52 #if (defined(CONFIG_DEBUG_FS) && defined(DEBUGFS_BOOTMODE)) || defined(ESP_CLASS)
53 sif_record_esp_run(0);
57 static int /*__init*/ esp_init(void)
64 esp_dbg(ESP_SHOW, "\n*****%s %s EAGLE DRIVER VER:%llx*****\n\n", __DATE__, __TIME__, ver);
66 edf_ret = esp_debugfs_init(); /* if failed, continue */
68 #if defined(CONFIG_DEBUG_FS) && defined(DEBUGFS_BOOTMODE)
69 dbgfs_bootmode_init();
71 esp_dump_var("esp_msg_level", NULL, &esp_msg_level, ESP_U32);
73 #ifdef ESP_ANDROID_LOGGER
74 esp_dump_var("log_off", NULL, &log_off, ESP_U32);
75 #endif /* ESP_ANDROID_LOGGER */
82 return esp_common_init();
85 static void /*__exit */ esp_exit(void)
95 #include <linux/rfkill-wlan.h>
96 extern int get_wifi_chip_type(void);
98 int rockchip_wifi_init_module_esp8089(void)
100 #ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
101 int type = get_wifi_chip_type();
102 if (type != WIFI_ESP8089) return 0;
107 void rockchip_wifi_exit_module_esp8089(void)
109 #ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
110 int type = get_wifi_chip_type();
111 if (type != WIFI_ESP8089) return;
116 #ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
117 late_initcall(rockchip_wifi_init_module_esp8089);
118 module_exit(rockchip_wifi_exit_module_esp8089);
120 EXPORT_SYMBOL(rockchip_wifi_init_module_esp8089);
121 EXPORT_SYMBOL(rockchip_wifi_exit_module_esp8089);
123 //module_init(esp_init);
124 //module_exit(esp_exit);