ASoC: samsung: lowland: Split Line Out jack kcontrol from Headphone
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Wed, 2 Aug 2023 17:57:36 +0000 (20:57 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 7 Aug 2023 13:33:08 +0000 (14:33 +0100)
This driver has correctly mapped jack kcontrols for Headphone and
Headset Mic. However, it is also mapping Line Out jack detection events
to the Headphone kcontrol.

The WM5100 codec used here can distinguish Line Out connections from
Headphone connections. Decouple the two, expose Line Out to userspace as
an independent kcontrol and add the necessary widget.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-27-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/lowland.c

index 106770be6fc5afae3ba5a4aa0b69c99b7011b3b9..a79df871ea135899d3dd442401991d18c03ac700 100644 (file)
@@ -22,12 +22,16 @@ static struct snd_soc_jack lowland_headset;
 static struct snd_soc_jack_pin lowland_headset_pins[] = {
        {
                .pin = "Headphone",
-               .mask = SND_JACK_HEADPHONE | SND_JACK_LINEOUT,
+               .mask = SND_JACK_HEADPHONE,
        },
        {
                .pin = "Headset Mic",
                .mask = SND_JACK_MICROPHONE,
        },
+       {
+               .pin = "Line Out",
+               .mask = SND_JACK_LINEOUT,
+       },
 };
 
 static int lowland_wm5100_init(struct snd_soc_pcm_runtime *rtd)
@@ -140,11 +144,13 @@ static const struct snd_kcontrol_new controls[] = {
        SOC_DAPM_PIN_SWITCH("WM1250 Input"),
        SOC_DAPM_PIN_SWITCH("WM1250 Output"),
        SOC_DAPM_PIN_SWITCH("Headphone"),
+       SOC_DAPM_PIN_SWITCH("Line Out"),
 };
 
 static const struct snd_soc_dapm_widget widgets[] = {
        SND_SOC_DAPM_HP("Headphone", NULL),
        SND_SOC_DAPM_MIC("Headset Mic", NULL),
+       SND_SOC_DAPM_LINE("Line Out", NULL),
 
        SND_SOC_DAPM_SPK("Main Speaker", NULL),