diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-09-16 23:59:02 +0200 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-09-27 02:50:40 +0200 |
commit | 3443069d4efb389dc39e21dbce05c009846a9228 (patch) | |
tree | 7b5ee6c5f65728835e8d7c76b861f602f19f0539 | |
parent | 6fb2f2a9827c08cd09289f7d0afe82c2f7fa27b9 (diff) | |
download | kernel_i9300_mainline-3443069d4efb389dc39e21dbce05c009846a9228.zip kernel_i9300_mainline-3443069d4efb389dc39e21dbce05c009846a9228.tar.gz kernel_i9300_mainline-3443069d4efb389dc39e21dbce05c009846a9228.tar.bz2 |
ANDROID: power: max17042_battery: report SOC and battery type
Android expects the SOC at the capacity property. The vendor driver does
minor fixes to the raw SOC value while here, only the raw value is used.
Android also expects the battery type at the technology property.
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rw-r--r-- | drivers/power/max17042_battery.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c index da7a75f..135cec1 100644 --- a/drivers/power/max17042_battery.c +++ b/drivers/power/max17042_battery.c @@ -94,6 +94,7 @@ static enum power_supply_property max17042_battery_props[] = { POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_CURRENT_AVG, + POWER_SUPPLY_PROP_TECHNOLOGY, }; static int max17042_get_temperature(struct max17042_chip *chip, int *temp) @@ -246,7 +247,7 @@ static int max17042_get_property(struct power_supply *psy, val->intval = data * 625 / 8; break; case POWER_SUPPLY_PROP_CAPACITY: - ret = regmap_read(map, MAX17042_RepSOC, &data); + ret = regmap_read(map, MAX17042_VFSOC, &data); if (ret < 0) return ret; @@ -332,6 +333,9 @@ static int max17042_get_property(struct power_supply *psy, return -EINVAL; } break; + case POWER_SUPPLY_PROP_TECHNOLOGY: + val->intval = POWER_SUPPLY_TECHNOLOGY_LION; + break; default: return -EINVAL; } @@ -392,6 +396,7 @@ static int max17042_property_is_writeable(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_TEMP_ALERT_MIN: case POWER_SUPPLY_PROP_TEMP_ALERT_MAX: + case POWER_SUPPLY_PROP_TECHNOLOGY: ret = 1; break; default: |