From owner-svn-src-head@freebsd.org Fri Nov 23 12:03:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E120114532F; Fri, 23 Nov 2018 12:03:03 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03C8386457; Fri, 23 Nov 2018 12:03:02 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4ABC1E503; Fri, 23 Nov 2018 12:03:01 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANC31B8088511; Fri, 23 Nov 2018 12:03:01 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANC317N088510; Fri, 23 Nov 2018 12:03:01 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201811231203.wANC317N088510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Fri, 23 Nov 2018 12:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340832 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 340832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03C8386457 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.39)[0.390,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 12:03:03 -0000 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]) ||