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

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.

Change-Id: I01a84e91c2b8c610dd7e2af564e0d1e69424fe67
diff --git a/target/msm8226/init.c b/target/msm8226/init.c
index 4ec1764..d8c7031 100644
--- a/target/msm8226/init.c
+++ b/target/msm8226/init.c
@@ -354,9 +354,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;
 }
 
 unsigned target_baseband()