diff options
author | Thomas Champagne <lafeuil@gmail.com> | 2009-12-17 19:41:41 -0500 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2009-12-17 19:51:29 -0500 |
commit | d54e7929d8073b0fff8af16f8ff6ebbba6fc4154 (patch) | |
tree | 66f49909a111fcd7a32f96072dffc41484c1dd27 /drivers/power | |
parent | b8a7f3cd7e8212e5c572178ff3b5a514861036a5 (diff) |
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: Thomas Champagne <lafeuil@gmail.com>
Acked-By: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/pmu_battery.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/power/pmu_battery.c b/drivers/power/pmu_battery.c index 9346a862f1f2..9c87ad564803 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, | |||
89 | case POWER_SUPPLY_PROP_STATUS: | 89 | case POWER_SUPPLY_PROP_STATUS: |
90 | if (pbi->flags & PMU_BATT_CHARGING) | 90 | if (pbi->flags & PMU_BATT_CHARGING) |
91 | val->intval = POWER_SUPPLY_STATUS_CHARGING; | 91 | val->intval = POWER_SUPPLY_STATUS_CHARGING; |
92 | else if (pmu_power_flags & PMU_PWR_AC_PRESENT) | ||
93 | val->intval = POWER_SUPPLY_STATUS_FULL; | ||
92 | else | 94 | else |
93 | val->intval = POWER_SUPPLY_STATUS_DISCHARGING; | 95 | val->intval = POWER_SUPPLY_STATUS_DISCHARGING; |
94 | break; | 96 | break; |