Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2018 00:19:45 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339899 - head/sys/dev/acpica
Message-ID:  <201810300019.w9U0Jj3m043818@repo.freebsd.org>

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



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