diff options
author | Deepa Dinamani <deepad@codeaurora.org> | 2013-03-08 13:38:34 -0800 |
---|---|---|
committer | Deepa Dinamani <deepad@codeaurora.org> | 2013-03-18 11:04:00 -0700 |
commit | 65df98231900503cb9f22f67d0e773bc153d48b1 (patch) | |
tree | c7aa3c1665c79719914ae4771477895e4e04a461 | |
parent | 07f157106c8ad7e9f676bfee4303e6d146344492 (diff) | |
download | lk-65df98231900503cb9f22f67d0e773bc153d48b1.tar.gz |
target: msm8974: Add an api for device shutdown.
CRs-Fixed: 458185
Change-Id: Iad0dc234dbbd2bb1471d1f630dfc8aee57d1808b
-rw-r--r-- | target/msm8974/init.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/target/msm8974/init.c b/target/msm8974/init.c index f2bdc68d..c4dc69d1 100644 --- a/target/msm8974/init.c +++ b/target/msm8974/init.c @@ -411,3 +411,22 @@ void target_usb_stop(void) clock_ce_disable(SSD_CE_INSTANCE_1); #endif } + +void shutdown_device() +{ + dprintf(CRITICAL, "Going down for shutdown.\n"); + + /* Configure PMIC for shutdown. */ + if (pmic_ver == PMIC_VERSION_V2) + pm8x41_v2_reset_configure(PON_PSHOLD_SHUTDOWN); + else + pm8x41_reset_configure(PON_PSHOLD_SHUTDOWN); + + /* Drop PS_HOLD for MSM */ + writel(0x00, MPM2_MPM_PS_HOLD); + + mdelay(5000); + + dprintf(CRITICAL, "Shutdown failed\n"); + +} |