From: kettenis Date: Sat, 14 Oct 2023 19:02:16 +0000 (+0000) Subject: Document the hw.battery sysctls. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b8b3372e630284bf6558b6074c634868fca7f298;p=openbsd Document the hw.battery sysctls. ok benno@, jmc@, schwarze@ --- diff --git a/lib/libc/sys/sysctl.2 b/lib/libc/sys/sysctl.2 index 31bef7de214..78c69ff5813 100644 --- a/lib/libc/sys/sysctl.2 +++ b/lib/libc/sys/sysctl.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysctl.2,v 1.56 2023/10/12 12:56:26 schwarze Exp $ +.\" $OpenBSD: sysctl.2,v 1.57 2023/10/14 19:02:16 kettenis Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: October 12 2023 $ +.Dd $Mdocdate: October 14 2023 $ .Dt SYSCTL 2 .Os .Sh NAME @@ -277,6 +277,7 @@ privileges may change the value. .Bl -column "Second level name" "integer" "Changeable" -offset indent .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" .It Dv HW_ALLOWPOWERDOWN Ta "integer" Ta "yes" +.It Dv HW_BATTERY Ta "node" Ta "not applicable" .It Dv HW_BYTEORDER Ta "integer" Ta "no" .It Dv HW_CPUSPEED Ta "integer" Ta "no" .It Dv HW_DISKCOUNT Ta "integer" Ta "no" @@ -313,6 +314,42 @@ When running with a .Xr securelevel 7 greater than 0, this variable may not be changed. +.It Dv HW_BATTERY Pq Va hw.battery +Control battery charging. +These are only available on hardware that supports battery charging control. +There are three subnodes: +.Bl -column "HW_BATTERY_CHARGESTART" "integer" "Changeable" -offset indent +.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" +.It Dv HW_BATTERY_CHARGEMODE Ta "integer" Ta "yes" +.It Dv HW_BATTERY_CHARGESTART Ta "integer" Ta "maybe" +.It Dv HW_BATTERY_CHARGESTOP Ta "integer" Ta "yes" +.El +.Pp +Their meanings are as follows: +.Bl -tag -width "123456" +.It Dv HW_BATTERY_CHARGEMODE Pq Va hw.battery.chargemode +Control if the battery is charged or discharged. +A value of -1 means to (forcibly) discharge the battery. +A value of 0 means to inhibit charging the battery. +A value of 1 means to charge the battery, subject to the configured limits. +.It Dv HW_BATTERY_CHARGESTART Pq Va hw.battery.chargestart +The percentage below which the battery will start charging. +Not all hardware allows setting this value. +On hardware that does not allow setting this value the battery will typically +start charging at a fixed percentage point below the value configured through +.Dv HW_BATTERY_CHARGESTOP . +.It Dv HW_BATTERY_CHARGESTOP Pq Va hw.battery.chargestop +The percentage above which the battery will stop charging. +Setting the value to 100 will fully charge the battery. +.El +.Pp +By setting +.Dv HW_BATTERY_CHARGEMODE +to 1, and setting both +.Dv HW_BATTERY_CHARGESTART +and +.Dv HW_BATTERY_CHARGESTOP , +the battery will be kept charged at a percentage between the configured limits. .It Dv HW_BYTEORDER Pq Va hw.byteorder The byteorder (4321 or 1234). .It Dv HW_CPUSPEED Pq Va hw.cpuspeed