From: "Bjørn Mork" <bjorn@mork.no>
To: Bastien Nocera <hadess@hadess.net>
Cc: ibm-acpi-devel@lists.sourceforge.net,
platform-driver-x86@vger.kernel.org,
Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>,
Darren Hart <dvhart@infradead.org>,
Shuduo Sang <shuduo.sang@canonical.com>,
Bruce Ma <bruce.ma@canonical.com>
Subject: Re: [PATCH] thinkpad_acpi: support HKEY interface version 0x200
Date: Tue, 19 Apr 2016 14:42:58 +0200 [thread overview]
Message-ID: <87k2jt7orx.fsf@nemi.mork.no> (raw)
In-Reply-To: <1461064294-2879-1-git-send-email-hadess@hadess.net> (Bastien Nocera's message of "Tue, 19 Apr 2016 13:11:34 +0200")
Bastien Nocera <hadess@hadess.net> writes:
> From: Shuduo Sang <shuduo.sang@canonical.com>
>
> The Thinkpad X1 Carbon 2nd generation (2014) ships with BIOS that will
> return HKEY interface version 0x200. It needs thinkpad-acpi support
> otherwise it will be routed to wrong branch and the hotkey mask will
> be wrong.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=114731
>
> Signed-off-by: Bruce Ma <bruce.ma@canonical.com>
> Signed-off-by: Shuduo Sang <shuduo.sang@canonical.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 35 ++++++++++++++++++++++++++++++-----
> 1 file changed, 30 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index dad2984..c177936 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -3357,11 +3357,8 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
> A30, R30, R31, T20-22, X20-21, X22-24. Detected by checking
> for HKEY interface version 0x100 */
> if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
> - if ((hkeyv >> 8) != 1) {
> - pr_err("unknown version of the HKEY interface: 0x%x\n",
> - hkeyv);
> - pr_err("please report this to %s\n", TPACPI_MAIL);
> - } else {
> + switch (hkeyv >> 8) {
> + case 1:
> /*
> * MHKV 0x100 in A31, R40, R40e,
> * T4x, X31, and later
> @@ -3381,6 +3378,34 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
> } else {
> tp_features.hotkey_mask = 1;
> }
> + break;
> +
> + case 2:
> + /*
> + * MHKV 0x200 in X1
> + */
> + vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
> + "firmware HKEY interface version: 0x%x\n",
> + hkeyv);
> +
> + /* Paranoia check AND init hotkey_all_mask */
> + if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
> + "MHKA", "dd", 1)) {
> + pr_err("missing MHKA handler, "
> + "please report this to %s\n",
> + TPACPI_MAIL);
> + /* Fallback: pre-init for FN+F3,F4,F12 */
> + hotkey_all_mask = 0x080cU;
> + } else {
> + tp_features.hotkey_mask = 1;
> + }
> + break;
Why do you duplicate this code block with that single byte changed? If
that was intended, then it certainly should be explained.
Bjørn
next prev parent reply other threads:[~2016-04-19 12:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 11:11 [PATCH] thinkpad_acpi: support HKEY interface version 0x200 Bastien Nocera
2016-04-19 12:42 ` Bjørn Mork [this message]
[not found] ` <87k2jt7orx.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2016-04-19 12:48 ` Bastien Nocera
[not found] ` <1461070105.7279.18.camel-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
2016-04-20 9:10 ` Yrjan Skrimstad
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=87k2jt7orx.fsf@nemi.mork.no \
--to=bjorn@mork.no \
--cc=bruce.ma@canonical.com \
--cc=dvhart@infradead.org \
--cc=hadess@hadess.net \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ibm-acpi@hmh.eng.br \
--cc=platform-driver-x86@vger.kernel.org \
--cc=shuduo.sang@canonical.com \
/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