aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/max17042_battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/max17042_battery.c')
-rw-r--r--drivers/power/max17042_battery.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index 140788b309f8..74abc6c755b4 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -113,6 +113,7 @@ static enum power_supply_property max17042_battery_props[] = {
113 POWER_SUPPLY_PROP_VOLTAGE_OCV, 113 POWER_SUPPLY_PROP_VOLTAGE_OCV,
114 POWER_SUPPLY_PROP_CAPACITY, 114 POWER_SUPPLY_PROP_CAPACITY,
115 POWER_SUPPLY_PROP_CHARGE_FULL, 115 POWER_SUPPLY_PROP_CHARGE_FULL,
116 POWER_SUPPLY_PROP_CHARGE_COUNTER,
116 POWER_SUPPLY_PROP_TEMP, 117 POWER_SUPPLY_PROP_TEMP,
117 POWER_SUPPLY_PROP_CURRENT_NOW, 118 POWER_SUPPLY_PROP_CURRENT_NOW,
118 POWER_SUPPLY_PROP_CURRENT_AVG, 119 POWER_SUPPLY_PROP_CURRENT_AVG,
@@ -201,6 +202,13 @@ static int max17042_get_property(struct power_supply *psy,
201 202
202 val->intval = ret * 1000 / 2; 203 val->intval = ret * 1000 / 2;
203 break; 204 break;
205 case POWER_SUPPLY_PROP_CHARGE_COUNTER:
206 ret = max17042_read_reg(chip->client, MAX17042_QH);
207 if (ret < 0)
208 return ret;
209
210 val->intval = ret * 1000 / 2;
211 break;
204 case POWER_SUPPLY_PROP_TEMP: 212 case POWER_SUPPLY_PROP_TEMP:
205 ret = max17042_read_reg(chip->client, MAX17042_TEMP); 213 ret = max17042_read_reg(chip->client, MAX17042_TEMP);
206 if (ret < 0) 214 if (ret < 0)