Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252139
b: refs/heads/master
c: 73c244a
h: refs/heads/master
i:
  252137: 61e277d
  252135: 250f7e7
v: v3
  • Loading branch information
Pali Rohár authored and Anton Vorontsov committed May 20, 2011
1 parent c744e66 commit 71c1d76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f9efe76cb213e9b0dd89e465efaf9725f4bf492
refs/heads/master: 73c244a8a5541e3a1a1997be671b019a220a66e8
11 changes: 6 additions & 5 deletions trunk/drivers/power/bq27x00_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright (C) 2008 Rodolfo Giometti <giometti@linux.it>
* Copyright (C) 2008 Eurotech S.p.A. <info@eurotech.it>
* 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.
*
Expand Down Expand Up @@ -76,7 +77,7 @@ struct bq27x00_reg_cache {
int time_to_empty_avg;
int time_to_full;
int charge_full;
int charge_counter;
int cycle_count;
int capacity;
int flags;

Expand Down Expand Up @@ -115,7 +116,7 @@ static enum power_supply_property bq27x00_battery_props[] = {
POWER_SUPPLY_PROP_CHARGE_FULL,
POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
POWER_SUPPLY_PROP_CHARGE_COUNTER,
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_ENERGY_NOW,
};

Expand Down Expand Up @@ -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_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF);
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)
cache.current_now = bq27x00_read(di, BQ27x00_REG_AI, false);
Expand Down Expand Up @@ -496,8 +497,8 @@ static int bq27x00_battery_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
ret = bq27x00_simple_value(di->charge_design_full, val);
break;
case POWER_SUPPLY_PROP_CHARGE_COUNTER:
ret = bq27x00_simple_value(di->cache.charge_counter, val);
case POWER_SUPPLY_PROP_CYCLE_COUNT:
ret = bq27x00_simple_value(di->cache.cycle_count, val);
break;
case POWER_SUPPLY_PROP_ENERGY_NOW:
ret = bq27x00_battery_energy(di, val);
Expand Down

0 comments on commit 71c1d76

Please sign in to comment.