[ibm-acpi-devel] [PATCH 3/3 v5] thinkpad_acpi: Add support for battery thresholds

2017-12-10 Thread Ognjen Galic
This patch uses the new battery hooking API to add support for the ACPI battery wear control present in Lenovo ThinkPads that have >=SandyBridge processors. thinkpad_acpi registers two new attributes for each battery: 1) Charge start threshold /sys/class/power_supply/BATN/charge_start_threshold

[ibm-acpi-devel] [PATCH 2/3 v5] battery: Add the ThinkPad "Not Charging" quirk

2017-12-10 Thread Ognjen Galic
The EC/ACPI firmware on Lenovo ThinkPads used to report a status of "Unknown" when the battery is between the charge start and charge stop thresholds. On Windows, it reports "Not Charging" so the quirk has been added to also report correctly. Now the "status" attribute returns "Not Charging" when

[ibm-acpi-devel] [PATCH 1/3 v5] battery: Add the battery hooking API

2017-12-10 Thread Ognjen Galic
This is a patch that implements a generic hooking API for the generic ACPI battery driver. With this new generic API, drivers can expose platform specific behaviour via sysfs attributes in /sys/class/power_supply/BATn/ in a generic way. A perfect example of the need for this API are Lenovo ThinkP