Author: thj Date: Fri Nov 23 12:03:01 2018 New Revision: 340832 URL: https://svnweb.freebsd.org/changeset/base/340832
Log: Add support for none ACPI battery method batteries Remove the requirement that a device be a ACPI method battery to be supported as a battery. Require now that the device be in the battery devclass and implement the get_status and get_info functions. This allows batteries which are not ACPI method batteries to be supported. Reviewed by: jtl Approved by: jtl (mentor) MFC after: 1 Month Differential Revision: https://reviews.freebsd.org/D17434 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Fri Nov 23 11:39:24 2018 (r340831) +++ head/sys/dev/acpica/acpi_battery.c Fri Nov 23 12:03:01 2018 (r340832) @@ -169,14 +169,11 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba dev_idx = i; /* - * Be sure we can get various info from the battery. Note that - * acpi_BatteryIsPresent() is not enough because smart batteries only - * return that the device is present. + * Be sure we can get various info from the battery. */ - if (!acpi_BatteryIsPresent(batt_dev) || - ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) - continue; + if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + continue; /* If a battery is not installed, we sometimes get strange values. */ if (!acpi_battery_bst_valid(&bst[i]) || _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"