diff options
author | Grazvydas Ignotas <notasas@gmail.com> | 2010-02-27 17:06:44 +0200 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-02-27 18:09:24 +0300 |
commit | afbc74fdc5b96552c384e57119b3cc13c840bf06 (patch) | |
tree | 34d495ce443ce5d6fbfaa4d17bce816f5b73e984 /drivers/power | |
parent | 4e924a814ac78e325653840190e9e4762e6f4b7c (diff) |
power_supply: bq27x00: fix voltage and current units
The chip returns voltage and current in mV and mA, but
power supply class uses uV and uA, so add missing conversion.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/bq27x00_battery.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c index 5d940fad8d43..bece33ed873c 100644 --- a/drivers/power/bq27x00_battery.c +++ b/drivers/power/bq27x00_battery.c @@ -125,7 +125,7 @@ static int bq27x00_battery_voltage(struct bq27x00_device_info *di) return ret; } - return volt; + return volt * 1000; } /* @@ -156,11 +156,11 @@ static int bq27x00_battery_current(struct bq27x00_device_info *di) } if (flags & BQ27000_FLAG_CHGS) { dev_dbg(di->dev, "negative current!\n"); - return -curr; + curr = -curr; } } - return curr; + return curr * 1000; } /* |