summaryrefslogtreecommitdiff
path: root/drivers/power/max17048_battery.c
diff options
context:
space:
mode:
authorSyed Rafiuddin <srafiuddin@nvidia.com>2013-03-08 14:57:17 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 13:06:41 -0700
commit7361a8d66510e30d8464e64d1ea4d23a284b337c (patch)
treedc3b64aefb80b7b3aae6016c955d1e93cb5b6a2a /drivers/power/max17048_battery.c
parentbb8685a42dbc03a2c773cad8acb41505cc916017 (diff)
power: max17048: resolve charging status update issue
resolving the issue when battery state of charge is 99% and android gui shows as full. Bug 1234697 Bug 1178638 Change-Id: I89ff1a1161f2cc79e55542c0b2dbc299ea31825f Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com> Signed-off-by: Darbha Sriharsha <dsriharsha@nvidia.com> Reviewed-on: http://git-master/r/207506 (cherry picked from commit 73cf40a61cd01395bbf1eaa9ac9e26aa00046f2c) Reviewed-on: http://git-master/r/213903 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/power/max17048_battery.c')
-rw-r--r--drivers/power/max17048_battery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/max17048_battery.c b/drivers/power/max17048_battery.c
index 1a9eff15a0bb..99055ba71a12 100644
--- a/drivers/power/max17048_battery.c
+++ b/drivers/power/max17048_battery.c
@@ -235,9 +235,11 @@ static void max17048_get_soc(struct i2c_client *client)
chip->capacity_level = POWER_SUPPLY_CAPACITY_LEVEL_FULL;
chip->health = POWER_SUPPLY_HEALTH_GOOD;
} else if (chip->soc < MAX17048_BATTERY_LOW) {
+ chip->status = chip->lasttime_status;
chip->health = POWER_SUPPLY_HEALTH_DEAD;
chip->capacity_level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;
} else {
+ chip->status = chip->lasttime_status;
chip->health = POWER_SUPPLY_HEALTH_GOOD;
chip->capacity_level = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
}
@@ -263,7 +265,6 @@ static void max17048_work(struct work_struct *work)
chip->lasttime_vcell = chip->vcell;
chip->lasttime_soc = chip->soc;
- chip->lasttime_status = chip->status;
power_supply_changed(&chip->battery);
}
@@ -289,6 +290,7 @@ void max17048_battery_status(int status,
} else
max17048_data->status = POWER_SUPPLY_STATUS_DISCHARGING;
+ max17048_data->lasttime_status = max17048_data->status;
power_supply_changed(&max17048_data->battery);
if (max17048_data->use_usb)
power_supply_changed(&max17048_data->usb);