diff options
Diffstat (limited to 'sys/dev/acpica/acpi_battery.c')
-rw-r--r-- | sys/dev/acpica/acpi_battery.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c index 06fd60d..995b380 100644 --- a/sys/dev/acpica/acpi_battery.c +++ b/sys/dev/acpica/acpi_battery.c @@ -244,6 +244,13 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo) battinfo->state = bi[dev_idx].state; battinfo->rate = bst[dev_idx].rate; } + + /* + * If the queried battery has no discharge rate or is charging, + * report that we don't know the remaining time. + */ + if (valid_rate == 0 || (battinfo->state & ACPI_BATT_STAT_CHARGING)) + battinfo->min = -1; } else acpi_reset_battinfo(battinfo); |