From c4f99cbeb9e1b34dbdd67cf102e62ade2d8cb7fa Mon Sep 17 00:00:00 2001 From: Greg Meiste Date: Tue, 7 Sep 2010 11:24:08 -0500 Subject: [PATCH] power: ds2781: Report charging correctly Previously, charging was being reporting whenever a charger was present. While true most of the time, there are cases where that won't be the case. This patch updates the driver to only report charging if charging is actually occurring. Change-Id: Ibc5881fed5d11f89d87d0c7adcd7ac1c2b273688 Signed-off-by: Greg Meiste --- drivers/power/ds2781_battery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/ds2781_battery.c b/drivers/power/ds2781_battery.c index 6803eb482e2a..2548d9fc83ca 100644 --- a/drivers/power/ds2781_battery.c +++ b/drivers/power/ds2781_battery.c @@ -37,6 +37,7 @@ #include "../w1/w1.h" #include "../w1/slaves/w1_ds2781.h" +extern int is_ac_charging(void); extern int is_ac_charge_complete(void); struct battery_status { @@ -248,7 +249,7 @@ static int battery_get_property(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_STATUS: - if (di->status.charge_source) { + if (is_ac_charging()) { if ((di->status.battery_full) || (di->status.percentage >= 100)) val->intval = POWER_SUPPLY_STATUS_FULL; -- 2.34.1