All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: platform-driver-x86@vger.kernel.org,
	Ike Panhc <ike.pan@canonical.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ideapad-laptop: add support for Yoga 3 ESC key
Date: Mon, 9 Nov 2015 13:46:24 -0800	[thread overview]
Message-ID: <20151109214624.GI18221@malice.jf.intel.com> (raw)
In-Reply-To: <3945339.hkrnUBKIiS@wuerfel>

On Fri, Nov 06, 2015 at 10:28:49PM +0100, Arnd Bergmann wrote:
> The ideapad-laptop handles most special keys on various Lenovo Laptops
> including the Yoga line. Unfortunately, the Yoga 3 11/13/14 models have
> one important exception, which is the Fn-ESC combination.
> 
> On other Lenovo Laptops, this is FnLock, which switches the function keys
> between the primary (Mute, Vol down, Vol up, ...) and the secondary (F1,
> F2, F3, ...) behavior. On the new machines, FnLock is only available
> through BIOS setup (possibly through a yet-to-be-implemented feature
> in this driver) but not through Fn-ESC, but instead the ESC key itself
> switched between ESC and a "Paper Display" app for Windows.
> 
> Unfortunately, that means that you can never have both ESC *and* the
> function keys working at the same time without needing to press Fn on
> one of them.
> As pointed out in the official Lenovo Forum by dozens of users, this
> makes the machine rather useless for any serious work [1].
> 
> I have now studied the ACPI DSDT one more time and found the event
> that is generated for the ESC key. Unlike all other key events on this
> machine, it is actually a WMI, while the other ones are read from the
> embedded controller.
> 
> I am now installing a WMI notifier that uses the event number from the
> WMI subsystem as the scancode. The only event number generated here is
> '128', and that fits in nicely with the two existing ranges of scancodes
> used by the EC: 0-15 for the 16-bit VPCCMD_R_VPC register, 16-17 for
> the VPCCMD_R_NOVO register and 64-67 for VPCCMD_R_SPECIAL_BUTTONS.
> 
> The only sane way to handle this button (in absence of the Windows Paper
> Display driver) seems to be to have it emit KEY_ESC, so that is what
> I use as the default. Should any user ever want to overwrite the default,
> they can install their own keymap.
> 
> To ensure that we can still build the driver without adding a CONFIG_WMI
> dependency, all new code is enclosed in #ifdef.

I'm not thrilled with the ifdefs, but whether that's worse than the CONFIG_WMI
dependency or not... I'm not prepared to argue, so I'm siding with you :-)

> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> [1] https://forums.lenovo.com/t5/Lenovo-Yoga-Series-Notebooks/YOGA-3-14-How-to-reclaim-my-Esc-key-and-permanently-disable/td-p/2070816
> 

Queued to testing, thanks Arnd.
-- 
Darren Hart
Intel Open Source Technology Center

      parent reply	other threads:[~2015-11-09 21:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 21:28 [PATCH] ideapad-laptop: add support for Yoga 3 ESC key Arnd Bergmann
2015-11-06 22:26 ` [PATCH] ideapad-laptop: include Yoga 3 1170 in add rfkill whitelist Arnd Bergmann
2015-11-09 21:46   ` Darren Hart
2015-11-09 21:46 ` Darren Hart [this message]

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=20151109214624.GI18221@malice.jf.intel.com \
    --to=dvhart@infradead.org \
    --cc=arnd@arndb.de \
    --cc=ike.pan@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.