Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b8bee79 authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

msm: qpnp-power-on: update PMIC reset configuration logic



Add an option to configure the PMIC for shutdown when requested
for hard_reset. This configuration may be required on secondary
PMIC's to avoid lockups during reset.

Change-Id: Ib387aab40fc60a2e2de10088c0171a087bf809d4
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent bc76024c
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -59,6 +59,8 @@ Optional properties:
- qcom,store-hard-reset-reason	Boolean property which if set will store the hardware
- qcom,store-hard-reset-reason	Boolean property which if set will store the hardware
				reset reason to SOFT_RB_SPARE register of the core PMIC
				reset reason to SOFT_RB_SPARE register of the core PMIC
				PON peripheral.
				PON peripheral.
- qcom,cfg-shutdown-for-hard-reset	Boolean property, if present PMIC's PS_HOLD reset type
					is configured for SHUTDOWN in case of HARD RESET.




All the below properties are in the sub-node section (properties of the child
All the below properties are in the sub-node section (properties of the child
+9 −0
Original line number Original line Diff line number Diff line
@@ -392,6 +392,15 @@ static int qpnp_pon_reset_config(struct qpnp_pon *pon,
	 */
	 */
	udelay(500);
	udelay(500);


	/*
	 * In case of HARD RESET configure PMIC's
	 * PS_HOLD_RESET_CTL based on the dt property.
	 */
	if ((type == PON_POWER_OFF_HARD_RESET) &&
			of_find_property(pon->spmi->dev.of_node,
				"qcom,cfg-shutdown-for-hard-reset", NULL))
		type = PON_POWER_OFF_SHUTDOWN;

	rc = qpnp_pon_masked_write(pon, QPNP_PON_PS_HOLD_RST_CTL(pon->base),
	rc = qpnp_pon_masked_write(pon, QPNP_PON_PS_HOLD_RST_CTL(pon->base),
				   QPNP_PON_POWER_OFF_MASK, type);
				   QPNP_PON_POWER_OFF_MASK, type);
	if (rc)
	if (rc)