wifi: modify usb wifi control by pmu ext.
authorhwg <hwg@rock-chips.com>
Thu, 20 Sep 2012 08:29:25 +0000 (16:29 +0800)
committerhwg <hwg@rock-chips.com>
Thu, 20 Sep 2012 08:29:25 +0000 (16:29 +0800)
arch/arm/mach-rk2928/board-rk2928-a720-tps65910.c
arch/arm/mach-rk2928/board-rk2928-a720.c
arch/arm/mach-rk2928/board-rk2928-sdk-act8931.c
arch/arm/mach-rk2928/board-rk2928-sdk-sdmmc.c

index 9c0e20891a200e71d2b33a35d918bb7e834541da..67273cee028c113fb7151f949edd45c636b65a2e 100755 (executable)
@@ -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)
 {
index b726b228026b3f3a6c9c9f0ecee0b4219cd8c362..967ddac24597e33d46c7cf0b4f3bf08895f8e444 100755 (executable)
@@ -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
 **************************************************************************************************/
index 2e63ad9245cc9d6f833f2b46309dfadacdbb9fd5..2b136714ae002e6428161e45298c7bc01176e88d 100755 (executable)
@@ -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",
index 6637965aceb5fd7c80974c6317716ba5e70fd982..d48e0c464e2a8dcadfeb7c91294a94194d7861d6 100755 (executable)
@@ -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)
 {