target: msm8974: Add support to configure reset based on the pmic version.
Change-Id: I6317cba4d60e1d137d529698b2aad042b127bb3c
diff --git a/target/msm8974/init.c b/target/msm8974/init.c
index cde6b56..f2bdc68 100644
--- a/target/msm8974/init.c
+++ b/target/msm8974/init.c
@@ -49,6 +49,7 @@
extern bool target_use_signed_kernel(void);
static unsigned int target_id;
+static uint32_t pmic_ver;
#define PMIC_ARB_CHANNEL_NUM 0
#define PMIC_ARB_OWNER_ID 0
@@ -108,7 +109,7 @@
uint32_t target_volume_down()
{
/* Volume down button is tied in with RESIN on MSM8974. */
- if (pm8x41_get_pmic_rev() == PMIC_VERSION_V2)
+ if (pmic_ver == PMIC_VERSION_V2)
return pm8x41_resin_bark_workaround_status();
else
return pm8x41_resin_status();
@@ -162,6 +163,9 @@
spmi_init(PMIC_ARB_CHANNEL_NUM, PMIC_ARB_OWNER_ID);
+ /* Save PM8941 version info. */
+ pmic_ver = pm8x41_get_pmic_rev();
+
target_keystatus();
if (target_use_signed_kernel())
@@ -317,7 +321,10 @@
writel(reboot_reason, RESTART_REASON_ADDR);
/* Configure PMIC for warm reset */
- pm8x41_reset_configure(PON_PSHOLD_WARM_RESET);
+ if (pmic_ver == PMIC_VERSION_V2)
+ pm8x41_v2_reset_configure(PON_PSHOLD_WARM_RESET);
+ else
+ pm8x41_reset_configure(PON_PSHOLD_WARM_RESET);
/* Disable Watchdog Debug.
* Required becuase of a H/W bug which causes the system to