target: FP2: Check pon hard reset bit as a part of charger mode check.

Adapted from commit 531e59a4 to target FP2 instead of msm8226.

There was a recent change in the kernel pmic driver after which adb reboot
now triggers a cold reboot. Hence our earlier check where we were relying on
the PMIC warmboot status register is not enough anymore. We need to check the
pon hard reset bit as well.

Issue: FP2N-231
Change-Id: I01a84e91c2b8c610dd7e2af564e0d1e69424fe67
(adapted from commit 531e59a44c52b92d557eaa51cb09fe49f09d1bca)
diff --git a/target/FP2/init.c b/target/FP2/init.c
index e0ae812..f1842e1 100644
--- a/target/FP2/init.c
+++ b/target/FP2/init.c
@@ -704,9 +704,18 @@
 {
 	uint8_t pon_reason = pm8x41_get_pon_reason();
 	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;
+	dprintf(INFO, "%s : pon_reason is %d cold_boot:%d\n", __func__,
+			pon_reason, is_cold_boot);
+	/*In case of fastboot reboot or adb reboot we do not want go into
+	 * charger mode.
+	 * fastboot reboot is warm boot with PON hard reset bit not set
+	 * adb reboot is a cold boot with PON hard reset bit set
+	 */
+	if (is_cold_boot && (!(pon_reason & HARD_RST)) &&
+			((pon_reason & USB_CHG) || (pon_reason & DC_CHG)))
+		return 1;
+	else
+		return 0;
 }
 
 void target_uninit(void)