rk2928: a720: usb wifi: add power control

This commit is contained in:
kfx 2012-09-11 11:18:06 +08:00
commit c4ee5b4b27
3 changed files with 36 additions and 1 deletions

View file

@ -224,6 +224,28 @@ int tps65910_pre_init(struct tps65910 *tps65910){
return 0;
}
void rk2928_usb_wifi_on(void)
{
struct regulator *ldo;
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
regulator_enable(ldo);
printk("%s: vccio_wl enable\n", __func__);
regulator_put(ldo);
udelay(100);
}
EXPORT_SYMBOL(rk2928_usb_wifi_on);
void rk2928_usb_wifi_off(void)
{
struct regulator *ldo;
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
printk("%s: vccio_wl disable\n", __func__);
regulator_disable(ldo);
regulator_put(ldo);
udelay(100);
}
EXPORT_SYMBOL(rk2928_usb_wifi_off);
int tps65910_post_init(struct tps65910 *tps65910)
{
struct regulator *dcdc;
@ -308,6 +330,7 @@ int tps65910_post_init(struct tps65910 *tps65910)
regulator_set_voltage(ldo,3300000,3300000);
regulator_enable(ldo);
printk("%s set vmmc vccio_wl=%dmV end\n", __func__, regulator_get_voltage(ldo));
regulator_disable(ldo);
regulator_put(ldo);
udelay(100);
@ -315,7 +338,6 @@ int tps65910_post_init(struct tps65910 *tps65910)
return 0;
}
static struct regulator_consumer_supply tps65910_smps1_supply[] = {
{
.supply = "vdd1",

View file

@ -29,6 +29,10 @@ void board_gpio_suspend(void);
void board_gpio_resume(void);
void __sramfunc board_pmu_suspend(void);
void __sramfunc board_pmu_resume(void);
#ifdef CONFIG_MACH_RK2928_A720
void rk2928_usb_wifi_on(void);
void rk2928_usb_wifi_off(void);
#endif
extern struct sys_timer rk2928_timer;

View file

@ -21,6 +21,7 @@
#include <mach/gpio.h>
#include <mach/iomux.h>
#endif
#include <mach/board.h>
#if (WIFI_GPIO_POWER_CONTROL == 1)
@ -74,7 +75,11 @@ int wifi_gpio_operate(struct wifi_power *gpio, int flag)
*/
int wifi_turn_on_rtl8192c_card(void)
{
#ifdef CONFIG_MACH_RK2928_A720
rk2928_usb_wifi_on();
#else
wifi_gpio_operate(&power_gpio, GPIO_SWITCH_ON);
#endif
if (power_gpio.use_gpio != POWER_NOT_USE_GPIO)
msleep(1000);
@ -92,7 +97,11 @@ int wifi_turn_on_card(int module)
int wifi_turn_off_card(void)
{
#ifdef CONFIG_MACH_RK2928_A720
rk2928_usb_wifi_off();
#else
wifi_gpio_operate(&power_gpio, GPIO_SWITCH_OFF);
#endif
msleep(5);
wifi_turn_off_callback();