Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Nov 2018 12:03:01 +0000 (UTC)
From:      Tom Jones <thj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340832 - head/sys/dev/acpica
Message-ID:  <201811231203.wANC317N088510@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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]) ||



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811231203.wANC317N088510>