svn commit: r339899 - head/sys/dev/acpica
John Baldwin
jhb at FreeBSD.org
Tue Oct 30 00:19:45 UTC 2018
Author: jhb
Date: Tue Oct 30 00:19:44 2018
New Revision: 339899
URL: https://svnweb.freebsd.org/changeset/base/339899
Log:
Make battery emptying rate available as sysctl variable.
Curiously, the in-kernel routines always use the design voltage to
convert from mA to mW, but acpiconf in userland uses the current
voltage. As a result, this can report a different mW rate than
acpiconf.
Submitted by: Manuel Stühn <freebsdnewbie at freenet.de>
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D17077
Modified:
head/sys/dev/acpica/acpi_battery.c
Modified: head/sys/dev/acpica/acpi_battery.c
==============================================================================
--- head/sys/dev/acpica/acpi_battery.c Tue Oct 30 00:11:30 2018 (r339898)
+++ head/sys/dev/acpica/acpi_battery.c Tue Oct 30 00:19:44 2018 (r339899)
@@ -487,6 +487,11 @@ acpi_battery_init(void)
"remaining time in minutes");
SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx,
SYSCTL_CHILDREN(acpi_battery_sysctl_tree),
+ OID_AUTO, "rate", CTLTYPE_INT | CTLFLAG_RD,
+ &acpi_battery_battinfo.rate, 0, acpi_battery_sysctl, "I",
+ "present rate in mW");
+ SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx,
+ SYSCTL_CHILDREN(acpi_battery_sysctl_tree),
OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RD,
&acpi_battery_battinfo.state, 0, acpi_battery_sysctl, "I",
"current status flags");
More information about the svn-src-head
mailing list