From c286e0b7e63ae3c127fdc7fb574236323c32055b Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Nov 2008 17:10:48 +0000 Subject: fix-no-discharging.patch We failed to report status of "discharging", instead reporting "not charging" even if we knew that the charger was not present. This patch corrects it and reports "discharging" when charger is absent. Signed-off-by: Andy Green --- drivers/power/bq27000_battery.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/power') diff --git a/drivers/power/bq27000_battery.c b/drivers/power/bq27000_battery.c index 4c7e862517f..cd4968edad9 100644 --- a/drivers/power/bq27000_battery.c +++ b/drivers/power/bq27000_battery.c @@ -187,9 +187,17 @@ static int bq27000_battery_get_property(struct power_supply *psy, val->intval = POWER_SUPPLY_STATUS_CHARGING; break; } + val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; + break; } - val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; + /* + * platform provided definite indication of charger presence, + * and it is telling us it isn't there... but we are on so we + * must be running from battery ---> + */ + + val->intval = POWER_SUPPLY_STATUS_DISCHARGING; break; use_bat: -- cgit v1.2.3