Commit d54e7929 authored by Thomas Champagne's avatar Thomas Champagne Committed by Anton Vorontsov

pmu_battery: Fix battery full reporting

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: default avatarThomas Champagne <lafeuil@gmail.com>
Acked-By: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent b8a7f3cd
...@@ -89,6 +89,8 @@ static int pmu_bat_get_property(struct power_supply *psy, ...@@ -89,6 +89,8 @@ static int pmu_bat_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_STATUS: case POWER_SUPPLY_PROP_STATUS:
if (pbi->flags & PMU_BATT_CHARGING) if (pbi->flags & PMU_BATT_CHARGING)
val->intval = POWER_SUPPLY_STATUS_CHARGING; val->intval = POWER_SUPPLY_STATUS_CHARGING;
else if (pmu_power_flags & PMU_PWR_AC_PRESENT)
val->intval = POWER_SUPPLY_STATUS_FULL;
else else
val->intval = POWER_SUPPLY_STATUS_DISCHARGING; val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment