target: FP2: Enable charger mode check.

Adapted from commit 06041310 to target FP2 instead of msm8226.

We now check the boot reason at every boot to determine if we need to boot
into charger mode and also factor in the boot type(cold or warm) when making
the decision.

Issue: FP2N-231
Change-Id: I6081207ad0760ada770eae30419acb679df570b6
(adapted from commit 0604131048febb2989b6351b65e99f49e967821a)
diff --git a/target/FP2/init.c b/target/FP2/init.c
index 99dc4ff..e0ae812 100644
--- a/target/FP2/init.c
+++ b/target/FP2/init.c
@@ -703,13 +703,9 @@
 unsigned target_pause_for_battery_charge(void)
 {
 	uint8_t pon_reason = pm8x41_get_pon_reason();
-
-        /* This function will always return 0 to facilitate
-         * automated testing/reboot with usb connected.
-         * uncomment if this feature is needed */
-	 if ((pon_reason == USB_CHG) || (pon_reason == DC_CHG))
-		return 1;
-
+	uint8_t is_cold_boot = pm8x41_get_is_cold_boot();
+	if (is_cold_boot && ((pon_reason == USB_CHG) || (pon_reason == DC_CHG)))
+		 return 1;
 	return 0;
 }