Re: [PATCH 2/2] ALSA: hda - Add keycode map for alc input device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 24 Dec 2015 04:46:38 +0100,
Hui Wang wrote:
> 
> Then users can remap the keycode from userspace. If without the remap,
> the input device will pass KEY_MICMUTE to userspace, but in X11 layer,
> it uses KEY_F20 rather than KEY_MICMUTE for XF86AudioMicMute. After
> adding the keycode map, users can remap the keycode to any value users
> want.
> 
> And there are two places to register the input device, to make the
> code simple and clean, we move the two same code sections into a
> function.

Having this change at first would be better.  Then you can avoid a
build-and-scratch sequence but just use the new helper from the
beginning.

Also...

> Cc: <stable@xxxxxxxxxxxxxxx>
> Signed-off-by: Hui Wang <hui.wang@xxxxxxxxxxxxx>
> ---
>  sound/pci/hda/patch_realtek.c | 68 +++++++++++++++++++++++++------------------
>  1 file changed, 40 insertions(+), 28 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index 8adff4f..97f22ad 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -67,6 +67,14 @@ enum {
>  	ALC_HEADSET_TYPE_OMTP,
>  };
>  
> +enum {
> +	ALC_KEY_MICMUTE_INDEX,
> +};
> +
> +static u8 alc_mute_keycode_map[] = {
> +	KEY_MICMUTE,	/* index=0, microphone mute key code */
> +};

You're sharing this array, and remapping will overwrite this.
For example, if the codec is once unbound and bound again, the
modified keymap will be passed to the new instance.  Use an array in
alc_spec instead.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux