1 From 8d2acef7c5d7179db19b3c8a0ae9ae4c152faaff Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Sun, 10 Aug 2008 09:16:04 +0100
4 Subject: [PATCH] fix-no-discharging.patch
6 We failed to report status of "discharging", instead reporting
7 "not charging" even if we knew that the charger was not present.
9 This patch corrects it and reports "discharging" when charger
12 Signed-off-by: Andy Green <andy@openmoko.com>
14 drivers/power/bq27000_battery.c | 10 +++++++++-
15 1 files changed, 9 insertions(+), 1 deletions(-)
17 diff --git a/drivers/power/bq27000_battery.c b/drivers/power/bq27000_battery.c
18 index 4c7e862..cd4968e 100644
19 --- a/drivers/power/bq27000_battery.c
20 +++ b/drivers/power/bq27000_battery.c
21 @@ -187,9 +187,17 @@ static int bq27000_battery_get_property(struct power_supply *psy,
22 val->intval = POWER_SUPPLY_STATUS_CHARGING;
25 + val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
29 - val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
31 + * platform provided definite indication of charger presence,
32 + * and it is telling us it isn't there... but we are on so we
33 + * must be running from battery --->
36 + val->intval = POWER_SUPPLY_STATUS_DISCHARGING;