input: misc: add dvdd flag for non-kungpow device

For device without kungpow, KPDPWR bark irq is recommended to
halt the kernel. But since this is a hard reset, a dvdd flag
(reuse the kungpow bit flag) is needed to indicate this is
an intended HW reset by s1 timer, even if s2 is not fired. In this
way, bootloader is able to detect correct power up reason (0x100000).

Dependency: BL need to detect this bit flag for power up reason
amendment.

Change-Id: If4f2cffc87bd75fd03fcb5cbf87cd90664eb71bf
Signed-off-by: Donghua Yan <a18317@motorola.com>
Reviewed-on: https://gerrit.mot.com/1439390
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Donghua Yan 2019-10-18 16:16:10 -05:00 • committed by Dong-Hua Yan
commit 64ef700824

View file

@ -42,6 +42,21 @@ struct qpnp_pon_mmi {
u32 kpd_bark_irq;
};
static bool mmi_kungpow_check(void)
{
struct device_node *soc = of_find_node_by_path("/soc");
struct device_node *kungpow = NULL;
bool has_kungpow = false;
if (soc)
kungpow = of_find_node_by_name(soc, "kungpow_default");
has_kungpow = (kungpow != NULL);
of_node_put(kungpow);
of_node_put(soc);
return has_kungpow;
}
static void kpd_bark_work_func(struct work_struct *work)
{
@ -49,7 +64,8 @@ static void kpd_bark_work_func(struct work_struct *work)
container_of(work, struct qpnp_pon_mmi, kpd_bark_work.work);
dev_err(&pon->pdev->dev, "HW User Reset! 2 sec to Reset!\n");
qpnp_pon_store_extra_reset_info(RESET_EXTRA_RESET_KUNPOW_REASON, 0);
qpnp_pon_store_extra_reset_info(RESET_EXTRA_RESET_KUNPOW_REASON,
mmi_kungpow_check() ? 0 : RESET_EXTRA_RESET_KUNPOW_REASON);
qpnp_pon_system_pwr_off(PON_POWER_OFF_HARD_RESET);
kernel_halt();
}