diff options
author | Andy Green <andy@openmoko.com> | 2008-11-19 17:10:48 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-19 17:10:48 +0000 |
commit | c286e0b7e63ae3c127fdc7fb574236323c32055b (patch) | |
tree | e07d75c56d4ebad765d287826931986a91d639b0 /drivers/power | |
parent | 9a6555f81a81455566f0d173b8a651e20e6f33e9 (diff) |
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 <andy@openmoko.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/bq27000_battery.c | 10 |
1 files changed, 9 insertions, 1 deletions
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: |