target: msm8994: Add shutdown api

Configure the PMIC for shutdown and drop PS_HOLD to trigger
the shutdown sequence

Change-Id: Ic706786a906d18399345dac2974f80a74d40d390
diff --git a/target/msm8994/init.c b/target/msm8994/init.c
index febd022..5c993c2 100644
--- a/target/msm8994/init.c
+++ b/target/msm8994/init.c
@@ -442,3 +442,20 @@
 {
 	return CRYPTO_ENGINE_TYPE_HW;
 }
+
+void shutdown_device()
+{
+	dprintf(CRITICAL, "Going down for shutdown.\n");
+
+	/* Configure PMIC for shutdown. */
+	pm8x41_reset_configure(PON_PSHOLD_SHUTDOWN);
+
+	/* Drop PS_HOLD for MSM */
+	writel(0x00, MPM2_MPM_PS_HOLD);
+
+	mdelay(5000);
+
+	dprintf(CRITICAL, "Shutdown failed\n");
+
+	ASSERT(0);
+}