1 From 2438a8c74c495c95f5b78301a44ed8e8d0b267d5 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Sat, 9 Aug 2008 09:43:32 +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;