Re: [PATCH v2] thinkpad_acpi: Support the battery wear control

2017-12-04 Thread Ognjen Galic
On Mon, Dec 04, 2017 at 03:53:32PM +0100, Rafael J. Wysocki wrote: > Not really. > > This is generic code, so no thinkpad_acpi-specific stuff in this file, please, > even under #ifdefs. > I have some ideas, and I want your confirmation if that would be acceptable. Can I do this: Expose a new

[PATCH v2] thinkad_acpi: Support the battery wear control

2017-12-03 Thread Ognjen Galic
ose the interface unless DMI says that the machine is a Lenovo ThinkPad. This was done so that distributions that distribute thinkpad_acpi don't expose the API on non-ThinkPad laptops. v2: Forgot to signoff, fixed that Signed-off-by: Ognjen Galic <smclt...@gmail.com> --- Documentation/laptops

[PATCH] thinkad_acpi: Support the battery wear control

2017-12-03 Thread Ognjen Galic
Add support for the ACPI batteries on newer thinkpad models (>Sandy Bridge) that support the setting of start and stop thresholds. The actual interface to the driver is a extension for the existing ACPI battery driver. This was done so that users can write transparently to the interface of the

[PATCH 3/3] thinkpad_acpi: Add support for battery thresholds

2017-12-06 Thread Ognjen Galic
nds on the following patches: "battery: Add the battery hooking API" "battery: Add the ThinkPad "Not Charging" quirk" Signed-off-by: Ognjen Galic <smclt...@gmail.com> --- drivers/platform/x86/thinkpad_acpi.c | 469 ++- 1 file

[PATCH 1/3] battery: Add the battery hooking API

2017-12-06 Thread Ognjen Galic
struct. Then, the drivers can use device_create_file() to create new sysfs attributes with that struct and identify the batteries for per-battery attributes. Signed-off-by: Ognjen Galic <smclt...@gmail.com> --- drivers/acpi/ac.c | 2 +- drivers/acpi/battery.c

[PATCH 2/3] battery: Add the ThinkPad "Not Charging" quirk

2017-12-06 Thread Ognjen Galic
te returns "Not Charging" when the battery on ThinkPads is not physicaly charging. Signed-off-by: Ognjen Galic <smclt...@gmail.com> --- drivers/acpi/battery.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/acpi/battery.c b/driver

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

2017-12-10 Thread Ognjen Galic
te returns "Not Charging" when the battery on ThinkPads is not physicaly charging. Tested-by: Kevin Locke <ke...@kevinlocke.name> Tested-by: Christoph Böhmwalder <christ...@boehmwalder.at> Signed-off-by: Ognjen Galic <smclt...@gmail.com> --- drivers/acpi/battery.c |

[PATCH v1] battery: Add the ThinkPad battery status quirk

2018-04-10 Thread Ognjen Galic
"Fully Charged" instead of "Unknown", the userspace handles everything just fine, displaying for example: "Fully Charged, 59%" in Xfce. This is a re-write of: https://patchwork.kernel.org/patch/10205359/ Signed-off-by: Ognjen Galic <smclt...@gmail.com> --- dr

Re: [PATCH v1] battery: Add the ThinkPad battery status quirk

2018-04-10 Thread Ognjen Galic
On April 10, 2018 12:58:41 PM GMT+02:00, Sebastian Reichel <s...@kernel.org> wrote: >Hi, > >On Tue, Apr 10, 2018 at 11:06:43AM +0200, Ognjen Galic wrote: >> The EC/ACPI firmware on Lenovo ThinkPads used to report a status >> of "Unknown" when the battery i

Re: [PATCH v2] thinkpad_acpi: Support the battery wear control

2017-12-04 Thread Ognjen Galic
On Mon, Dec 04, 2017 at 03:53:32PM +0100, Rafael J. Wysocki wrote: > Not really. > > This is generic code, so no thinkpad_acpi-specific stuff in this file, please, > even under #ifdefs. > I have some ideas, and I want your confirmation if that would be acceptable. Can I do this: Expose a new

[PATCH v1] battery: Add the ThinkPad battery status quirk

2018-04-10 Thread Ognjen Galic
"Fully Charged" instead of "Unknown", the userspace handles everything just fine, displaying for example: "Fully Charged, 59%" in Xfce. This is a re-write of: https://patchwork.kernel.org/patch/10205359/ Signed-off-by: Ognjen Galic --- drivers/acpi/battery.c

Re: [PATCH v1] battery: Add the ThinkPad battery status quirk

2018-04-10 Thread Ognjen Galic
On April 10, 2018 12:58:41 PM GMT+02:00, Sebastian Reichel wrote: >Hi, > >On Tue, Apr 10, 2018 at 11:06:43AM +0200, Ognjen Galic wrote: >> The EC/ACPI firmware on Lenovo ThinkPads used to report a status >> of "Unknown" when the battery is between the charge star

[PATCH 1/3] battery: Add the battery hooking API

2017-12-06 Thread Ognjen Galic
struct. Then, the drivers can use device_create_file() to create new sysfs attributes with that struct and identify the batteries for per-battery attributes. Signed-off-by: Ognjen Galic --- drivers/acpi/ac.c | 2 +- drivers/acpi/battery.c | 139

[PATCH 2/3] battery: Add the ThinkPad "Not Charging" quirk

2017-12-06 Thread Ognjen Galic
te returns "Not Charging" when the battery on ThinkPads is not physicaly charging. Signed-off-by: Ognjen Galic --- drivers/acpi/battery.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 2951d07..1af

[PATCH 3/3] thinkpad_acpi: Add support for battery thresholds

2017-12-06 Thread Ognjen Galic
nds on the following patches: "battery: Add the battery hooking API" "battery: Add the ThinkPad "Not Charging" quirk" Signed-off-by: Ognjen Galic --- drivers/platform/x86/thinkpad_acpi.c | 469 ++- 1 file changed, 468 insertions(+), 1

[PATCH] thinkad_acpi: Support the battery wear control

2017-12-03 Thread Ognjen Galic
Add support for the ACPI batteries on newer thinkpad models (>Sandy Bridge) that support the setting of start and stop thresholds. The actual interface to the driver is a extension for the existing ACPI battery driver. This was done so that users can write transparently to the interface of the

[PATCH v2] thinkad_acpi: Support the battery wear control

2017-12-03 Thread Ognjen Galic
ose the interface unless DMI says that the machine is a Lenovo ThinkPad. This was done so that distributions that distribute thinkpad_acpi don't expose the API on non-ThinkPad laptops. v2: Forgot to signoff, fixed that Signed-off-by: Ognjen Galic --- Documentation/laptops/thinkpad-acpi.txt |

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

2017-12-10 Thread Ognjen Galic
te returns "Not Charging" when the battery on ThinkPads is not physicaly charging. Tested-by: Kevin Locke Tested-by: Christoph Böhmwalder Signed-off-by: Ognjen Galic --- drivers/acpi/battery.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/acpi/