mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
wifi: modify usb wifi control by pmu
This commit is contained in:
@@ -224,7 +224,7 @@ int tps65910_pre_init(struct tps65910 *tps65910){
|
||||
return 0;
|
||||
|
||||
}
|
||||
void rk2928_usb_wifi_on(void)
|
||||
void rk2928_tps_usb_wifi_on(void)
|
||||
{
|
||||
struct regulator *ldo;
|
||||
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
|
||||
@@ -233,8 +233,8 @@ void rk2928_usb_wifi_on(void)
|
||||
regulator_put(ldo);
|
||||
udelay(100);
|
||||
}
|
||||
EXPORT_SYMBOL(rk2928_usb_wifi_on);
|
||||
void rk2928_usb_wifi_off(void)
|
||||
EXPORT_SYMBOL(rk2928_tps_usb_wifi_on);
|
||||
void rk2928_tps_usb_wifi_off(void)
|
||||
{
|
||||
struct regulator *ldo;
|
||||
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
|
||||
@@ -243,7 +243,7 @@ void rk2928_usb_wifi_off(void)
|
||||
regulator_put(ldo);
|
||||
udelay(100);
|
||||
}
|
||||
EXPORT_SYMBOL(rk2928_usb_wifi_off);
|
||||
EXPORT_SYMBOL(rk2928_tps_usb_wifi_off);
|
||||
|
||||
|
||||
int tps65910_post_init(struct tps65910 *tps65910)
|
||||
|
||||
@@ -50,10 +50,11 @@ int act8931_set_init(struct act8931 *act8931)
|
||||
regulator_put(ldo);
|
||||
udelay(100);
|
||||
|
||||
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
|
||||
ldo = regulator_get(NULL, "act_ldo4"); //vcc_wl
|
||||
regulator_set_voltage(ldo, 3300000, 3300000);
|
||||
regulator_enable(ldo);
|
||||
printk("%s set ldo4 vcc_lcd=%dmV end\n", __func__, regulator_get_voltage(ldo));
|
||||
regulator_disable(ldo);
|
||||
regulator_put(ldo);
|
||||
udelay(100);
|
||||
|
||||
@@ -84,6 +85,27 @@ int act8931_set_init(struct act8931 *act8931)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rk2928_act_usb_wifi_on(void)
|
||||
{
|
||||
struct regulator *ldo;
|
||||
ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl
|
||||
regulator_enable(ldo);
|
||||
printk("%s: vccio_wl enable\n", __func__);
|
||||
regulator_put(ldo);
|
||||
udelay(100);
|
||||
}
|
||||
EXPORT_SYMBOL(rk2928_act_usb_wifi_on);
|
||||
void rk2928_act_usb_wifi_off(void)
|
||||
{
|
||||
struct regulator *ldo;
|
||||
ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl
|
||||
printk("%s: vccio_wl disable\n", __func__);
|
||||
regulator_disable(ldo);
|
||||
regulator_put(ldo);
|
||||
udelay(100);
|
||||
}
|
||||
EXPORT_SYMBOL(rk2928_act_usb_wifi_off);
|
||||
|
||||
static struct regulator_consumer_supply act8931_buck1_supply[] = {
|
||||
{
|
||||
.supply = "act_dcdc1",
|
||||
|
||||
@@ -364,17 +364,49 @@ static int __init rk29sdk_wifi_bt_gpio_control_init(void)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU)
|
||||
int rk29sdk_wifi_power(int on)
|
||||
{
|
||||
/*pr_info("%s: %d\n", __func__, on);
|
||||
if (on){
|
||||
pr_info("wifi turn on power\n");
|
||||
}else{
|
||||
pr_info("wifi shut off power\n");
|
||||
}*/
|
||||
void rk2928_act_usb_wifi_on(void);
|
||||
void rk2928_act_usb_wifi_off(void);
|
||||
void rk2928_tps_usb_wifi_on(void);
|
||||
void rk2928_tps_usb_wifi_off(void);
|
||||
|
||||
return 0;
|
||||
static int usbwifi_power_status = 1;
|
||||
static void rk2928_usb_wifi_power(int on) {
|
||||
#if defined(CONFIG_MFD_TPS65910)
|
||||
if(g_pmic_type == PMIC_TYPE_TPS65910) {
|
||||
if(on)
|
||||
rk2928_tps_usb_wifi_on();
|
||||
else
|
||||
rk2928_tps_usb_wifi_off();
|
||||
}
|
||||
#endif
|
||||
#if defined(CONFIG_REGULATOR_ACT8931)
|
||||
if(g_pmic_type == PMIC_TYPE_ACT8931) {
|
||||
if(on)
|
||||
rk2928_act_usb_wifi_on();
|
||||
else
|
||||
rk2928_act_usb_wifi_off();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int rk29sdk_wifi_power(int on)
|
||||
{
|
||||
pr_info("%s: %d\n", __func__, on);
|
||||
if (on){
|
||||
/*if(usbwifi_power_status == 1) {
|
||||
rk2928_usb_wifi_power(0);
|
||||
mdelay(50);
|
||||
}*/
|
||||
rk2928_usb_wifi_power(1);
|
||||
usbwifi_power_status = 1;
|
||||
pr_info("wifi turn on power\n");
|
||||
}else{
|
||||
rk2928_usb_wifi_power(0);
|
||||
usbwifi_power_status = 0;
|
||||
pr_info("wifi shut off power\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int rk29sdk_wifi_power(int on)
|
||||
{
|
||||
|
||||
@@ -29,10 +29,6 @@ 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user