Commit b19073a0 authored by Alexey Starikovskiy's avatar Alexey Starikovskiy Committed by Len Brown

ACPI: battery: Update battery information upon sysfs read.

Signed-off-by: default avatarAlexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 1544fdbc
...@@ -130,6 +130,8 @@ static int acpi_battery_technology(struct acpi_battery *battery) ...@@ -130,6 +130,8 @@ static int acpi_battery_technology(struct acpi_battery *battery)
return POWER_SUPPLY_TECHNOLOGY_UNKNOWN; return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
} }
static int acpi_battery_update(struct acpi_battery *battery);
static int acpi_battery_get_property(struct power_supply *psy, static int acpi_battery_get_property(struct power_supply *psy,
enum power_supply_property psp, enum power_supply_property psp,
union power_supply_propval *val) union power_supply_propval *val)
...@@ -139,6 +141,7 @@ static int acpi_battery_get_property(struct power_supply *psy, ...@@ -139,6 +141,7 @@ static int acpi_battery_get_property(struct power_supply *psy,
if ((!acpi_battery_present(battery)) && if ((!acpi_battery_present(battery)) &&
psp != POWER_SUPPLY_PROP_PRESENT) psp != POWER_SUPPLY_PROP_PRESENT)
return -ENODEV; return -ENODEV;
acpi_battery_update(battery);
switch (psp) { switch (psp) {
case POWER_SUPPLY_PROP_STATUS: case POWER_SUPPLY_PROP_STATUS:
if (battery->state & 0x01) if (battery->state & 0x01)
......
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