summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyed Rafiuddin <srafiuddin@nvidia.com>2012-04-11 15:45:46 +0530
committerSimone Willett <swillett@nvidia.com>2012-05-01 14:08:08 -0700
commit450337a3707bd4964b0bd39e2d0118ed6f56756a (patch)
tree76e023f86c054ea71ab765f4e42a63363d38389f
parent5bdd03b21f625d0a07c66e4894b79e557287a3a1 (diff)
power: max17048: correcting vcell calcualtion
Vcell is calculated based on upper 12msb's of ADC result. Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com> Reviewed-on: http://git-master/r/95830 (cherry picked from commit e550636d9b03207b9d4fecf078168175964d85fd) Change-Id: Ic2834d8c8576b938e9d7d400c2beeb459ddeb5fc Reviewed-on: http://git-master/r/98669 Reviewed-by: Syed Rafiuddin <srafiuddin@nvidia.com> Tested-by: Syed Rafiuddin <srafiuddin@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/power/max17048_battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/max17048_battery.c b/drivers/power/max17048_battery.c
index e6dee61cc9b4..c65855f72dba 100644
--- a/drivers/power/max17048_battery.c
+++ b/drivers/power/max17048_battery.c
@@ -177,7 +177,7 @@ static void max17048_get_vcell(struct i2c_client *client)
if (vcell < 0)
dev_err(&client->dev, "%s: err %d\n", __func__, vcell);
else
- chip->vcell = (uint16_t)vcell;
+ chip->vcell = (uint16_t)(((vcell >> 4) * 125) / 100);
}
static void max17048_get_soc(struct i2c_client *client)