MLK-16042-2: net: wireless: bcmdhd_1363: Add dts fw parse support
authorTiberiu Breana <andrei-tiberiu.breana@nxp.com>
Thu, 20 Jul 2017 14:06:46 +0000 (17:06 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:33:53 +0000 (15:33 -0500)
Add support for parsing the fw_path and nv_path parameters
from dts files.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Tiberiu Breana <andrei-tiberiu.breana@nxp.com>
drivers/net/wireless/bcmdhd_1363/dhd_linux.c
drivers/net/wireless/bcmdhd_1363/dhd_linux_platdev.c

index 3bebcea..dc6a0e2 100644 (file)
@@ -7463,15 +7463,11 @@ bool dhd_update_fw_nv_path(dhd_info_t *dhdinfo)
        }
 
        /* check if we need to initialize the path */
-       if (dhdinfo->fw_path[0] == '\0') {
-               if (adapter && adapter->fw_path && adapter->fw_path[0] != '\0')
-                       fw = adapter->fw_path;
+       if (adapter && adapter->fw_path && adapter->fw_path[0] != '\0')
+               fw = adapter->fw_path;
 
-       }
-       if (dhdinfo->nv_path[0] == '\0') {
-               if (adapter && adapter->nv_path && adapter->nv_path[0] != '\0')
-                       nv = adapter->nv_path;
-       }
+       if (adapter && adapter->nv_path && adapter->nv_path[0] != '\0')
+               nv = adapter->nv_path;
 
        /* Use module parameter if it is valid, EVEN IF the path has not been initialized
         *
index 92d6de1..85b6b14 100644 (file)
@@ -288,6 +288,7 @@ static int wifi_plat_dev_drv_probe(struct platform_device *pdev)
        struct resource *resource;
        wifi_adapter_info_t *adapter;
 #ifdef CONFIG_DTS
+       int ret = 0;
 #if defined(OOB_INTR_ONLY)
        int irq, gpio;
 #endif /* defined(OOB_INTR_ONLY) */
@@ -314,6 +315,16 @@ static int wifi_plat_dev_drv_probe(struct platform_device *pdev)
 #endif /* OOB_PARAM */
 
 #ifdef CONFIG_DTS
+       /* get firmware from dts */
+       ret = of_property_read_string(pdev->dev.of_node, "bcmdhd_fw",
+                                     &adapter->fw_path);
+       if (!ret)
+               DHD_INFO(("fw path:%s\n", adapter->fw_path));
+       ret = of_property_read_string(pdev->dev.of_node, "bcmdhd_nv",
+                                     &adapter->nv_path);
+       if (!ret)
+               DHD_INFO(("nv path:%s\n", adapter->nv_path));
+
        wifi_regulator = regulator_get(&pdev->dev, "wlreg_on");
        if (wifi_regulator == NULL) {
                DHD_ERROR(("%s regulator is null\n", __FUNCTION__));