rk3036 wifi: modify driver gpio, sdio_vref and .config.
authorli bing <libing@rock-chips.com>
Fri, 18 Jul 2014 00:45:25 +0000 (08:45 +0800)
committerli bing <libing@rock-chips.com>
Fri, 18 Jul 2014 00:52:44 +0000 (08:52 +0800)
arch/arm/boot/dts/rk3036-sdk.dts
arch/arm/configs/rk3036_defconfig
net/rfkill/rfkill-wlan.c

index 90fd2447852b064a7b8998f71908da13d849d381..314904c85528f2d7e115441048094e3242934498 100755 (executable)
                };
        };
 
-    wireless-wlan {
-        compatible = "wlan-platdata";
+       wireless-wlan {
+               compatible = "wlan-platdata";
 
-        wifi_chip_type = "";
-        sdio_vref = <1800>; //1800mv or 3300mv
+               wifi_chip_type = "";
+               sdio_vref = <0>; //1800mv or 3300mv
 
-        //power_ctrl_by_pmu;
-        //power_pmu_regulator = "act_ldo3";
-        //power_pmu_enable_level = <1>; //1->HIGH, 0->LOW
+               //power_ctrl_by_pmu;
+               //power_pmu_regulator = "act_ldo3";
+               //power_pmu_enable_level = <1>; //1->HIGH, 0->LOW
 
-        //vref_ctrl_enable;
-        //vref_ctrl_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>;
-        //vref_pmu_regulator = "act_ldo3";
-        //vref_pmu_enable_level = <1>; //1->HIGH, 0->LOW
+               //vref_ctrl_enable;
+               //vref_ctrl_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>;
+               //vref_pmu_regulator = "act_ldo3";
+               //vref_pmu_enable_level = <1>; //1->HIGH, 0->LOW
 
-        //WIFI,poweren_gpio = <&gpio4 GPIO_D4 GPIO_ACTIVE_HIGH>;
-        //WIFI,host_wake_irq = <&gpio4 GPIO_D6 GPIO_ACTIVE_HIGH>;
-        //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
+               WIFI,poweren_gpio = <&gpio2 GPIO_D6 GPIO_ACTIVE_HIGH>;
+               WIFI,host_wake_irq = <&gpio2 GPIO_C4 GPIO_ACTIVE_HIGH>;
+               //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
 
-        status = "okay";
+               status = "okay";
     };
 
        usb_control {
index 597f6067de3dc67c9d49aac98d843cb243b47de7..9f038ac3357d55bdcfc742fbe21f7d9f266f0b34 100644 (file)
@@ -268,7 +268,7 @@ CONFIG_USB_NET_INT51X1=y
 CONFIG_USB_IPHETH=y
 CONFIG_USB_SIERRA_NET=y
 CONFIG_RKWIFI=y
-CONFIG_AP6335=y
+CONFIG_AP6210=y
 # CONFIG_INPUT_MOUSEDEV is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_KEYRESET=y
index 629e6471d55e4558f21c0aa1e57f1d041f6331b8..e7ad8943f7161bc891fe7f95513948304763a257 100755 (executable)
@@ -35,6 +35,7 @@
 #include <linux/rockchip/iomap.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <linux/skbuff.h>
+#include <linux/rockchip/cpu.h>
 #ifdef CONFIG_OF
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -251,7 +252,7 @@ int rockchip_wifi_ref_voltage(int on)
         int ret = -1;
         char *ldostr;
         int level = mrfkill->pdata->ioregulator.enable;
-        int voltage = 1000 * mrfkill->pdata->sdio_vol;
+               int voltage = 1000 * mrfkill->pdata->sdio_vol;
 
         ldostr = mrfkill->pdata->ioregulator.pmu_regulator;
         if (ldostr == NULL) {
@@ -264,10 +265,18 @@ int rockchip_wifi_ref_voltage(int on)
             return -1;
         } else {
             if (on == level) {
-                regulator_set_voltage(ldo, voltage, voltage);
-                LOG("%s: %s enabled, level = %d\n", __func__, ldostr, voltage);
-                ret = regulator_enable(ldo);
-                LOG("wifi turn on io reference voltage.\n");
+               if(cpu_is_rk3036())
+               {
+                                       /*regulator_set_voltage(ldo, voltage, voltage);
+                                       LOG("%s: %s enabled, level = %d\n", __func__, ldostr, voltage);
+                                       ret = regulator_enable(ldo);
+                                       LOG("wifi turn on io reference voltage.\n");*/
+               }else{
+                                       regulator_set_voltage(ldo, voltage, voltage);
+                                       LOG("%s: %s enabled, level = %d\n", __func__, ldostr, voltage);
+                                       ret = regulator_enable(ldo);
+                                       LOG("wifi turn on io reference voltage.\n");
+               }
             } else {
                 LOG("%s: %s disabled\n", __func__, ldostr);
                 while (regulator_is_enabled(ldo) > 0) {
@@ -591,12 +600,21 @@ static int wlan_platdata_parse_dt(struct device *dev,
 
     memset(data, 0, sizeof(*data));
 
-    ret = of_property_read_u32(node, "sdio_vref", &value);
-    if (ret < 0) {
-        LOG("%s: Can't get sdio vref.", __func__);
-        return -1;
-    }
-    data->sdio_vol = value;
+       if(cpu_is_rk3036()){
+               /* ret = of_property_read_u32(node, "sdio_vref", &value);
+               if (ret < 0) {
+                       LOG("%s: Can't get sdio vref.", __func__);
+                       return -1;
+               }
+               data->sdio_vol = value;*/
+       }else{
+               ret = of_property_read_u32(node, "sdio_vref", &value);
+               if (ret < 0) {
+                       LOG("%s: Can't get sdio vref.", __func__);
+                       return -1;
+               }
+               data->sdio_vol = value;
+       }
 
     if (of_find_property(node, "vref_ctrl_enable", NULL)) {
         LOG("%s: enable wifi io reference voltage control.\n", __func__);