lkml.org 
[lkml]   [2017]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/8] platform/x86: fujitsu-laptop: model-dependent sparse keymap overrides
On Mon, Mar 20, 2017 at 10:32:23AM +0100, Micha?? K??pie?? wrote:
> Some laptop models need to have different keycodes assigned to hotkey
> scancodes. Change the sparse keymap upon a DMI match, before the hotkey
> input device is setup.
>
> Instead of using three different callbacks in the DMI match table,
> simplify code by using the driver_data field of struct dmi_system_id to
> supply the requested keymap to a common callback. Also merge keymaps
> for S6410 and S6420 as they are identical.
>
> [cut]
>
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 8f1c9c204110..1487eb2396c6 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c

> @@ -766,8 +711,62 @@ static const struct key_entry keymap_default[] = {
> { KE_END, 0 }
> };
>
> +static const struct key_entry keymap_s6400[] = {
> + { KE_KEY, KEY1_CODE, { KEY_SCREENLOCK } }, /* "Lock" */
> + { KE_KEY, KEY2_CODE, { KEY_HELP } }, /* "Mobility Center */
> + { KE_KEY, KEY3_CODE, { KEY_PROG3 } },
> + { KE_KEY, KEY4_CODE, { KEY_PROG4 } },
> + { KE_END, 0 }
> +};

Since this keymap applies to both the S6410 and S6420, referencing S6400 in
its name might be slightly confusing in future. Calling this "keymap_s64x0"
or (if it fits better with conventions used elsewhere) "keymap_s64X0" would
avoid the confusion.

Regards
jonathan

\
 
 \ /
  Last update: 2017-03-27 02:42    [W:0.175 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site