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

Commit 3546ee42 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Harry Yang
Browse files

qpnp-qnovo: disable qnovo for dcin



Usually, DC path is connected to a wireless charger. It is advisable
to disable qnovo when charging wirelessly.
Disable qnovo for dc path unless a property in device tree is set to
specifically enable qnovo for dc path.

Change-Id: I4ca475f30ca0a564f533b4ed8bcd55cfb5da291f
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 76ecf7db
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ Required properties:
Optional Properties:
- qcom,external-rsense:		To indicate whether the platform uses external or
				internal rsense for measuring battery current.
- qcom,enable-for-dc:		To enable qnovo for dc charging path.

Example:

+7 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@
struct qnovo_dt_props {
	bool			external_rsense;
	struct device_node	*revid_dev_node;
	bool			enable_for_dc;
};

struct qnovo {
@@ -443,6 +444,8 @@ static int qnovo_parse_dt(struct qnovo *chip)
		pr_err("Missing qcom,pmic-revid property - driver failed\n");
		return -EINVAL;
	}
	chip->dt.enable_for_dc = of_property_read_bool(node,
					"qcom,enable-for-dc");

	return 0;
}
@@ -1311,6 +1314,10 @@ static void status_change_work(struct work_struct *work)
	if (usb_present)
		dc_present = 0;

	/* disable qnovo for dc path by forcing dc_present = 0 always */
	if (!chip->dt.enable_for_dc)
		dc_present = 0;

	if (chip->dc_present && !dc_present) {
		/* removal */
		chip->dc_present = 0;