diff options
| author | Komal Seelam <kseelam@codeaurora.org> | 2016-03-30 15:57:06 +0530 |
|---|---|---|
| committer | Anand Kumar <anandkumar@codeaurora.org> | 2016-08-24 17:07:23 +0530 |
| commit | ae275bab72c704ed0a7545f13ea5f8a33e379aad (patch) | |
| tree | 197036652b6c9d35dcac0e15de0bec9e384692b8 | |
| parent | 639f0df4a091985f0f0b8bf3dc188903f81ab987 (diff) | |
cnss: Add optional property to control wlan_en gpio for Dual-Wifi platforms
The WIFI PCIe Clock is controlled by WLAN_EN gpio.
On Dual-WiFi Platforms, QCA WIFI SDIO chip clock sourced by PCIe Clock.
Turning off WLAN_EN gpio would result in SDIO WIFI Functional Failures.
Control the gpio, based on the platform.
CRs-Fixed: 990796
Change-Id: I1399cd8aa53d1c6fd6b8ff0c5cce66b978770dbd
Signed-off-by: Komal Seelam <kseelam@codeaurora.org>
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
| -rw-r--r-- | Documentation/devicetree/bindings/cnss/cnss-wlan.txt | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/cnss/cnss_pci.c | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/cnss/cnss-wlan.txt b/Documentation/devicetree/bindings/cnss/cnss-wlan.txt index 101be70d33b2..6d63d1123f4c 100644 --- a/Documentation/devicetree/bindings/cnss/cnss-wlan.txt +++ b/Documentation/devicetree/bindings/cnss/cnss-wlan.txt @@ -42,6 +42,8 @@ Optional properties: - reg-names: Names of the memory regions defined in reg entry - wlan-bootstrap-gpio: WLAN_BOOTSTRAP GPIO signal specified by QCA6174 which should be drived depending on platforms + - qcom,is-dual-wifi-enabled: Boolean property to control wlan enable(wlan-en) + gpio on dual-wifi platforms. Example: diff --git a/drivers/net/wireless/cnss/cnss_pci.c b/drivers/net/wireless/cnss/cnss_pci.c index c1a6c2dea8ce..efe0e7ad43d0 100644 --- a/drivers/net/wireless/cnss/cnss_pci.c +++ b/drivers/net/wireless/cnss/cnss_pci.c @@ -223,6 +223,10 @@ struct index_file { u8 file_name[13]; }; +struct cnss_dual_wifi { + bool is_dual_wifi_enabled; +}; + /** * struct wlan_mac_addr - Structure to hold WLAN MAC Address * @mac_addr: MAC address @@ -300,6 +304,7 @@ static struct cnss_data { int wlan_bootstrap_gpio; atomic_t auto_suspended; bool monitor_wake_intr; + struct cnss_dual_wifi dual_wifi_info; } *penv; static unsigned int pcie_link_down_panic; @@ -576,6 +581,11 @@ static void cnss_wlan_gpio_set(struct cnss_wlan_gpio_info *info, bool state) return; } + if (state == WLAN_EN_LOW && penv->dual_wifi_info.is_dual_wifi_enabled) { + pr_debug("%s Dual WiFi enabled\n", __func__); + return; + } + gpio_set_value(info->num, state); info->state = state; @@ -2899,6 +2909,9 @@ static int cnss_probe(struct platform_device *pdev) penv->subsys_handle = subsystem_get(penv->subsysdesc.name); + if (of_property_read_bool(dev->of_node, "qcom,is-dual-wifi-enabled")) + penv->dual_wifi_info.is_dual_wifi_enabled = true; + if (of_property_read_u32(dev->of_node, "qcom,wlan-ramdump-dynamic", &ramdump_size) == 0) { penv->ramdump_addr = dma_alloc_coherent(&pdev->dev, |
