[alsa-devel] HDA headset button support

Takashi Iwai tiwai at suse.de
Wed Nov 28 15:05:08 CET 2018


On Wed, 28 Nov 2018 13:03:58 +0100,
Kailang wrote:
> 
> Hi Takashi,
> 
> >I'd rather like to extend snd_hda_jack_add_kctl() with the key
> >support (maybe adding a new function).  You can pass there the
> >combination of SND_JACK_BTN_X with KEY_XXX in an array.
> 
> Do you mean create new function like below?
> snd_hda_jack_add_key_kctl()
> 
> It couldn't use snd_hda_jack_add_kctl() directly.
> Because it had report pin state and get type from NID.
> 
> 	type = get_input_jack_type(codec, nid);
>         .....
>         .....
>  	state = snd_hda_jack_detect(codec, nid);
> 	snd_jack_report(jack->jack, state ? jack->type : 0);
> 
> So, to create a new function in hda_jack.c was better.

Well, this seems more deeper than I thought.

Below is my quick attempt to add the infrastructure.  This adds more
flexibility but still easiness for other possible button
implementations, hopefully.

Could you check the series below?


thanks,

Takashi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ALSA-hda-Add-jack-pointer-and-unsolicited-event-bits.patch
Type: application/octet-stream
Size: 2686 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20181128/1a8a0e1d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ALSA-hda-Add-jack-button-support.patch
Type: application/octet-stream
Size: 5413 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20181128/1a8a0e1d/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-ALSA-hda-realtek-Enable-headset-button-support-for-n.patch
Type: application/octet-stream
Size: 3405 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20181128/1a8a0e1d/attachment-0002.obj>


More information about the Alsa-devel mailing list