projects/linux·commit d54e7929

pmu_battery: Fix battery full reporting

d54e7929 · Thomas Champagne <[email protected]> · 2009-12-18 03:41:41 +03:00

Prior to this patch, pmu_battery was unable to report battery full
status. This patch fixes the issue by adding a proper handling code
into pmu_bat_get_property(): if we're on AC and the battery isn't
charging, then the battery is considered full.

Signed-off-by: Thomas Champagne <[email protected]>
Acked-By: David Woodhouse <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
Commit
d54e7929d8073b0fff8af16f8ff6ebbba6fc4154
Parents
b8a7f3cd

Changes

1 files changed · +2 −0

FileStatusAddDelContent
drivers/power/pmu_battery.cmodified+2−0View file

drivers/power/pmu_battery.c

View file
diff --git a/drivers/power/pmu_battery.c b/drivers/power/pmu_battery.c
index 9346a86..9c87ad5 100644
--- a/drivers/power/pmu_battery.c
+++ b/drivers/power/pmu_battery.c
@@ -89,6 +89,8 @@ static int pmu_bat_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_STATUS:
if (pbi->flags & PMU_BATT_CHARGING)
val->intval = POWER_SUPPLY_STATUS_CHARGING;
+ else if (pmu_power_flags & PMU_PWR_AC_PRESENT)
+ val->intval = POWER_SUPPLY_STATUS_FULL;
else
val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
break;