Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2014-04-09 Thread Henrique de Moraes Holschuh
On Sun, 06 Apr 2014, Julian Andres Klode wrote: > OK, tommorow is now, 4 months later. I was to busy with > lectures. An updated patch is below that passes my small > test suite. > > The next step is to integrate this properly with power supply > and/or acpi battery. One way would be to add additi

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2014-04-06 Thread Julian Andres Klode
On Tue, Dec 31, 2013 at 11:46:05PM +0100, Julian Andres Klode wrote: > On Tue, Dec 31, 2013 at 10:12:31AM -0200, Henrique de Moraes Holschuh wrote: > > On Tue, 31 Dec 2013, Julian Andres Klode wrote: > > > We might be able to work around this by simple setting stop = start > > > if a new write caus

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-12-31 Thread Julian Andres Klode
On Tue, Dec 31, 2013 at 10:12:31AM -0200, Henrique de Moraes Holschuh wrote: > On Tue, 31 Dec 2013, Julian Andres Klode wrote: > > We might be able to work around this by simple setting stop = start > > if a new write causes the stop threshold to be below the start > > threshold. But this also seem

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-12-31 Thread Henrique de Moraes Holschuh
On Tue, 31 Dec 2013, Julian Andres Klode wrote: > We might be able to work around this by simple setting stop = start > if a new write causes the stop threshold to be below the start > threshold. But this also seems ugly. It is the safest way, but the correct pseudo-code would be, assuiming unsign

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-12-30 Thread Julian Andres Klode
On Mon, Dec 30, 2013 at 08:40:45PM -0200, Henrique de Moraes Holschuh wrote: > On Mon, 30 Dec 2013, Henrique de Moraes Holschuh wrote: > > On Mon, 30 Dec 2013, Julian Andres Klode wrote: > > > On Mon, Nov 11, 2013 at 02:56:30PM +0100, Julian Andres Klode wrote: > > > > Add support for battery charg

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-12-30 Thread Henrique de Moraes Holschuh
On Mon, 30 Dec 2013, Henrique de Moraes Holschuh wrote: > On Mon, 30 Dec 2013, Julian Andres Klode wrote: > > On Mon, Nov 11, 2013 at 02:56:30PM +0100, Julian Andres Klode wrote: > > > Add support for battery charge thresholds in new Sandy Bridge and Ivy > > > Bridge > > > ThinkPads. Based on the

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-12-30 Thread Henrique de Moraes Holschuh
On Mon, 30 Dec 2013, Julian Andres Klode wrote: > On Mon, Nov 11, 2013 at 02:56:30PM +0100, Julian Andres Klode wrote: > > Add support for battery charge thresholds in new Sandy Bridge and Ivy Bridge > > ThinkPads. Based on the unofficial documentation in tpacpi-bat. > > > > The threshold files su

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-12-30 Thread Julian Andres Klode
On Mon, Nov 11, 2013 at 02:56:30PM +0100, Julian Andres Klode wrote: > Add support for battery charge thresholds in new Sandy Bridge and Ivy Bridge > ThinkPads. Based on the unofficial documentation in tpacpi-bat. > > The threshold files support the values '0' for the controller's default, > and 1

Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-11-13 Thread Julian Andres Klode
On Mon, Nov 11, 2013 at 02:56:30PM +0100, Julian Andres Klode wrote: > +static int __init battery_init(struct ibm_init_struct *iibm) > + for (i = 0; i < BATTERY_MAX_COUNT; i++) { > + int j = 0; > + if (!acpi_evalf(hkey_handle, &state, "BCTG", "qdd", i + 1)) > +

[ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds

2013-11-11 Thread Julian Andres Klode
Add support for battery charge thresholds in new Sandy Bridge and Ivy Bridge ThinkPads. Based on the unofficial documentation in tpacpi-bat. The threshold files support the values '0' for the controller's default, and 1-99 as percentages. Values outside of that range are rejected. The behaviour of