Commit 73c244a8 authored by Pali Rohár's avatar Pali Rohár Committed by Anton Vorontsov

bq27x00_battery: Name of cycle count property

This patch fix using correct property POWER_SUPPLY_PROP_CYCLE_COUNT
for cycle count instead POWER_SUPPLY_PROP_CHARGE_COUNTER
Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
Tested-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent 6f9efe76
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 2008 Rodolfo Giometti <giometti@linux.it> * Copyright (C) 2008 Rodolfo Giometti <giometti@linux.it>
* Copyright (C) 2008 Eurotech S.p.A. <info@eurotech.it> * Copyright (C) 2008 Eurotech S.p.A. <info@eurotech.it>
* Copyright (C) 2010-2011 Lars-Peter Clausen <lars@metafoo.de> * Copyright (C) 2010-2011 Lars-Peter Clausen <lars@metafoo.de>
* Copyright (C) 2011 Pali Rohár <pali.rohar@gmail.com>
* *
* Based on a previous work by Copyright (C) 2008 Texas Instruments, Inc. * Based on a previous work by Copyright (C) 2008 Texas Instruments, Inc.
* *
...@@ -76,7 +77,7 @@ struct bq27x00_reg_cache { ...@@ -76,7 +77,7 @@ struct bq27x00_reg_cache {
int time_to_empty_avg; int time_to_empty_avg;
int time_to_full; int time_to_full;
int charge_full; int charge_full;
int charge_counter; int cycle_count;
int capacity; int capacity;
int flags; int flags;
...@@ -115,7 +116,7 @@ static enum power_supply_property bq27x00_battery_props[] = { ...@@ -115,7 +116,7 @@ static enum power_supply_property bq27x00_battery_props[] = {
POWER_SUPPLY_PROP_CHARGE_FULL, POWER_SUPPLY_PROP_CHARGE_FULL,
POWER_SUPPLY_PROP_CHARGE_NOW, POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
POWER_SUPPLY_PROP_CHARGE_COUNTER, POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_ENERGY_NOW, POWER_SUPPLY_PROP_ENERGY_NOW,
}; };
...@@ -267,7 +268,7 @@ static void bq27x00_update(struct bq27x00_device_info *di) ...@@ -267,7 +268,7 @@ static void bq27x00_update(struct bq27x00_device_info *di)
cache.time_to_empty_avg = bq27x00_battery_read_time(di, BQ27x00_REG_TTECP); cache.time_to_empty_avg = bq27x00_battery_read_time(di, BQ27x00_REG_TTECP);
cache.time_to_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF); cache.time_to_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF);
cache.charge_full = bq27x00_battery_read_lmd(di); cache.charge_full = bq27x00_battery_read_lmd(di);
cache.charge_counter = bq27x00_battery_read_cyct(di); cache.cycle_count = bq27x00_battery_read_cyct(di);
if (!is_bq27500) if (!is_bq27500)
cache.current_now = bq27x00_read(di, BQ27x00_REG_AI, false); 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,8 +497,8 @@ static int bq27x00_battery_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
ret = bq27x00_simple_value(di->charge_design_full, val); ret = bq27x00_simple_value(di->charge_design_full, val);
break; break;
case POWER_SUPPLY_PROP_CHARGE_COUNTER: case POWER_SUPPLY_PROP_CYCLE_COUNT:
ret = bq27x00_simple_value(di->cache.charge_counter, val); ret = bq27x00_simple_value(di->cache.cycle_count, val);
break; break;
case POWER_SUPPLY_PROP_ENERGY_NOW: case POWER_SUPPLY_PROP_ENERGY_NOW:
ret = bq27x00_battery_energy(di, val); ret = bq27x00_battery_energy(di, val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment