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

Commit d4ab9bad authored by Sundara Vinayagam's avatar Sundara Vinayagam
Browse files

input: qpnp-power-on: Add a property to force hard-reset offset



Some (PON gen2) platforms still use legacy hard-reset offset [7:2]
of the PON_RB_SPARE register. Add a DT property to support it.

Change-Id: I8fd3434bcc064965b11aaf3e9c7fcbf694145d21
Signed-off-by: default avatarSundara Vinayagam <sundvi@codeaurora.org>
parent 9d4600a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -112,6 +112,9 @@ Optional properties:
				trigger during system shutdown case.
- qcom,ps-hold-hard-reset-disable	Boolean property to disable PS_HOLD
				POFF trigger during system hard reset case.
- qcom,use-legacy-hard-reset-offset	Boolean property to support legacy
				hard-reset offset of the PON_RB_SPARE register for
				some (PON gen2) platforms.

All the below properties are in the sub-node section (properties of the child
node).
+5 −1
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ struct qpnp_pon {
	bool			kpdpwr_dbc_enable;
	bool			resin_pon_reset;
	ktime_t			kpdpwr_last_release_time;
	bool			legacy_hard_reset_offset;
};

static int pon_ship_mode_en;
@@ -353,7 +354,7 @@ int qpnp_pon_set_restart_reason(enum pon_restart_reason reason)
	if (!pon->store_hard_reset_reason)
		return 0;

	if (is_pon_gen2(pon))
	if (is_pon_gen2(pon) && !pon->legacy_hard_reset_offset)
		rc = qpnp_pon_masked_write(pon, QPNP_PON_SOFT_RB_SPARE(pon),
					   GENMASK(7, 1), (reason << 1));
	else
@@ -2524,6 +2525,9 @@ static int qpnp_pon_probe(struct platform_device *pdev)
	pon->store_hard_reset_reason = of_property_read_bool(pdev->dev.of_node,
					"qcom,store-hard-reset-reason");

	pon->legacy_hard_reset_offset = of_property_read_bool(pdev->dev.of_node,
					"qcom,use-legacy-hard-reset-offset");

	qpnp_pon_debugfs_init(pdev);
	return 0;