Page MenuHomeFreeBSD

Add _BTP method to control method batteries
Needs ReviewPublic

Authored by georg.lindenberg_web.de on Fri, Jul 31, 9:18 PM.

Details

Reviewers
hrs
takawata
Summary

_BTP is an optional, write-only method in control method batteries.
It allows you to set a warning level (trip point), which will
generate a devd CMBAT event.
If supported, sysctl dev.battery.X.warning_level is created.

Test Plan

acpidump -dt |grep _BTP tells you whether your battery supports this.
I tested it on a Thinkpad x220.
It should be noted that I am fairly new at kernel programming.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 32686
Build 30136: arc lint + arc unit

Event Timeline

georg.lindenberg_web.de requested review of this revision.Fri, Jul 31, 9:18 PM

Looks good. I have one comment inline.

sys/dev/acpica/acpi_cmbat.c
602

How about allowing 0 to clear trip point ?