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

Commit 1af5874c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 9538e505 351a6d00
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/debugfs.h>
@@ -235,6 +235,7 @@ struct qpnp_pon {
	bool			kpdpwr_dbc_enable;
	bool			resin_pon_reset;
	ktime_t			kpdpwr_last_release_time;
	bool			legacy_hard_reset_offset;
};

static struct qpnp_pon *sys_reset_dev;
@@ -381,7 +382,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) || is_pon_gen3(pon))
	if ((is_pon_gen2(pon) || is_pon_gen3(pon)) && !pon->legacy_hard_reset_offset)
		rc = qpnp_pon_masked_write(pon, QPNP_PON_SOFT_RB_SPARE(pon),
					   GENMASK(7, 1), (reason << 1));
	else
@@ -2376,6 +2377,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");