From: li bing Date: Fri, 18 Jul 2014 00:45:25 +0000 (+0800) Subject: rk3036 wifi: modify driver gpio, sdio_vref and .config. X-Git-Tag: firefly_0821_release~4916^2~213 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=20c609efa163fe2e2f5759ab90227d18fc5de785;p=firefly-linux-kernel-4.4.55.git rk3036 wifi: modify driver gpio, sdio_vref and .config. --- diff --git a/arch/arm/boot/dts/rk3036-sdk.dts b/arch/arm/boot/dts/rk3036-sdk.dts index 90fd2447852b..314904c85528 100755 --- a/arch/arm/boot/dts/rk3036-sdk.dts +++ b/arch/arm/boot/dts/rk3036-sdk.dts @@ -34,26 +34,26 @@ }; }; - 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 { diff --git a/arch/arm/configs/rk3036_defconfig b/arch/arm/configs/rk3036_defconfig index 597f6067de3d..9f038ac3357d 100644 --- a/arch/arm/configs/rk3036_defconfig +++ b/arch/arm/configs/rk3036_defconfig @@ -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 diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index 629e6471d55e..e7ad8943f716 100755 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef CONFIG_OF #include #include @@ -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__);