wifi: renew patch drivers/net/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / wifi_power / wifi_power.h
1 /*\r
2  * wifi_power.h\r
3  *\r
4  * WIFI power control.\r
5  *\r
6  * Yongle Lai\r
7  */\r
8 \r
9 #ifndef WIFI_POWER_H\r
10 #define WIFI_POWER_H\r
11 \r
12 #include <linux/version.h>\r
13 \r
14 #define WIFI_GPIO_POWER_CONTROL 1\r
15 \r
16 #if (WIFI_GPIO_POWER_CONTROL == 1)\r
17 \r
18 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25)\r
19 #include <asm/arch/gpio.h>\r
20 #include <asm/arch/iomux.h>\r
21 #else\r
22 #include <mach/gpio.h>\r
23 #include <mach/iomux.h>\r
24 \r
25 #endif\r
26 \r
27 #define WIFI_CHIP_MV8686                0\r
28 #define WIFI_CHIP_AR6002                1\r
29 #define WIFI_CHIP_BCM4319               2\r
30 #define WIFI_CHIP_NRX700                3\r
31 #define WIFI_CHIP_RT3070                4\r
32 \r
33 #define POWER_NOT_USE_GPIO      0\r
34 #define POWER_USE_GPIO          1\r
35 #define POWER_USE_EXT_GPIO      2  /* External GPIO chip is used, such as PCA9554. */\r
36 \r
37 #define POWER_GPIO_NOT_IOMUX    0\r
38 #define POWER_GPIO_IOMUX            1\r
39 \r
40 #define GPIO_SWITCH_OFF                         0\r
41 #define GPIO_SWITCH_ON                          1\r
42 \r
43 struct wifi_power\r
44 {\r
45         u8 use_gpio;                    /* If uses GPIO to control wifi power supply. 0 - no, 1 - yes. */\r
46         u8 gpio_iomux;          /* If the GPIO is iomux. 0 - no, 1 - yes. */\r
47         char *iomux_name;       /* IOMUX name */\r
48         u8      iomux_value;    /* IOMUX value - which function is choosen. */\r
49         u8      gpio_id;                        /* GPIO number */\r
50         u8      sensi_level;    /* GPIO sensitive level. */\r
51 };\r
52 \r
53 int wifi_turn_on_card(int module);\r
54 int wifi_turn_off_card(void);\r
55 int wifi_reset_card(void);\r
56 void wifi_extgpio_operation(u8 id, u8 sens);\r
57 \r
58 void rockchip_wifi_shutdown(void);\r
59 \r
60 #endif /* WIFI_GPIO_POWER_CONTROL */\r
61 \r
62 #define WIFI_NETWORK_BUSY       0\r
63 #define WIFI_NETWORK_IDLE       1\r
64 \r
65 int wifi_power_save_init(void);\r
66 int wifi_power_save_exit(void);\r
67 int wifi_power_save_stop(void);\r
68 int wifi_power_save_state(void);\r
69 void wifi_power_save_suspend(void);\r
70 void wifi_power_save_resume(void);\r
71 int wifi_power_save_register_callback(int (*callback)(int status));\r
72 \r
73 void wifi_turn_on_callback(void);\r
74 void wifi_turn_off_callback(void);\r
75 \r
76 #if defined(CONFIG_RALINK_RT3070) || defined(CONFIG_REALTEK_RTL8192)\r
77 \r
78 int wifi_activate_usb(void);\r
79 int wifi_deactivate_usb(void);\r
80 void wifi_usb_init(void);\r
81 \r
82 #endif\r
83 \r
84 #endif /* WIFI_POWER_H */\r
85 \r