Add final adjustment code of battery status based on the battery capacity

rather than returning unknown status.
This commit is contained in:
Mitsuru IWASAKI 2003-09-17 08:47:39 +00:00
parent 526b5e659d
commit d099a9d164

View File

@ -98,6 +98,15 @@ acpi_capm_convert_battstate(struct acpi_battinfo *battp)
if (battp->state & ACPI_BATT_STAT_CHARGING)
state = 3; /* charging */
/* If still unknown, determine it based on the battery capacity. */
if (state == 0xff) {
if (battp->cap >= 50) {
state = 0; /* high */
} else {
state = 1; /* low */
}
}
return (state);
}