ASoC: Intel: bytcr_wm5102: Map missing Line Out jack kcontrol
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Wed, 2 Aug 2023 17:57:17 +0000 (20:57 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 7 Aug 2023 13:32:45 +0000 (14:32 +0100)
Commit ecd77d494ec9 ("ASoC: Intel: bytcr_wm5102: Add jack detect
support") 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 WM5102 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-8-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcr_wm5102.c

index f2382d4..5c9e06e 100644 (file)
@@ -131,6 +131,7 @@ static const struct snd_soc_dapm_widget byt_wm5102_widgets[] = {
        SND_SOC_DAPM_MIC("Headset Mic", NULL),
        SND_SOC_DAPM_MIC("Internal Mic", NULL),
        SND_SOC_DAPM_SPK("Speaker", NULL),
+       SND_SOC_DAPM_LINE("Line Out", NULL),
        SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
                            platform_clock_control, SND_SOC_DAPM_PRE_PMU |
                            SND_SOC_DAPM_POST_PMD),
@@ -144,6 +145,7 @@ static const struct snd_soc_dapm_route byt_wm5102_audio_map[] = {
        {"Headset Mic", NULL, "Platform Clock"},
        {"Internal Mic", NULL, "Platform Clock"},
        {"Speaker", NULL, "Platform Clock"},
+       {"Line Out", NULL, "Platform Clock"},
 
        {"Speaker", NULL, "SPKOUTLP"},
        {"Speaker", NULL, "SPKOUTLN"},
@@ -177,6 +179,7 @@ static const struct snd_kcontrol_new byt_wm5102_controls[] = {
        SOC_DAPM_PIN_SWITCH("Headset Mic"),
        SOC_DAPM_PIN_SWITCH("Internal Mic"),
        SOC_DAPM_PIN_SWITCH("Speaker"),
+       SOC_DAPM_PIN_SWITCH("Line Out"),
 };
 
 static struct snd_soc_jack_pin byt_wm5102_pins[] = {
@@ -188,6 +191,10 @@ static struct snd_soc_jack_pin byt_wm5102_pins[] = {
                .pin    = "Headset Mic",
                .mask   = SND_JACK_MICROPHONE,
        },
+       {
+               .pin    = "Line Out",
+               .mask   = SND_JACK_LINEOUT,
+       },
 };
 
 static int byt_wm5102_init(struct snd_soc_pcm_runtime *runtime)