4 * WIFI power control.
\r
10 #define WIFI_POWER_H
\r
12 #include <linux/version.h>
\r
14 #define WIFI_GPIO_POWER_CONTROL 1
\r
16 #if (WIFI_GPIO_POWER_CONTROL == 1)
\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
22 #include <mach/gpio.h>
\r
23 #include <mach/iomux.h>
\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
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
37 #define POWER_GPIO_NOT_IOMUX 0
\r
38 #define POWER_GPIO_IOMUX 1
\r
40 #define GPIO_SWITCH_OFF 0
\r
41 #define GPIO_SWITCH_ON 1
\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
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
58 void rockchip_wifi_shutdown(void);
\r
60 #endif /* WIFI_GPIO_POWER_CONTROL */
\r
62 #define WIFI_NETWORK_BUSY 0
\r
63 #define WIFI_NETWORK_IDLE 1
\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
73 void wifi_turn_on_callback(void);
\r
74 void wifi_turn_off_callback(void);
\r
76 #if defined(CONFIG_RALINK_RT3070) || defined(CONFIG_REALTEK_RTL8192)
\r
78 int wifi_activate_usb(void);
\r
79 int wifi_deactivate_usb(void);
\r
80 void wifi_usb_init(void);
\r
84 #endif /* WIFI_POWER_H */
\r