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 <freebsdnew...@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");
_______________________________________________
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"

Reply via email to