]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: hda - bind headset buttons to the headphone jack
authorHui Wang <hui.wang@canonical.com>
Fri, 5 Mar 2021 09:26:08 +0000 (17:26 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 5 Mar 2021 14:18:24 +0000 (15:18 +0100)
commit04f7791b7a4ba6ff3f53b3f3978b353924d10e78
tree3a1b9a0ae159fcf26502fdc65c49461cc8666027
parent2c48653c1bc3aa6894e45e6037c7693949008816
ALSA: hda - bind headset buttons to the headphone jack

With the HDA driver, if the headset buttons are supported, an audio
Jack will be created for them. This audio Jack is a bit confusing to
users since it can't report headphone/mic insertion events but it
claims to support these events.

And in addition, the driver already builds a headphone Jack and a mic
Jack, and most of those buttons are used for headphone playback, so
do some change to bind those buttons to the headphone Jack. After this
change, the key events are generated from NID 0x55, and are reported
to the input layer via headphone jack (NID 0x21).

If there is no headphone Jack, then build an audio jack to support
those buttons same as previously.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20210305092608.109599-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_jack.c
sound/pci/hda/hda_jack.h
sound/pci/hda/patch_realtek.c