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

2018-01-03 Thread Ognjen Galić
On Mon, Jan 01, 2018 at 12:24:39PM +0200, Andy Shevchenko wrote: > On Sun, Dec 31, 2017 at 4:17 PM, Ognjen Galic wrote: > > thinkpad_acpi registers two new attributes for each battery: > > > > 1) Charge start threshold > > /sys/class/power_supply/BATN/charge_start_threshold > > > > Valid values ar

Re: [ibm-acpi-devel] [PATCH] Add Thinkpad palm detection acpi codes to thinkpad_acpi

2018-01-03 Thread Henrique de Moraes Holschuh
On Tue, 02 Jan 2018, mth...@mthode.org wrote: > From: Matthew Thode > > Signed-off-by: Matthew Thode Please, could you add some far more verbose explanations to the (currently empty) commit log? Such as: which thinkpad models you know to have this feature, how one is expected to use it, in whi

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

2018-01-03 Thread Rafael J. Wysocki
On Wednesday, January 3, 2018 11:34:55 AM CET Ognjen Galić wrote: > On Mon, Jan 01, 2018 at 12:24:39PM +0200, Andy Shevchenko wrote: > > On Sun, Dec 31, 2017 at 4:17 PM, Ognjen Galic wrote: > > > thinkpad_acpi registers two new attributes for each battery: > > > > > > 1) Charge start threshold > >

[ibm-acpi-devel] [PATCH v12 1/4] battery: Add the battery hooking API

2018-01-03 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

[ibm-acpi-devel] [PATCH v12 2/4] pm: add to_power_supply macro to the API

2018-01-03 Thread Ognjen Galic
This patch adds the to_power_supply macro to upcast a device to a power_supply struct. This is needed because the same piece of code using container_of is used in various other places, so we abstract away such low-level operations via a macro. Suggested-by: Andy Shevchenko Signed-off-by: Ognjen

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

2018-01-03 Thread Ognjen Galic
thinkpad_acpi registers two new attributes for each battery: 1) Charge start threshold /sys/class/power_supply/BATN/charge_start_threshold Valid values are [0, 99]. A value of 0 turns off the start threshold wear control. 2) Charge stop threshold /sys/class/power_supply/BATN/charge_stop_threshol

[ibm-acpi-devel] [PATCH v12 4/4] battery: Add the ThinkPad "Not Charging" quirk

2018-01-03 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

Re: [ibm-acpi-devel] [PATCH v12 1/4] battery: Add the battery hooking API

2018-01-03 Thread Andy Shevchenko
On Wed, Jan 3, 2018 at 1:58 PM, Ognjen Galic wrote: > 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 wa

Re: [ibm-acpi-devel] [PATCH v12 2/4] pm: add to_power_supply macro to the API

2018-01-03 Thread Andy Shevchenko
On Wed, Jan 3, 2018 at 1:59 PM, Ognjen Galic wrote: > This patch adds the to_power_supply macro to upcast > a device to a power_supply struct. > > This is needed because the same piece of code using > container_of is used in various other places, so we > abstract away such low-level operations via

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

2018-01-03 Thread Andy Shevchenko
On Wed, Jan 3, 2018 at 1:59 PM, Ognjen Galic wrote: > thinkpad_acpi registers two new attributes for each battery: > > 1) Charge start threshold > /sys/class/power_supply/BATN/charge_start_threshold > > Valid values are [0, 99]. A value of 0 turns off the > start threshold wear control. > > 2) Cha

Re: [ibm-acpi-devel] [PATCH v12 4/4] battery: Add the ThinkPad "Not Charging" quirk

2018-01-03 Thread Andy Shevchenko
On Wed, Jan 3, 2018 at 1:59 PM, Ognjen Galic wrote: > 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 correc

Re: [ibm-acpi-devel] [PATCH v12 1/4] battery: Add the battery hooking API

2018-01-03 Thread Ognjen Galić
On Wed, Jan 03, 2018 at 04:25:42PM +0200, Andy Shevchenko wrote: > On Wed, Jan 3, 2018 at 1:58 PM, Ognjen Galic wrote: > > 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 > > beha

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

2018-01-03 Thread Ognjen Galić
On Wed, Jan 03, 2018 at 04:42:35PM +0200, Andy Shevchenko wrote: > On Wed, Jan 3, 2018 at 1:59 PM, Ognjen Galic wrote: > > thinkpad_acpi registers two new attributes for each battery: > > > > 1) Charge start threshold > > /sys/class/power_supply/BATN/charge_start_threshold > > > > Valid values are

Re: [ibm-acpi-devel] [PATCH v12 1/4] battery: Add the battery hooking API

2018-01-03 Thread Andy Shevchenko
On Wed, Jan 3, 2018 at 4:53 PM, Ognjen Galić wrote: > On Wed, Jan 03, 2018 at 04:25:42PM +0200, Andy Shevchenko wrote: >> On Wed, Jan 3, 2018 at 1:58 PM, Ognjen Galic wrote: >> Thanks for an update. I have couple of minors. Otherwise look pretty much >> good! >> >> > drivers/acpi/battery.h |