1 From 8d2916df234dc4762dd019db2ace105a6e744894 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Sun, 10 Aug 2008 09:15:59 +0100
4 Subject: [PATCH] fix-pcf50633-usbrem-charging-led.patch
6 If the charger was removed, we fell through back to old
7 hdq-driven code with normally wrong but slightly random
8 results for charging LED behaviour in that circumstance
10 This patch makes us use the tracked charger status
11 callbacks alone if they are defined in the platform
14 Signed-off-by: Andy Green <andy@openmoko.com>
16 drivers/power/bq27000_battery.c | 12 ++++++++----
17 1 files changed, 8 insertions(+), 4 deletions(-)
19 diff --git a/drivers/power/bq27000_battery.c b/drivers/power/bq27000_battery.c
20 index 7020608..4c7e862 100644
21 --- a/drivers/power/bq27000_battery.c
22 +++ b/drivers/power/bq27000_battery.c
23 @@ -182,12 +182,16 @@ static int bq27000_battery_get_property(struct power_supply *psy,
25 if (!di->pdata->get_charger_active_status)
27 - if ((di->pdata->get_charger_active_status)())
29 + if ((di->pdata->get_charger_active_status)()) {
30 val->intval = POWER_SUPPLY_STATUS_CHARGING;
32 - val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
38 + val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
43 * either the charger is not connected, or the