Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1609420

Re: [PATCH 7/8] platform/x86: fujitsu-laptop: model-dependent sparse keymap overrides

From Jonathan Woithe <jwoithe@just42.net>
Newsgroups linux.kernel
Subject Re: [PATCH 7/8] platform/x86: fujitsu-laptop: model-dependent sparse keymap overrides
Date 2017-03-27 02:50 +0200
Message-ID <tpr17-82P-3@gated-at.bofh.it> (permalink)
References <tn4V3-4Nu-5@gated-at.bofh.it> <tn4V4-4Nu-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 7/8] platform/x86: fujitsu-laptop: model-dependent sparse keymap overrides Michał Kępień <kernel@kempniu.pl> - 2017-03-20 13:50 +0100
  Re: [PATCH 7/8] platform/x86: fujitsu-laptop: model-dependent sparse  keymap overrides Jonathan Woithe <jwoithe@just42.net> - 2017-03-27 02:50 +0200

csiph-web