diff options
-rw-r--r-- | drivers/power/bq27x00_battery.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c index 59e68dbd028b..bb16f5b7e167 100644 --- a/drivers/power/bq27x00_battery.c +++ b/drivers/power/bq27x00_battery.c | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (C) 2008 Rodolfo Giometti <giometti@linux.it> | 4 | * Copyright (C) 2008 Rodolfo Giometti <giometti@linux.it> |
5 | * Copyright (C) 2008 Eurotech S.p.A. <info@eurotech.it> | 5 | * Copyright (C) 2008 Eurotech S.p.A. <info@eurotech.it> |
6 | * Copyright (C) 2010-2011 Lars-Peter Clausen <lars@metafoo.de> | 6 | * Copyright (C) 2010-2011 Lars-Peter Clausen <lars@metafoo.de> |
7 | * Copyright (C) 2011 Pali Rohár <pali.rohar@gmail.com> | ||
7 | * | 8 | * |
8 | * Based on a previous work by Copyright (C) 2008 Texas Instruments, Inc. | 9 | * Based on a previous work by Copyright (C) 2008 Texas Instruments, Inc. |
9 | * | 10 | * |
@@ -76,7 +77,7 @@ struct bq27x00_reg_cache { | |||
76 | int time_to_empty_avg; | 77 | int time_to_empty_avg; |
77 | int time_to_full; | 78 | int time_to_full; |
78 | int charge_full; | 79 | int charge_full; |
79 | int charge_counter; | 80 | int cycle_count; |
80 | int capacity; | 81 | int capacity; |
81 | int flags; | 82 | int flags; |
82 | 83 | ||
@@ -115,7 +116,7 @@ static enum power_supply_property bq27x00_battery_props[] = { | |||
115 | POWER_SUPPLY_PROP_CHARGE_FULL, | 116 | POWER_SUPPLY_PROP_CHARGE_FULL, |
116 | POWER_SUPPLY_PROP_CHARGE_NOW, | 117 | POWER_SUPPLY_PROP_CHARGE_NOW, |
117 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, | 118 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, |
118 | POWER_SUPPLY_PROP_CHARGE_COUNTER, | 119 | POWER_SUPPLY_PROP_CYCLE_COUNT, |
119 | POWER_SUPPLY_PROP_ENERGY_NOW, | 120 | POWER_SUPPLY_PROP_ENERGY_NOW, |
120 | }; | 121 | }; |
121 | 122 | ||
@@ -267,7 +268,7 @@ static void bq27x00_update(struct bq27x00_device_info *di) | |||
267 | cache.time_to_empty_avg = bq27x00_battery_read_time(di, BQ27x00_REG_TTECP); | 268 | cache.time_to_empty_avg = bq27x00_battery_read_time(di, BQ27x00_REG_TTECP); |
268 | cache.time_to_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF); | 269 | cache.time_to_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF); |
269 | cache.charge_full = bq27x00_battery_read_lmd(di); | 270 | cache.charge_full = bq27x00_battery_read_lmd(di); |
270 | cache.charge_counter = bq27x00_battery_read_cyct(di); | 271 | cache.cycle_count = bq27x00_battery_read_cyct(di); |
271 | 272 | ||
272 | if (!is_bq27500) | 273 | if (!is_bq27500) |
273 | cache.current_now = bq27x00_read(di, BQ27x00_REG_AI, false); | 274 | cache.current_now = bq27x00_read(di, BQ27x00_REG_AI, false); |
@@ -496,8 +497,8 @@ static int bq27x00_battery_get_property(struct power_supply *psy, | |||
496 | case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: | 497 | case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: |
497 | ret = bq27x00_simple_value(di->charge_design_full, val); | 498 | ret = bq27x00_simple_value(di->charge_design_full, val); |
498 | break; | 499 | break; |
499 | case POWER_SUPPLY_PROP_CHARGE_COUNTER: | 500 | case POWER_SUPPLY_PROP_CYCLE_COUNT: |
500 | ret = bq27x00_simple_value(di->cache.charge_counter, val); | 501 | ret = bq27x00_simple_value(di->cache.cycle_count, val); |
501 | break; | 502 | break; |
502 | case POWER_SUPPLY_PROP_ENERGY_NOW: | 503 | case POWER_SUPPLY_PROP_ENERGY_NOW: |
503 | ret = bq27x00_battery_energy(di, val); | 504 | ret = bq27x00_battery_energy(di, val); |