Skip to content

Commit

Permalink
pmu_battery: Fix battery full reporting
Browse files Browse the repository at this point in the history
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 <lafeuil@gmail.com>
Acked-By: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Thomas Champagne authored and Anton Vorontsov committed Dec 18, 2009
1 parent b8a7f3c commit d54e792
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/power/pmu_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d54e792

Please sign in to comment.