wifi: modify usb wifi control by pmu ext.

This commit is contained in:
hwg
2012-09-20 16:29:25 +08:00
parent af21e2eea8
commit e78a9dce7f
4 changed files with 42 additions and 74 deletions

View File

@@ -224,27 +224,6 @@ int tps65910_pre_init(struct tps65910 *tps65910){
return 0;
}
void rk2928_tps_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_tps_usb_wifi_on);
void rk2928_tps_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_tps_usb_wifi_off);
int tps65910_post_init(struct tps65910 *tps65910)
{

View File

@@ -208,7 +208,7 @@ static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
static int rk_fb_io_disable(void)
{
#if defined(CONFIG_REGULATOR_ACT8931)
#if 0//defined(CONFIG_REGULATOR_ACT8931)
if(g_pmic_type == PMIC_TYPE_ACT8931)
{
struct regulator *ldo;
@@ -223,7 +223,7 @@ static int rk_fb_io_disable(void)
}
static int rk_fb_io_enable(void)
{
#if defined(CONFIG_REGULATOR_ACT8931)
#if 0//defined(CONFIG_REGULATOR_ACT8931)
if(g_pmic_type == PMIC_TYPE_ACT8931)
{
struct regulator *ldo;
@@ -442,6 +442,40 @@ struct platform_device pwm_regulator_device[1] = {
},
};
#endif
/***********************************************************
* usb wifi
************************************************************/
#if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU)
static void rkusb_wifi_power(int on) {
struct regulator *ldo;
#if defined(CONFIG_MFD_TPS65910)
if(g_pmic_type == PMIC_TYPE_TPS65910) {
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
}
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
if(g_pmic_type == PMIC_TYPE_ACT8931) {
ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl
}
#endif
if(on) {
regulator_enable(ldo);
printk("%s: vccio_wl enable\n", __func__);
} else {
printk("%s: vccio_wl disable\n", __func__);
regulator_disable(ldo);
}
regulator_put(ldo);
udelay(100);
}
#endif
/**************************************************************************************************
* SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05
**************************************************************************************************/

View File

@@ -85,27 +85,6 @@ 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",

View File

@@ -364,49 +364,25 @@ static int __init rk29sdk_wifi_bt_gpio_control_init(void)
}
#if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU)
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);
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)
{
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);
rkusb_wifi_power(0);
mdelay(50);
}*/
rk2928_usb_wifi_power(1);
rkusb_wifi_power(1);
usbwifi_power_status = 1;
pr_info("wifi turn on power\n");
}else{
rk2928_usb_wifi_power(0);
rkusb_wifi_power(0);
usbwifi_power_status = 0;
pr_info("wifi shut off power\n");
}
return 0;
}
}
#else
int rk29sdk_wifi_power(int on)
{