瀏覽代碼

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>
Thomas Champagne 15 年之前
父節點
當前提交
d54e7929d8
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/power/pmu_battery.c

+ 2 - 0
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;