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
29 WIFI_PWDN_IOMUX_PINNAME,
\r
30 WIFI_PWDN_IOMUX_PINDIR,
\r
36 * GPIO to control WIFI PowerDOWN/RESET.
\r
38 * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。
\r
40 struct wifi_power power_save_gpio =
\r
44 WIFI_RST_IOMUX_PINNAME,
\r
45 WIFI_RST_IOMUX_PINDIR,
\r
51 * GPIO to reset WIFI. Keep this as NULL normally.
\r
53 * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。
\r
55 struct wifi_power power_reset_gpio =
\r
61 * If external GPIO chip such as PCA9554 is being used, please
\r
62 * implement the following 2 function.
\r
64 * id: is GPIO identifier, such as GPIOPortF_Pin0, or external
\r
65 * name defined in struct wifi_power.
\r
66 * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW.
\r
68 * 如果有用扩展GPIO来控制WIFI,请实现下面的函数:
\r
69 * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。
\r
70 * id : 是IO的标识号,以整数的形式标识。
\r
71 * sens: 是要求的IO状态,为高或低。
\r
73 void wifi_extgpio_operation(u8 id, u8 sens)
\r
75 //pca955x_gpio_direction_output(id, sens);
\r
79 * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口:
\r
80 * void rockchip_wifi_shutdown();
\r
81 * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。
\r
84 #endif /* WIFI_GPIO_POWER_CONTROL */
\r