power: max170xx: Add RepCap

Add the POWER_SUPPLY_CHARGE_NOW property to the power supply
and report RepCap.  This will allow easier tracking of the
FCC calculation being done in the driver.

Change-Id: I9299ed0430308651578d943fe7379bbe62de6b38
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1321620
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Curtis Porter <porterc@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Kenny Kessler 2019-03-15 11:39:14 -05:00 • committed by Kenneth Kessler
commit 83a392f86f

View file

@ -188,6 +188,7 @@ static enum power_supply_property max17042_battery_props[] = {
POWER_SUPPLY_PROP_CAPACITY,
POWER_SUPPLY_PROP_CHARGE_FULL,
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_CHARGE_COUNTER,
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
POWER_SUPPLY_PROP_TEMP,
@ -570,6 +571,12 @@ static int max17042_get_property(struct power_supply *psy,
return ret;
val->intval = ret;
break;
case POWER_SUPPLY_PROP_CHARGE_NOW:
regmap_read(map, MAX17042_RepCap, &data);
val->intval = (data & 0xFFFF) * chip->fctr_uah_bit;
break;
case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT:
regmap_read(map, MAX17042_STATUS, &data);