4 * Power control for WIFI module.
\r
6 * There are Power supply and Power Up/Down controls for WIFI typically.
\r
8 #include <linux/module.h>
\r
9 #include <linux/kernel.h>
\r
10 #include <linux/delay.h>
\r
11 #include <linux/jiffies.h>
\r
13 #include "wifi_power.h"
\r
15 #if (WIFI_GPIO_POWER_CONTROL == 1)
\r
18 * GPIO to control LDO/DCDC.
\r
20 * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。
\r
23 * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH
\r
25 struct wifi_power power_gpio =
\r
27 POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOB1_SMCS1_MMC0PCA_NAME,
\r
28 IOMUXA_GPIO0_B1, GPIOPortB_Pin1, GPIO_HIGH
\r
32 * GPIO to control WIFI PowerDOWN/RESET.
\r
34 * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。
\r
36 struct wifi_power power_save_gpio =
\r
38 POWER_USE_GPIO, 0, 0, 0, GPIOPortA_Pin4, GPIO_HIGH
\r
42 * GPIO to reset WIFI. Keep this as NULL normally.
\r
44 * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。
\r
46 struct wifi_power power_reset_gpio =
\r
52 * If external GPIO chip such as PCA9554 is being used, please
\r
53 * implement the following 2 function.
\r
55 * id: is GPIO identifier, such as GPIOPortF_Pin0, or external
\r
56 * name defined in struct wifi_power.
\r
57 * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW.
\r
59 * 如果有用扩展GPIO来控制WIFI,请实现下面的函数:
\r
60 * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。
\r
61 * id : 是IO的标识号,以整数的形式标识。
\r
62 * sens: 是要求的IO状态,为高或低。
\r
64 void wifi_extgpio_operation(u8 id, u8 sens)
\r
66 //pca955x_gpio_direction_output(id, sens);
\r
70 * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口:
\r
71 * void rockchip_wifi_shutdown();
\r
72 * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。
\r
75 #endif /* WIFI_GPIO_POWER_CONTROL */
\r