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

Commit 7b008b4b authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: qpnp-vm-bms: Add POWER_SUPPLY_PROP_RESISTANCE_NOW property



This property exposes the instantaneous battery resistance via
power supply framework.

CRs-Fixed: 792108
Change-Id: Iacfd373acba9116b16322df1efdb9162d81519b7
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 4f6abbb0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2172,6 +2172,7 @@ static enum power_supply_property bms_power_props[] = {
	POWER_SUPPLY_PROP_STATUS,
	POWER_SUPPLY_PROP_RESISTANCE,
	POWER_SUPPLY_PROP_RESISTANCE_CAPACITIVE,
	POWER_SUPPLY_PROP_RESISTANCE_NOW,
	POWER_SUPPLY_PROP_CURRENT_NOW,
	POWER_SUPPLY_PROP_VOLTAGE_OCV,
	POWER_SUPPLY_PROP_HI_POWER,
@@ -2224,6 +2225,12 @@ static int qpnp_vm_bms_power_get_property(struct power_supply *psy,
		if (chip->dt.cfg_r_conn_mohm > 0)
			val->intval += chip->dt.cfg_r_conn_mohm;
		break;
	case POWER_SUPPLY_PROP_RESISTANCE_NOW:
		rc = get_batt_therm(chip, &value);
		if (rc < 0)
			value = BMS_DEFAULT_TEMP;
		val->intval = get_rbatt(chip, chip->calculated_soc, value);
		break;
	case POWER_SUPPLY_PROP_CURRENT_NOW:
		val->intval = get_prop_bms_current_now(chip);
		break;