power: max17048: show status as full when 100% charged
Syed Rafiuddin [Tue, 19 Feb 2013 08:40:59 +0000 (13:40 +0530)]
Update status as full when state of charge is 100%
charged.

Bug 1234697

Change-Id: I7c113ef254b848e8374d5251a4cf7d6dcedcf022
Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Reviewed-on: http://git-master/r/200702
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>

drivers/power/max17048_battery.c

index 53ba9e0..fb8af3f 100644 (file)
@@ -229,7 +229,7 @@ static void max17048_get_soc(struct i2c_client *client)
        else
                chip->soc = (uint16_t)soc >> 9;
 
-       if (chip->soc > MAX17048_BATTERY_FULL) {
+       if (chip->soc >= MAX17048_BATTERY_FULL) {
                chip->soc = MAX17048_BATTERY_FULL;
                chip->status = POWER_SUPPLY_STATUS_FULL;
                chip->capacity_level = POWER_SUPPLY_CAPACITY_LEVEL_FULL;