ASoC: mediatek: mt8186-mt6366-da7219-max98357: Map missing jack kcontrols

Commit 8e98674868 ("ASoC: mediatek: mt8186-da7219: Expose individual
headset jack pins") maps kcontrols for Headphone and Headset Mic jacks
for this driver so that PulseAudio and PipeWire can handle jack
detection events for these peripherals.

The DA7219 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-19-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Alper Nebi Yasak 2023-08-02 20:57:28 +03:00 committed by Mark Brown
parent 09a22368bb
commit 26de9cc1b9
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -46,6 +46,10 @@ static struct snd_soc_jack_pin mt8186_jack_pins[] = {
.pin = "Headset Mic",
.mask = SND_JACK_MICROPHONE,
},
{
.pin = "Line Out",
.mask = SND_JACK_LINEOUT,
},
};
static struct snd_soc_codec_conf mt8186_mt6366_da7219_max98357_codec_conf[] = {
@ -964,6 +968,7 @@ mt8186_mt6366_da7219_max98357_widgets[] = {
SND_SOC_DAPM_SPK("Speakers", NULL),
SND_SOC_DAPM_HP("Headphones", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_LINE("Line Out", NULL),
SND_SOC_DAPM_OUTPUT("HDMI1"),
SND_SOC_DAPM_MIXER(SOF_DMA_DL1, SND_SOC_NOPM, 0, 0, NULL, 0),
SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0),
@ -996,6 +1001,7 @@ mt8186_mt6366_da7219_max98357_controls[] = {
SOC_DAPM_PIN_SWITCH("Speakers"),
SOC_DAPM_PIN_SWITCH("Headphones"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("Line Out"),
SOC_DAPM_PIN_SWITCH("HDMI1"),
};