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

Commit 0639025a authored by Sundara Vinayagam's avatar Sundara Vinayagam Committed by Kiran Gunda
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 fcf83531
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -116,6 +116,9 @@ Optional properties:
				configured to support TWM modes.
- qcom,pbs-client:		Phandle of the PBS client node. Should be
				defined if 'qcom,support-twm-config' is present.
- 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.

Optional Sub-nodes:
- qcom,pon_1 ... qcom,pon_n:	These PON child nodes correspond to features
+5 −1
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ struct qpnp_pon {
	bool			resin_pon_reset;
	ktime_t			kpdpwr_last_release_time;
	struct notifier_block	pon_nb;
	bool			legacy_hard_reset_offset;
};

static int pon_ship_mode_en;
@@ -423,7 +424,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
@@ -2416,6 +2417,9 @@ static int qpnp_pon_probe(struct platform_device *pdev)
	pon->store_hard_reset_reason = of_property_read_bool(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");

	if (of_property_read_bool(dev->of_node, "qcom,secondary-pon-reset")) {
		if (sys_reset) {
			dev_err(dev, "qcom,system-reset property shouldn't be used along with qcom,secondary-pon-reset property\n");