Merge commit 'c039c332f23e794deb6d6f37b9f07ff3b27fb2cf' into md
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / ti / wl12xx / main.c
index 3d6c71b7a3c72008944a712bdf5b35eb528197e0..f429fc110cb0ac1a09e887564310f04dfe0c72dd 100644 (file)
@@ -1339,6 +1339,14 @@ static int wl12xx_hw_init(struct wl1271 *wl)
                ret = wl128x_cmd_general_parms(wl);
                if (ret < 0)
                        goto out;
+
+               /*
+                * If we are in calibrator based auto detect then we got the FEM nr
+                * in wl->fem_manuf. No need to continue further
+                */
+               if (wl->plt_mode == PLT_FEM_DETECT)
+                       goto out;
+
                ret = wl128x_cmd_radio_parms(wl);
                if (ret < 0)
                        goto out;
@@ -1355,6 +1363,14 @@ static int wl12xx_hw_init(struct wl1271 *wl)
                ret = wl1271_cmd_general_parms(wl);
                if (ret < 0)
                        goto out;
+
+               /*
+                * If we are in calibrator based auto detect then we got the FEM nr
+                * in wl->fem_manuf. No need to continue further
+                */
+               if (wl->plt_mode == PLT_FEM_DETECT)
+                       goto out;
+
                ret = wl1271_cmd_radio_parms(wl);
                if (ret < 0)
                        goto out;
@@ -1500,6 +1516,13 @@ static int wl12xx_plt_init(struct wl1271 *wl)
        if (ret < 0)
                goto out_irq_disable;
 
+       /*
+        * If we are in calibrator based auto detect then we got the FEM nr
+        * in wl->fem_manuf. No need to continue further
+        */
+       if (wl->plt_mode == PLT_FEM_DETECT)
+               goto out;
+
        ret = wl1271_acx_init_mem_config(wl);
        if (ret < 0)
                goto out_irq_disable;