From: Julian Andres Klode <jak@jak-linux.org>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Julian Andres Klode <jak@jak-linux.org>,
Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>,
Matthew Garrett <matthew.garrett@nebula.com>,
"open list:THINKPAD ACPI EXT..."
<ibm-acpi-devel@lists.sourceforge.net>,
"open list:THINKPAD ACPI EXT..."
<platform-driver-x86@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [ibm-acpi-devel] [PATCH 1/4] thinkpad_acpi: Add support for controlling charge thresholds
Date: Tue, 31 Dec 2013 23:46:05 +0100 [thread overview]
Message-ID: <20131231224605.GA32669@jak-x230> (raw)
In-Reply-To: <20131231121231.GB25729@khazad-dum.debian.net>
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 seems ugly.
>
> It is the safest way, but the correct pseudo-code would be, assuiming
> unsigned:
>
> when someone changes start:
>
> if (start > 99)
> start = 99;
I think we should just return -EINVAL in such cases. Allowing users to
write larger percentages is a bit pointless (we don't allow them to write
negative ones either). And other promiment code (the backlight drivers)
seem to reject out-of-range values.
> set_thresholds(start, stop);
I think there should not be some common set_thresholds, because we also
need to write things in different orders for start / stop then:
DECREASE STOP => Write new start if needed, then write stop
INCREASE START => Write new stop if needed, then write start
Otherwise we might have a very very very short time in which start
is greater than stop.
I'll incorporate this in real code and test it tomorrow.
Sometimes after that, I'd like to tackle the integration with power_supply.
This is a bit more complicated, there even appear to be two battery drivers
in ACPI, namely battery and sbs, and battery is used on my system (I don't
know if that's the generic case on ThinkPads, or if is the case because
battery is builtin and sbs is not). How to do extend that is probably
something best discussed with ACPI maintainers, as I can't see
any mechanism for this.
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Please do not top-post if possible.
next prev parent reply other threads:[~2013-12-31 22:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-11 13:56 [PATCH 0/4] thinkpad_acpi: Add support for controlling charge thresholds Julian Andres Klode
2013-11-11 13:56 ` [PATCH 1/4] " Julian Andres Klode
2013-11-13 13:50 ` Julian Andres Klode
2013-12-30 13:29 ` Julian Andres Klode
2013-12-30 21:58 ` Henrique de Moraes Holschuh
2013-12-30 22:40 ` Henrique de Moraes Holschuh
2013-12-31 0:01 ` Julian Andres Klode
2013-12-31 12:12 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2013-12-31 22:46 ` Julian Andres Klode [this message]
2014-04-06 12:14 ` Julian Andres Klode
2014-04-09 18:00 ` Henrique de Moraes Holschuh
2013-11-11 13:56 ` [PATCH 2/4] thinkpad_acpi: battery: Add force_discharge attribute Julian Andres Klode
2013-11-11 13:56 ` [PATCH 3/4] thinkpad_acpi: battery: Add force_discharge_ac_break attribute Julian Andres Klode
2013-11-11 13:56 ` [PATCH 4/4] thinkpad_acpi: battery: Add inhibit_charge_minutes attribute Julian Andres Klode
2013-11-25 14:59 ` [PATCH 0/4] thinkpad_acpi: Add support for controlling charge thresholds Julian Andres Klode
2013-12-28 21:10 ` Julian Andres Klode
2013-12-28 22:10 ` Henrique de Moraes Holschuh
2013-12-30 13:26 ` Julian Andres Klode
2013-12-30 20:06 ` Henrique de Moraes Holschuh
2014-01-20 21:22 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131231224605.GA32669@jak-x230 \
--to=jak@jak-linux.org \
--cc=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ibm-acpi@hmh.eng.br \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.garrett@nebula.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox