power: ds2781: Only report full on charge complete
authorGreg Meiste <w30289@motorola.com>
Wed, 3 Nov 2010 20:49:04 +0000 (15:49 -0500)
committerRebecca Schultz Zavin <rebecca@android.com>
Tue, 16 Nov 2010 02:43:25 +0000 (18:43 -0800)
Only report full when the charge IC says charge is complete.  It is
likely that the DS2781 will report 100% before the charge IC reaches
charge complete.  This change will cause full to be reported at the
same time the charge LED turns green on Stingray.

Change-Id: I4c3be724470b15fb848d284f8786f0458fe463d4
Signed-off-by: Greg Meiste <w30289@motorola.com>
drivers/power/ds2781_battery.c

index 533c0c8a6f31d21805b73a782c0c968f2c7e4c12..ffbf45e0dce592f60b983fd9e35bcb0db408d4b5 100644 (file)
@@ -267,8 +267,7 @@ static int battery_get_property(struct power_supply *psy,
        switch (psp) {
        case POWER_SUPPLY_PROP_STATUS:
                if (is_ac_charging()) {
-                       if ((di->status.battery_full) ||
-                           (di->status.percentage >= 100))
+                       if (di->status.battery_full)
                                val->intval = POWER_SUPPLY_STATUS_FULL;
                        else
                                val->intval = POWER_SUPPLY_STATUS_CHARGING;