ASoC: cs47l15: Add AEC2 loopback support
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 2 Mar 2018 10:17:22 +0000 (10:17 +0000)
committer강신형 <s47.kang@samsung.com>
Tue, 19 Jun 2018 07:58:59 +0000 (16:58 +0900)
Change-Id: I414c35c22e4a61c1fb690ca921997c84bf871ef1
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
sound/soc/codecs/cs47l15.c

index c928667ac909f1ee35e5f53b0378e687fe3f60e7..d81db1f9d3e1426bffad65f39496c2f54923a350 100644 (file)
@@ -439,15 +439,24 @@ static const unsigned int cs47l15_aec_loopback_values[] = {
        0, 1, 6, 8, 9,
 };
 
-static const struct soc_enum cs47l15_aec_loopback =
+static const struct soc_enum cs47l15_aec1_loopback =
        SOC_VALUE_ENUM_SINGLE(MADERA_DAC_AEC_CONTROL_1,
                              MADERA_AEC1_LOOPBACK_SRC_SHIFT, 0xf,
                              ARRAY_SIZE(cs47l15_aec_loopback_texts),
                              cs47l15_aec_loopback_texts,
                              cs47l15_aec_loopback_values);
 
-static const struct snd_kcontrol_new cs47l15_aec_loopback_mux =
-       SOC_DAPM_ENUM("AEC1 Loopback", cs47l15_aec_loopback);
+static const struct soc_enum cs47l15_aec2_loopback =
+       SOC_VALUE_ENUM_SINGLE(MADERA_DAC_AEC_CONTROL_2,
+                             MADERA_AEC2_LOOPBACK_SRC_SHIFT, 0xf,
+                             ARRAY_SIZE(cs47l15_aec_loopback_texts),
+                             cs47l15_aec_loopback_texts,
+                             cs47l15_aec_loopback_values);
+
+static const struct snd_kcontrol_new cs47l15_aec_loopback_mux[] = {
+       SOC_DAPM_ENUM("AEC1 Loopback", cs47l15_aec1_loopback),
+       SOC_DAPM_ENUM("AEC2 Loopback", cs47l15_aec2_loopback),
+};
 
 static const struct snd_soc_dapm_widget cs47l15_dapm_widgets[] = {
 SND_SOC_DAPM_SUPPLY("SYSCLK", MADERA_SYSTEM_CLOCK_1, MADERA_SYSCLK_ENA_SHIFT,
@@ -613,7 +622,10 @@ SND_SOC_DAPM_SIGGEN("HAPTICS"),
 
 SND_SOC_DAPM_MUX("AEC1 Loopback", MADERA_DAC_AEC_CONTROL_1,
                 MADERA_AEC1_LOOPBACK_ENA_SHIFT, 0,
-                &cs47l15_aec_loopback_mux),
+                &cs47l15_aec_loopback_mux[0]),
+SND_SOC_DAPM_MUX("AEC2 Loopback", MADERA_DAC_AEC_CONTROL_2,
+                MADERA_AEC2_LOOPBACK_ENA_SHIFT, 0,
+                &cs47l15_aec_loopback_mux[1]),
 
 SND_SOC_DAPM_PGA_E("IN1L PGA", MADERA_INPUT_ENABLES, MADERA_IN1L_ENA_SHIFT,
                   0, NULL, 0, madera_in_ev,
@@ -809,6 +821,7 @@ SND_SOC_DAPM_OUTPUT("MICSUPP"),
        { name, "Tone Generator 2", "Tone Generator 2" }, \
        { name, "Haptics", "HAPTICS" }, \
        { name, "AEC1", "AEC1 Loopback" }, \
+       { name, "AEC2", "AEC2 Loopback" }, \
        { name, "IN1L", "IN1L PGA" }, \
        { name, "IN1R", "IN1R PGA" }, \
        { name, "IN2L", "IN2L PGA" }, \
@@ -1069,6 +1082,8 @@ static const struct snd_soc_dapm_route cs47l15_dapm_routes[] = {
 
        { "AEC1 Loopback", "HPOUT1L", "OUT1L" },
        { "AEC1 Loopback", "HPOUT1R", "OUT1R" },
+       { "AEC2 Loopback", "HPOUT1L", "OUT1L" },
+       { "AEC2 Loopback", "HPOUT1R", "OUT1R" },
        { "HPOUT1 Demux", NULL, "OUT1L" },
        { "HPOUT1 Demux", NULL, "OUT1R" },
        { "HPOUTL", "HPOUT", "HPOUT1 Demux" },
@@ -1077,11 +1092,14 @@ static const struct snd_soc_dapm_route cs47l15_dapm_routes[] = {
        { "EPOUTN", "EPOUT", "HPOUT1 Demux" },
 
        { "AEC1 Loopback", "SPKOUTL", "OUT4L" },
+       { "AEC2 Loopback", "SPKOUTL", "OUT4L" },
        { "SPKOUTN", NULL, "OUT4L" },
        { "SPKOUTP", NULL, "OUT4L" },
 
        { "AEC1 Loopback", "SPKDAT1L", "OUT5L" },
        { "AEC1 Loopback", "SPKDAT1R", "OUT5R" },
+       { "AEC2 Loopback", "SPKDAT1L", "OUT5L" },
+       { "AEC2 Loopback", "SPKDAT1R", "OUT5R" },
        { "SPKDAT1L", NULL, "OUT5L" },
        { "SPKDAT1R", NULL, "OUT5R" },