ASoC: sun50i-codec-analog: Make headphone routes stereo
authorSamuel Holland <samuel@sholland.org>
Sun, 26 Jul 2020 02:53:30 +0000 (21:53 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 17 Aug 2020 15:19:14 +0000 (16:19 +0100)
This matches the hardware more accurately, and is necessary for
including the (stereo) headphone mute switch in the DAPM graph.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-5-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun50i-codec-analog.c

index 17165f1ddb63270ef614dbcf6ed813a259f98dfc..f98851067f9783d5265420e4a80d58b64579855e 100644 (file)
@@ -311,9 +311,15 @@ static const struct snd_soc_dapm_widget sun50i_a64_codec_widgets[] = {
         */
 
        SND_SOC_DAPM_REGULATOR_SUPPLY("cpvdd", 0, 0),
-       SND_SOC_DAPM_MUX("Headphone Source Playback Route",
+       SND_SOC_DAPM_MUX("Left Headphone Source",
                         SND_SOC_NOPM, 0, 0, sun50i_codec_hp_src),
-       SND_SOC_DAPM_OUT_DRV("Headphone Amp", SUN50I_ADDA_HP_CTRL,
+       SND_SOC_DAPM_MUX("Right Headphone Source",
+                        SND_SOC_NOPM, 0, 0, sun50i_codec_hp_src),
+       SND_SOC_DAPM_OUT_DRV("Left Headphone Amp",
+                            SND_SOC_NOPM, 0, 0, NULL, 0),
+       SND_SOC_DAPM_OUT_DRV("Right Headphone Amp",
+                            SND_SOC_NOPM, 0, 0, NULL, 0),
+       SND_SOC_DAPM_SUPPLY("Headphone Amp", SUN50I_ADDA_HP_CTRL,
                             SUN50I_ADDA_HP_CTRL_HPPA_EN, 0, NULL, 0),
        SND_SOC_DAPM_OUTPUT("HP"),
 
@@ -405,13 +411,19 @@ static const struct snd_soc_dapm_route sun50i_a64_codec_routes[] = {
        { "Right ADC", NULL, "Right ADC Mixer" },
 
        /* Headphone Routes */
-       { "Headphone Source Playback Route", "DAC", "Left DAC" },
-       { "Headphone Source Playback Route", "DAC", "Right DAC" },
-       { "Headphone Source Playback Route", "Mixer", "Left Mixer" },
-       { "Headphone Source Playback Route", "Mixer", "Right Mixer" },
-       { "Headphone Amp", NULL, "Headphone Source Playback Route" },
+       { "Left Headphone Source", "DAC", "Left DAC" },
+       { "Left Headphone Source", "Mixer", "Left Mixer" },
+       { "Left Headphone Amp", NULL, "Left Headphone Source" },
+       { "Left Headphone Amp", NULL, "Headphone Amp" },
+       { "HP", NULL, "Left Headphone Amp" },
+
+       { "Right Headphone Source", "DAC", "Right DAC" },
+       { "Right Headphone Source", "Mixer", "Right Mixer" },
+       { "Right Headphone Amp", NULL, "Right Headphone Source" },
+       { "Right Headphone Amp", NULL, "Headphone Amp" },
+       { "HP", NULL, "Right Headphone Amp" },
+
        { "Headphone Amp", NULL, "cpvdd" },
-       { "HP", NULL, "Headphone Amp" },
 
        /* Microphone Routes */
        { "Mic1 Amplifier", NULL, "MIC1"},