From: Ken Milmore <ken.milmore@gmail.com>
To: linux-kernel@vger.kernel.org,
Jouke Witteveen <j.witteveen@gmail.com>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Subject: thinkpad_acpi: Battery quirk for Thinkpad 11e (4th gen)
Date: Sun, 24 Feb 2019 14:58:41 +0000 [thread overview]
Message-ID: <333cc78c-7537-7898-d753-17352df893aa@gmail.com> (raw)
I recently acquired a Thinkpad 11e 4th gen (Type 20HV, BIOS version
R0KET36W, EC program R0KHT18W). I've put Debian Buster on it, with the
4.19 kernel, which gives the following errors in dmesg:
ACPI: \_SB_.PCI0.LPCB.EC__.HKEY: BCTG evaluated but flagged as error
thinkpad_acpi: Error probing battery 2
battery: error in extension, unloading: ThinkPad Battery Extension
I wanted to try using the battery charging thresholds, so I added an
entry to the battery quirk table in thinkpad_acpi.c (patch given below),
which allows the battery extension to load successfully.
Setting charge thresholds seems to basically work, but one thing worth
mentioning is that charge_start_threshold and charge_stop_threshold
appear to be tied together; AFAICT setting one also sets the other to
the same value. The battery does seem to start charging whenever it
falls below the common threshold, I have it set at 80% and it has kept
the battery floating around 79%.
Battery status is reported correctly when charging or discharging; when
charging has been suppressed because the battery level is above the
threshold, then the status is reported as "Unknown".
diff -uprN linux-source-4.19~/drivers/platform/x86/thinkpad_acpi.c linux-source-4.19/drivers/platform/x86/thinkpad_acpi.c
--- linux-source-4.19~/drivers/platform/x86/thinkpad_acpi.c 2019-02-24 13:27:29.341331227 +0000
+++ linux-source-4.19/drivers/platform/x86/thinkpad_acpi.c 2019-02-24 13:09:28.710982438 +0000
@@ -9619,6 +9619,7 @@ static const struct tpacpi_quirk battery
TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */
TPACPI_Q_LNV3('R', '0', 'C', true), /* Thinkpad 13 */
TPACPI_Q_LNV3('R', '0', 'J', true), /* Thinkpad 13 gen 2 */
+ TPACPI_Q_LNV3('R', '0', 'K', true), /* Thinkpad 11e gen 4 */
};
static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)
next reply other threads:[~2019-02-24 15:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-24 14:58 Ken Milmore [this message]
2019-02-26 16:04 ` Jouke Witteveen
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=333cc78c-7537-7898-d753-17352df893aa@gmail.com \
--to=ken.milmore@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=j.witteveen@gmail.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®