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

Commit 62fddf01 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qpnp-qnovo: disable qnovo for dcin"

parents ea8714b1 ca0bfff2
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:

+10 −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;
@@ -1455,6 +1462,9 @@ static int qnovo_hw_init(struct qnovo *chip)
	u8 vadc_offset, vadc_gain;
	u8 val;

	vote(chip->chg_ready_votable, USB_READY_VOTER, false, 0);
	vote(chip->chg_ready_votable, DC_READY_VOTER, false, 0);

	vote(chip->disable_votable, USER_VOTER, true, 0);
	vote(chip->disable_votable, FG_AVAILABLE_VOTER, true, 0);