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

Commit 54cfe66f authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Bernhard Thoben
Browse files

qpnp-smbcharger: Publish charger voltage to the usb psy

Since N, the Keyguard uses watt data rather than amperage alone. It
needs both voltage and amperage information for the power supply
subsystem to do so.

This brings back the "Charging slowly", "Charging" and "Charging
rapidly" texts on the lock screen.

Change-Id: Iac37d8b69d2acc048e8c132b2c26c2bed3676d75
parent fa962fec
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2133,6 +2133,8 @@ static void smbchg_parallel_usb_enable(struct smbchg_chip *chip)
			rc);
		goto disable_parallel;
	}
	rc = power_supply_set_voltage_limit(chip->usb_psy,
			(chip->vfloat_mv + 50) * 1000);
	chip->target_fastchg_current_ma = chip->cfg_fastchg_current_ma / 2;
	smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma);
	pval.intval = chip->target_fastchg_current_ma * 1000;
@@ -2906,8 +2908,11 @@ static int smbchg_float_voltage_set(struct smbchg_chip *chip, int vfloat_mv)

	if (rc)
		dev_err(chip->dev, "Couldn't set float voltage rc = %d\n", rc);
	else
	else {
		chip->vfloat_mv = vfloat_mv;
		power_supply_set_voltage_limit(chip->usb_psy,
				chip->vfloat_mv * 1000);
	}

	return rc;
}