From: gwl Date: Wed, 26 Mar 2014 05:20:13 +0000 (+0800) Subject: Wifi:BT: enable uart0 for bt, add wifi reference voltage. X-Git-Tag: firefly_0821_release~5823 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8cbfe6bdc824e4772ba0f4e87a0dce56c849b41d;p=firefly-linux-kernel-4.4.55.git Wifi:BT: enable uart0 for bt, add wifi reference voltage. --- diff --git a/arch/arm/boot/dts/rk3288-tb.dts b/arch/arm/boot/dts/rk3288-tb.dts index d5c9e9e3468a..605fafda29ec 100755 --- a/arch/arm/boot/dts/rk3288-tb.dts +++ b/arch/arm/boot/dts/rk3288-tb.dts @@ -12,7 +12,7 @@ compatible = "wlan-platdata"; wifi_chip_type = ""; - sdio_vref = <28000>; + sdio_vref = <1800>; //1800mv or 3300mv //power_ctrl_by_pmu; pmu_regulator = "act_ldo3"; @@ -293,6 +293,12 @@ */ }; +&uart_bt { + status = "okay"; + dma-names = "!tx", "!rx"; + pinctrl-0 = <&uart0_xfer &uart0_cts>; +}; + &i2c0 { status = "okay"; rk808: rk808@1b { diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index b87bdd8e08b8..e1b3a3c7ff72 100755 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #ifdef CONFIG_OF #include @@ -325,6 +326,7 @@ u8 wifi_custom_mac_addr[6] = {0,0,0,0,0,0}; extern char GetSNSectorInfo(char * pbuf); int rockchip_wifi_mac_addr(unsigned char *buf) { + return -1; char mac_buf[20] = {0}; LOG("%s: enter.\n", __func__); @@ -392,6 +394,30 @@ void *rockchip_wifi_country_code(char *ccode) EXPORT_SYMBOL(rockchip_wifi_country_code); /**************************************************************************/ +static int rockchip_wifi_voltage_select(void) +{ + struct rfkill_wlan_data *mrfkill = g_rfkill; + int voltage = 0; + + if (mrfkill == NULL) { + LOG("%s: rfkill-wlan driver has not Successful initialized\n", __func__); + return -1; + } + voltage = mrfkill->pdata->sdio_vol; + if (voltage > 2700 && voltage < 3500) { + writel_relaxed(0x00100000, RK_GRF_VIRT+0x380); //3.3 + LOG("%s: wifi & sdio reference voltage: 3.3V\n", __func__); + } else if (voltage > 1500 && voltage < 1950) { + writel_relaxed(0x00100010, RK_GRF_VIRT+0x380); //1.8 + LOG("%s: wifi & sdio reference voltage: 1.8V\n", __func__); + } else { + LOG("%s: unsupport wifi & sdio reference voltage!\n", __func__); + return -1; + } + + return 0; +} + static int rfkill_rk_setup_gpio(struct rksdmmc_gpio *gpio, const char* prefix, const char* name) { if (gpio_is_valid(gpio->io)) { @@ -546,6 +572,8 @@ static int rfkill_wlan_probe(struct platform_device *pdev) gpio_direction_output(pdata->power_n.io, !pdata->power_n.enable); } + rockchip_wifi_voltage_select(); + #if BCM_STATIC_MEMORY_SUPPORT rockchip_init_wifi_mem(); #endif