All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Darren Hart <dvhart@infradead.org>
Cc: "Andy Lutomirski" <luto@kernel.org>,
	"Matthew Garrett" <mjg59@srcf.ucam.org>,
	"Linux ACPI" <linux-acpi@vger.kernel.org>,
	platform-driver-x86@vger.kernel.org,
	"Mario Limonciello" <mario_limonciello@dell.com>,
	"Pali Rohár" <pali.rohar@gmail.com>
Subject: Re: [PATCH v2 2/3] dell-wmi: Support new hotkeys on the XPS 13 9350 (Skylake)
Date: Thu, 3 Dec 2015 16:00:54 -0800	[thread overview]
Message-ID: <CALCETrUeW3XOYBGwGSvFswQg8SuQCQkvg5sMkmivEDrjhoit+g@mail.gmail.com> (raw)
In-Reply-To: <20151203235211.GD1800@malice.jf.intel.com>

On Thu, Dec 3, 2015 at 3:52 PM, Darren Hart <dvhart@infradead.org> wrote:
> On Mon, Nov 30, 2015 at 05:02:00PM -0800, Andy Lutomirski wrote:
>> The XPS 13 9350 sends WMI keypress events that aren't enumerated in
>> the DMI table.  Add a table listing them.  To avoid breaking things
>> that worked before, these un-enumerated hotkeys won't be used if the
>> DMI table maps them to something else.
>>
>> FWIW, it appears that the DMI table may be a legacy thing and we
>> might want to rethink how we handle events in general.  As an
>> example, a whole lot of things map to KEY_PROG3 via the DMI table.
>>
>> So far, this doesn't send keypress events for any of the new
>> events.  Depnding on whether we figure out exactly what needs to
>> happen to get the wireless button working in time for Linux 4.5,
>> we might want to temporarily handle it in dell-wmi.
>>
>> Signed-off-by: Andy Lutomirski <luto@kernel.org>
>> ---
>>  drivers/platform/x86/dell-wmi.c | 59 ++++++++++++++++++++++++++++++++++++-----
>>  1 file changed, 52 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
>> index ad6e965c5862..baff658a3621 100644
>> --- a/drivers/platform/x86/dell-wmi.c
>> +++ b/drivers/platform/x86/dell-wmi.c
>> @@ -161,6 +161,27 @@ static const u16 bios_to_linux_keycode[256] __initconst = {
>>       [255]   = KEY_PROG3,
>>  };
>>
>> +/* These are applied if the hk table is present and doesn't override them. */
>
>
> Please do not abbreviate in comments.

Will fix for v3.

>
>
>> +static const struct key_entry dell_wmi_extra_keymap[] __initconst = {
>> +     /* Fn-lock */
>> +     { KE_IGNORE, 0x151, { KEY_RESERVED } },
>> +
>> +     /* Change keyboard illumination */
>> +     { KE_IGNORE, 0x152, { KEY_KBDILLUMTOGGLE } },
>> +
>> +     /*
>> +      * Radio disable (notify only -- there is no model for which the
>> +      * WMI event is supposed to trigger an action.
>> +      */
>> +     { KE_IGNORE, 0x153, { KEY_RFKILL } },
>> +
>> +     /* RGB keyboard backlight control */
>> +     { KE_IGNORE, 0x154, { KEY_RESERVED } },
>> +
>> +     /* Stealth mode toggle */
>> +     { KE_IGNORE, 0x155, { KEY_RESERVED } },
>> +};
>> +
>>  static struct input_dev *dell_wmi_input_dev;
>>
>>  static void dell_wmi_process_key(int reported_key)
>> @@ -319,9 +340,10 @@ static const struct key_entry * __init dell_wmi_prepare_new_keymap(void)
>>       int hotkey_num = (dell_bios_hotkey_table->header.length - 4) /
>>                               sizeof(struct dell_bios_keymap_entry);
>>       struct key_entry *keymap;
>> -     int i;
>> +     int i, pos = 0, num_bios_keys;
>>
>> -     keymap = kcalloc(hotkey_num + 1, sizeof(struct key_entry), GFP_KERNEL);
>> +     keymap = kcalloc(hotkey_num + ARRAY_SIZE(dell_wmi_extra_keymap),
>> +                      sizeof(struct key_entry), GFP_KERNEL);
>
> Did something change since our last round of review making the +1 for KE_END
> no longer necessary? It looks like it should be possible to use all the bios
> hotkey keymap and all the extra keymap, so we would still need +1 for KE_END.

No, my bad.  That's embarrassing :(

--Andy

  reply	other threads:[~2015-12-04  0:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  1:01 [PATCH v2 0/3] dell platform driver tweaks v2 Andy Lutomirski
2015-12-01  1:01 ` [PATCH v2 1/3] dell-wmi: Use a C99-style array for bios_to_linux_keycode Andy Lutomirski
2015-12-03 23:32   ` Darren Hart
2015-12-03 23:45     ` Andy Lutomirski
2015-12-04  0:07       ` Darren Hart
2015-12-01  1:02 ` [PATCH v2 2/3] dell-wmi: Support new hotkeys on the XPS 13 9350 (Skylake) Andy Lutomirski
2015-12-01 16:38   ` Mario Limonciello
2015-12-03 23:52   ` Darren Hart
2015-12-04  0:00     ` Andy Lutomirski [this message]
2015-12-04  9:03   ` Pali Rohár
2015-12-04 16:05     ` Andy Lutomirski
2015-12-01  1:02 ` [PATCH v2 3/3] dell-wmi: Improve unknown hotkey handling Andy Lutomirski
2015-12-03 23:38   ` Darren Hart
2015-12-03 23:45     ` Andy Lutomirski
2015-12-04  0:07       ` Darren Hart
2015-12-04  0:10         ` Andy Lutomirski
2015-12-04  0:21           ` Darren Hart
2015-12-04  8:39     ` Pali Rohár
2015-12-04 16:15       ` Andy Lutomirski
2015-12-09  0:33         ` Darren Hart

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=CALCETrUeW3XOYBGwGSvFswQg8SuQCQkvg5sMkmivEDrjhoit+g@mail.gmail.com \
    --to=luto@amacapital.net \
    --cc=dvhart@infradead.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mario_limonciello@dell.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali.rohar@gmail.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 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.