Re: [PATCH 1/3] dell_wmi: Support new hotkeys on the XPS 13 Skylake
From: Andy Lutomirski
Date: Sat Nov 14 2015 - 10:49:31 EST
On Nov 14, 2015 1:27 AM, "Pali RohÃr" <pali.rohar@xxxxxxxxx> wrote:
>
> On Friday 13 November 2015 21:49:30 Andy Lutomirski wrote:
> > The XPS 13 Skylake has an rfkill button and a switchvideomode button
> > that aren't enumerated in the DMI table AFAICT. Add a table listing
> > extra un-enumerated hotkeys. To avoid breaking things that worked
> > before, these un-enumerated hotkeys won't be used if the DMI table
> > maps them to something else.
> >
>
> Do you have any (Dell) documentation which specify list of these wmi
> codes send to dell-wmi driver?
>
No. Do you know where to get that documentation?
> > This also adds the Fn-lock key as a KE_IGNORE entry.
> >
> > Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxx>
> > ---
> > drivers/platform/x86/dell-wmi.c | 48 +++++++++++++++++++++++++++++++++++------
> > 1 file changed, 41 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> > index f2d77fe696ac..5be1abec4f64 100644
> > --- a/drivers/platform/x86/dell-wmi.c
> > +++ b/drivers/platform/x86/dell-wmi.c
> > @@ -142,6 +142,16 @@ static const u16 bios_to_linux_keycode[256] __initconst = {
> > 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_PROG3
> > };
> >
> > +/* These are applied if the hk table is present and doesn't override them. */
> > +static const struct key_entry dell_wmi_extra_keymap[] __initconst = {
> > + /* Fn-lock -- no action is required by the kernel. */
> > + { KE_IGNORE, 0x151, { KEY_RESERVED } },
> > +
> > + /* Keys that need our help (on XPS 13 Skylake and maybe others. */
> > + { KE_KEY, 0x152, { KEY_SWITCHVIDEOMODE } },
> > + { KE_KEY, 0x153, { KEY_RFKILL } },
>
> On more Dell laptops rfkill events are handed by ACPI driver
> dell-rbtn.ko. Are you sure that dell-rbtn.ko does not send keypress
> event and you really need it from dell-wmi? We already masked KEY_RFKILL
> in dell-wmi to prevent double events...
>
Hmm, interesting. I have DELLABC6, not DELLABCE. I'll play around
with it a bit. Are there Dell docs for this?
Regardless, we'll need something like this, but maybe with KE_IGNORE,
just to silence the warnings.
> > +
> > + /*
> > + * Check if we've already found this scancode. This takes
> > + * quadratic time, but it doesn't matter unless the list
> > + * of extra keys gets very long.
> > + */
> > + for (j = 0; j < num_bios_keys; j++)
> > + if (keymap[j].code == dell_wmi_extra_keymap[i].code)
> > + goto skip;
>
> Rather move this code into separate boolean function and for return
> value here. This will prevent using hacky goto...
>
I'll do that in v2.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/