diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-30 08:42:26 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-30 08:48:08 -0400 |
commit | 50941968fc9e359a89da2136b11328fe700dbd7d (patch) | |
tree | 78732269b15840533de875cfe9deda2639ef8434 | |
parent | 70bd3b298bbbd5a36c55af957bb3b5f727218918 (diff) |
ASoC: wm8994: Add digital loopback paths
There is loopback control within the audio interfaces, provide control of
this as there are some obscure scenarios where this could be used in
production.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm8994.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 2c2a183da2b6..55a5cc639b90 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -1494,6 +1494,24 @@ static const char *aif1dac_text[] = { | |||
1494 | "AIF1DACDAT", "AIF3DACDAT", | 1494 | "AIF1DACDAT", "AIF3DACDAT", |
1495 | }; | 1495 | }; |
1496 | 1496 | ||
1497 | static const char *loopback_text[] = { | ||
1498 | "None", "ADCDAT", | ||
1499 | }; | ||
1500 | |||
1501 | static const struct soc_enum aif1_loopback_enum = | ||
1502 | SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, WM8994_AIF1_LOOPBACK_SHIFT, 2, | ||
1503 | loopback_text); | ||
1504 | |||
1505 | static const struct snd_kcontrol_new aif1_loopback = | ||
1506 | SOC_DAPM_ENUM("AIF1 Loopback", aif1_loopback_enum); | ||
1507 | |||
1508 | static const struct soc_enum aif2_loopback_enum = | ||
1509 | SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, WM8994_AIF2_LOOPBACK_SHIFT, 2, | ||
1510 | loopback_text); | ||
1511 | |||
1512 | static const struct snd_kcontrol_new aif2_loopback = | ||
1513 | SOC_DAPM_ENUM("AIF2 Loopback", aif2_loopback_enum); | ||
1514 | |||
1497 | static const struct soc_enum aif1dac_enum = | 1515 | static const struct soc_enum aif1dac_enum = |
1498 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 0, 2, aif1dac_text); | 1516 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 0, 2, aif1dac_text); |
1499 | 1517 | ||
@@ -1740,6 +1758,9 @@ SND_SOC_DAPM_ADC("DMIC1R", NULL, WM8994_POWER_MANAGEMENT_4, 2, 0), | |||
1740 | SND_SOC_DAPM_ADC("ADCL", NULL, SND_SOC_NOPM, 1, 0), | 1758 | SND_SOC_DAPM_ADC("ADCL", NULL, SND_SOC_NOPM, 1, 0), |
1741 | SND_SOC_DAPM_ADC("ADCR", NULL, SND_SOC_NOPM, 0, 0), | 1759 | SND_SOC_DAPM_ADC("ADCR", NULL, SND_SOC_NOPM, 0, 0), |
1742 | 1760 | ||
1761 | SND_SOC_DAPM_MUX("AIF1 Loopback", SND_SOC_NOPM, 0, 0, &aif1_loopback), | ||
1762 | SND_SOC_DAPM_MUX("AIF2 Loopback", SND_SOC_NOPM, 0, 0, &aif2_loopback), | ||
1763 | |||
1743 | SND_SOC_DAPM_POST("Debug log", post_ev), | 1764 | SND_SOC_DAPM_POST("Debug log", post_ev), |
1744 | }; | 1765 | }; |
1745 | 1766 | ||
@@ -1871,9 +1892,9 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1871 | { "AIF1DAC2L", NULL, "AIF1DAC Mux" }, | 1892 | { "AIF1DAC2L", NULL, "AIF1DAC Mux" }, |
1872 | { "AIF1DAC2R", NULL, "AIF1DAC Mux" }, | 1893 | { "AIF1DAC2R", NULL, "AIF1DAC Mux" }, |
1873 | 1894 | ||
1874 | { "AIF1DAC Mux", "AIF1DACDAT", "AIF1DACDAT" }, | 1895 | { "AIF1DAC Mux", "AIF1DACDAT", "AIF1 Loopback" }, |
1875 | { "AIF1DAC Mux", "AIF3DACDAT", "AIF3DACDAT" }, | 1896 | { "AIF1DAC Mux", "AIF3DACDAT", "AIF3DACDAT" }, |
1876 | { "AIF2DAC Mux", "AIF2DACDAT", "AIF2DACDAT" }, | 1897 | { "AIF2DAC Mux", "AIF2DACDAT", "AIF2 Loopback" }, |
1877 | { "AIF2DAC Mux", "AIF3DACDAT", "AIF3DACDAT" }, | 1898 | { "AIF2DAC Mux", "AIF3DACDAT", "AIF3DACDAT" }, |
1878 | { "AIF2ADC Mux", "AIF2ADCDAT", "AIF2ADCL" }, | 1899 | { "AIF2ADC Mux", "AIF2ADCDAT", "AIF2ADCL" }, |
1879 | { "AIF2ADC Mux", "AIF2ADCDAT", "AIF2ADCR" }, | 1900 | { "AIF2ADC Mux", "AIF2ADCDAT", "AIF2ADCR" }, |
@@ -1924,6 +1945,12 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1924 | { "AIF3ADCDAT", "AIF2DACDAT", "AIF2DACL" }, | 1945 | { "AIF3ADCDAT", "AIF2DACDAT", "AIF2DACL" }, |
1925 | { "AIF3ADCDAT", "AIF2DACDAT", "AIF2DACR" }, | 1946 | { "AIF3ADCDAT", "AIF2DACDAT", "AIF2DACR" }, |
1926 | 1947 | ||
1948 | /* Loopback */ | ||
1949 | { "AIF1 Loopback", "ADCDAT", "AIF1ADCDAT" }, | ||
1950 | { "AIF1 Loopback", "None", "AIF1DACDAT" }, | ||
1951 | { "AIF2 Loopback", "ADCDAT", "AIF2ADCDAT" }, | ||
1952 | { "AIF2 Loopback", "None", "AIF2DACDAT" }, | ||
1953 | |||
1927 | /* Sidetone */ | 1954 | /* Sidetone */ |
1928 | { "Left Sidetone", "ADC/DMIC1", "ADCL Mux" }, | 1955 | { "Left Sidetone", "ADC/DMIC1", "ADCL Mux" }, |
1929 | { "Left Sidetone", "DMIC2", "DMIC2L" }, | 1956 | { "Left Sidetone", "DMIC2", "DMIC2L" }, |