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

2017-12-31 Thread Andy Shevchenko
On Sat, Dec 30, 2017 at 1:49 AM, Ognjen Galić wrote: > On Čet, 2017-12-28 at 10:19 +0200, Andy Shevchenko wrote: >> On Sat, Dec 23, 2017 at 12:53 PM, Ognjen Galic >> wrote: >> > >> > This patch adds the to_power_supply macro to upcast >> > a device to a power_supply struct. >> > >> > This is need

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

2017-12-31 Thread Rafael J. Wysocki
On Sun, Dec 31, 2017 at 10:37 AM, Andy Shevchenko wrote: > On Sat, Dec 30, 2017 at 1:49 AM, Ognjen Galić wrote: >> On Čet, 2017-12-28 at 10:19 +0200, Andy Shevchenko wrote: >>> On Sat, Dec 23, 2017 at 12:53 PM, Ognjen Galic >>> wrote: >>> > >>> > This patch adds the to_power_supply macro to upca

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

2017-12-31 Thread Andy Shevchenko
On Sun, Dec 31, 2017 at 1:17 PM, Rafael J. Wysocki wrote: > On Sun, Dec 31, 2017 at 10:37 AM, Andy Shevchenko > wrote: >> On Sat, Dec 30, 2017 at 1:49 AM, Ognjen Galić wrote: >> You definitely need to send a new revision with all comments >> addressed. So far you didn't responce to them which I

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

2017-12-31 Thread Ognjen Galić
On Sun, Dec 31, 2017 at 02:40:41PM +0200, Andy Shevchenko wrote: > On Sun, Dec 31, 2017 at 1:17 PM, Rafael J. Wysocki wrote: > > On Sun, Dec 31, 2017 at 10:37 AM, Andy Shevchenko > > wrote: > >> On Sat, Dec 30, 2017 at 1:49 AM, Ognjen Galić wrote: > > >> You definitely need to send a new revisi

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

2017-12-31 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 v11 1/5] battery: Add the battery hooking API

2017-12-31 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 v11 3/5] thinkpad_acpi: Add support for battery thresholds

2017-12-31 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 v11 4/5] battery: Add the ThinkPad "Not Charging" quirk

2017-12-31 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 v11 5/5] pm: Remove to_power_supply impl in ds278*

2017-12-31 Thread Ognjen Galic
This patch fixes a issue introduced by patch: pm: add to_power_supply macro to the API In that patch a new macro has been defined in the power_supply.h header with the same name as the private function name in the ds278* battery modules that does the same thing, thus clashing and producing build e