input: qpnp-power-on: set boot_reason when system-reset exists

Some platforms don't configure qcom,secondary-pon-reset like 8998.
So set boot_reason when "qcom,system-reset" node exists to avoid
setting a wrong value to boot_reason.

CRs-Fixed: 1102732
Change-Id: I9e9ff2f2d0ffac6baa5d0663664001eb30638e87
Signed-off-by: Mao Jinlong <c_jmao@codeaurora.org>
This commit is contained in:
Mao Jinlong 2017-01-05 19:37:08 +08:00
parent 0a8e939a4e
commit 56a6f88a34

View file

@ -2084,6 +2084,9 @@ static int qpnp_pon_probe(struct platform_device *pdev)
return rc; return rc;
} }
if (sys_reset)
boot_reason = ffs(pon_sts);
index = ffs(pon_sts) - 1; index = ffs(pon_sts) - 1;
cold_boot = !qpnp_pon_is_warm_reset(); cold_boot = !qpnp_pon_is_warm_reset();
if (index >= ARRAY_SIZE(qpnp_pon_reason) || index < 0) { if (index >= ARRAY_SIZE(qpnp_pon_reason) || index < 0) {
@ -2297,8 +2300,6 @@ static int qpnp_pon_probe(struct platform_device *pdev)
list_add(&pon->list, &spon_dev_list); list_add(&pon->list, &spon_dev_list);
spin_unlock_irqrestore(&spon_list_slock, flags); spin_unlock_irqrestore(&spon_list_slock, flags);
pon->is_spon = true; pon->is_spon = true;
} else {
boot_reason = ffs(pon_sts);
} }
/* config whether store the hard reset reason */ /* config whether store the hard reset reason */