diff options
author | Arun Murthy <arun.murthy@stericsson.com> | 2011-06-28 10:10:11 +0530 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 16:00:09 +0200 |
commit | 76419571ff2759906c7a90312df8b523340d6959 (patch) | |
tree | 5792baffa691d6ecd2554cf734e824789a7ac266 /drivers/power | |
parent | 05b2ca19f7b6548b129b85ac7feca5200ea75946 (diff) |
power: ab5500-fg: update battery capacity
Battery capacity is updated at boot time and thereafter not
updated. Battery capacity is based on the lookup table provided
by the battery vendors.
ST-Ericsson Linux next: Not Tested
ST-Ericsson ID: ER349552
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I9cb7b01bccf2dc76e5d68c374fbb1d95120baa06
Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25933
Reviewed-by: QATEST
Reviewed-by: Johan PALSSON <johan.palsson@stericsson.com>
Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/ab5500_fg.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/power/ab5500_fg.c b/drivers/power/ab5500_fg.c index 919af5faadf..95f31cb84cb 100644 --- a/drivers/power/ab5500_fg.c +++ b/drivers/power/ab5500_fg.c @@ -359,7 +359,7 @@ cc_err: */ static int ab5500_fg_inst_curr(struct ab5500_fg *di) { - u8 low, high, value; + u8 low, high; static int val; int ret = 0; bool fg_off = false; @@ -1378,9 +1378,11 @@ static int ab5500_fg_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_NOW: if (di->flags.bat_ovv) val->intval = 47500000; - else - val->intval = ab5500_gpadc_convert - (di->gpadc, MAIN_BAT_V) * 1000; + else { + di->vbat = ab5500_gpadc_convert + (di->gpadc, MAIN_BAT_V); + val->intval = di->vbat * 1000; + } break; case POWER_SUPPLY_PROP_CURRENT_NOW: di->inst_curr = ab5500_fg_inst_curr(di); |