msm: charm: Configure A1 clock for pin mode

Before the external modem images are loaded, the A1 PMIC clock
needs to be configured in Pin Control mode. Otherwise, there
could be a race where the external modem has not been
configured which could prevent bootup.

CRs-Fixed: 297181
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index 0d17c2f..c198792 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -9696,6 +9696,21 @@
 };
 #endif
 
+void msm_fusion_setup_pinctrl(void)
+{
+	struct msm_xo_voter *a1;
+
+	if (socinfo_get_platform_subtype() == 0x3) {
+		/*
+		 * Vote for the A1 clock to be in pin control mode before
+		* the external images are loaded.
+		*/
+		a1 = msm_xo_get(MSM_XO_TCXO_A1, "mdm");
+		BUG_ON(!a1);
+		msm_xo_mode_vote(a1, MSM_XO_MODE_PIN_CTRL);
+	}
+}
+
 struct msm_board_data {
 	struct msm_gpiomux_configs *gpiomux_cfgs;
 };
@@ -9998,6 +10013,9 @@
 	}
 
 	msm8x60_multi_sdio_init();
+
+	if (machine_is_msm8x60_fusion() || machine_is_msm8x60_fusn_ffa())
+		msm_fusion_setup_pinctrl();
 }
 
 static void __init msm8x60_rumi3_init(void)