diff options
| author | Nate Lawson <njl@FreeBSD.org> | 2005-07-25 17:44:10 +0000 |
|---|---|---|
| committer | Nate Lawson <njl@FreeBSD.org> | 2005-07-25 17:44:10 +0000 |
| commit | f4e31e2e89e9906a5b2d28ffcc232bda7251f06c (patch) | |
| tree | 42723e121f3b230ededb756b9638c104ee2a6f00 /sys/dev | |
| parent | 336a1a7b37d87d8c670dd08e09249e9b950b7ed4 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -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 06fd60d634058..995b380853df7 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); |
