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

Commit 6b09671b authored by Fenglin Wu's avatar Fenglin Wu Committed by Bernhard Thoben
Browse files

power: qpnp-charger: Avoid override USBIN_COMP in reverse boost for SMBBP



When SMBBP working at reverse boost mode with a charger connected, USBIN
comparator can be used to turn off the OVP FET and trigger an USBIN_VALID
IRQ to detect the charger removal.

Avoid overriding USBIN comparator when SMBBP working at reverse boost
mode, to ensure the charger insertion and removal can be detected.

Change-Id: If705bc5cb7132ab2ce9b97ac4b887a4cdc201b52
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent e543bd62
Loading
Loading
Loading
Loading
+18 −17
Original line number Diff line number Diff line
@@ -3452,7 +3452,7 @@ qpnp_chg_regulator_boost_enable(struct regulator_dev *rdev)
			pr_err("failed to write SEC_ACCESS rc=%d\n", rc);
			return rc;
		}

		if (chip->type != SMBBP) {
			rc = qpnp_chg_masked_write(chip,
				chip->usb_chgpth_base + COMP_OVR1,
				0xFF,
@@ -3462,6 +3462,7 @@ qpnp_chg_regulator_boost_enable(struct regulator_dev *rdev)
				return rc;
			}
		}
	}

	rc = qpnp_chg_masked_write(chip,
		chip->boost_base + BOOST_ENABLE_CONTROL,
@@ -3558,7 +3559,7 @@ qpnp_chg_regulator_boost_disable(struct regulator_dev *rdev)
			pr_err("failed to write SEC_ACCESS rc=%d\n", rc);
			return rc;
		}

		if (chip->type != SMBBP) {
			rc = qpnp_chg_masked_write(chip,
				chip->usb_chgpth_base + COMP_OVR1,
				0xFF,
@@ -3567,7 +3568,7 @@ qpnp_chg_regulator_boost_disable(struct regulator_dev *rdev)
				pr_err("failed to write COMP_OVR1 rc=%d\n", rc);
				return rc;
			}

		}
		usleep(1000);

		qpnp_chg_usb_suspend_enable(chip, 0);