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

Commit 02e6d297 authored by David Keitel's avatar David Keitel
Browse files

power: qpnp-charger: allow vinmin to be lowered to 4.0 V



Currently the minimum input voltage is limited to a minimum
value of 4.2 V. Some chargers in combination with cables
having high resistance may require the input voltage minum
to be lower than 4.2.

Fix this by allowing up to 4.0 V for the minimum input voltage
settings.

Change-Id: I6f1dfa2453c7b95ecc2ccdf2aac23981c0e4dd0a
CRs-Fixed: 584999
Signed-off-by: default avatarDavid Keitel <dkeitel@codeaurora.org>
parent 58f0e8f2
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -884,21 +884,21 @@ qpnp_chg_iusbmax_set(struct qpnp_chg_chip *chip, int mA)
	return rc;
}

#define QPNP_CHG_VINMIN_MIN_MV		4200
#define QPNP_CHG_VINMIN_MIN_MV		4000
#define QPNP_CHG_VINMIN_HIGH_MIN_MV	5600
#define QPNP_CHG_VINMIN_HIGH_MIN_VAL	0x2B
#define QPNP_CHG_VINMIN_MAX_MV		9600
#define QPNP_CHG_VINMIN_STEP_MV		50
#define QPNP_CHG_VINMIN_STEP_HIGH_MV	200
#define QPNP_CHG_VINMIN_MASK		0x3F
#define QPNP_CHG_VINMIN_MIN_VAL	0x10
#define QPNP_CHG_VINMIN_MIN_VAL	0x0C
static int
qpnp_chg_vinmin_set(struct qpnp_chg_chip *chip, int voltage)
{
	u8 temp;

	if (voltage < QPNP_CHG_VINMIN_MIN_MV
			|| voltage > QPNP_CHG_VINMIN_MAX_MV) {
	if ((voltage < QPNP_CHG_VINMIN_MIN_MV)
			|| (voltage > QPNP_CHG_VINMIN_MAX_MV)) {
		pr_err("bad mV=%d asked to set\n", voltage);
		return -EINVAL;
	}