platform: msm_shared: add support for checking alarmboot mode

When the phone is triggered by alarm, it's required to turn off
the display during booting until the alarm app is invoked. So add
the function to check device if it's alarm boot.

Change-Id: I4eca894753dd47095dca93958a29c19476f42382
diff --git a/platform/msm_shared/reboot.c b/platform/msm_shared/reboot.c
index 2e49bf7..abe2ce9 100644
--- a/platform/msm_shared/reboot.c
+++ b/platform/msm_shared/reboot.c
@@ -91,6 +91,21 @@
 	return hard_restart_reason;
 }
 
+/* Return true if it is triggered by alarm. */
+uint32_t check_alarm_boot(void)
+{
+	/* Check reboot reason and power on reason */
+	if (pm8x41_get_is_cold_boot()) {
+		if (pm8x41_get_pon_reason() == RTC_TRG)
+			return 1;
+	} else {
+		if (readl(RESTART_REASON_ADDR) == ALARM_BOOT)
+			return 1;
+	}
+
+	return 0;
+}
+
 void reboot_device(unsigned reboot_reason)
 {
 	uint8_t reset_type = 0;