aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-18 10:49:38 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-19 06:17:27 -0500
commit96b101efae0ab68b6510fdbb30384849d211da2c (patch)
tree7545cfd705e55c6da434acbce7a669b64937805c
parent3df94756fe9026c6386ebd10501c2df85df3dbee (diff)
ASoC: Provide ADC left/right channel source selection on WM8994
Allow the application to choose if the ADC data presented on the left and right channels is sourced from the internal left or right channel. This allows a mono recording to be presented as stereo on the external bus. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--sound/soc/codecs/wm8994.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index bfdb7daeed2d..7d2f488de6a7 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2069,21 +2069,33 @@ static int wm8994_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,
2069 return 0; 2069 return 0;
2070} 2070}
2071 2071
2072static const char *aifdac_src_text[] = { 2072static const char *aif_chan_src_text[] = {
2073 "Left", "Right" 2073 "Left", "Right"
2074}; 2074};
2075 2075
2076static const struct soc_enum aif1adcl_src =
2077 SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 15, 2, aif_chan_src_text);
2078
2079static const struct soc_enum aif1adcr_src =
2080 SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 14, 2, aif_chan_src_text);
2081
2082static const struct soc_enum aif2adcl_src =
2083 SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 15, 2, aif_chan_src_text);
2084
2085static const struct soc_enum aif2adcr_src =
2086 SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 14, 2, aif_chan_src_text);
2087
2076static const struct soc_enum aif1dacl_src = 2088static const struct soc_enum aif1dacl_src =
2077 SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 15, 2, aifdac_src_text); 2089 SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 15, 2, aif_chan_src_text);
2078 2090
2079static const struct soc_enum aif1dacr_src = 2091static const struct soc_enum aif1dacr_src =
2080 SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 14, 2, aifdac_src_text); 2092 SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 14, 2, aif_chan_src_text);
2081 2093
2082static const struct soc_enum aif2dacl_src = 2094static const struct soc_enum aif2dacl_src =
2083 SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 15, 2, aifdac_src_text); 2095 SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 15, 2, aif_chan_src_text);
2084 2096
2085static const struct soc_enum aif2dacr_src = 2097static const struct soc_enum aif2dacr_src =
2086 SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 14, 2, aifdac_src_text); 2098 SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 14, 2, aif_chan_src_text);
2087 2099
2088static const struct snd_kcontrol_new wm8994_snd_controls[] = { 2100static const struct snd_kcontrol_new wm8994_snd_controls[] = {
2089SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME, 2101SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME,
@@ -2096,6 +2108,11 @@ SOC_DOUBLE_R_TLV("AIF2ADC Volume", WM8994_AIF2_ADC_LEFT_VOLUME,
2096 WM8994_AIF2_ADC_RIGHT_VOLUME, 2108 WM8994_AIF2_ADC_RIGHT_VOLUME,
2097 1, 119, 0, digital_tlv), 2109 1, 119, 0, digital_tlv),
2098 2110
2111SOC_ENUM("AIF1ADCL Source", aif1adcl_src),
2112SOC_ENUM("AIF1ADCR Source", aif1adcr_src),
2113SOC_ENUM("AIF2ADCL Source", aif1adcl_src),
2114SOC_ENUM("AIF2ADCR Source", aif1adcr_src),
2115
2099SOC_ENUM("AIF1DACL Source", aif1dacl_src), 2116SOC_ENUM("AIF1DACL Source", aif1dacl_src),
2100SOC_ENUM("AIF1DACR Source", aif1dacr_src), 2117SOC_ENUM("AIF1DACR Source", aif1dacr_src),
2101SOC_ENUM("AIF2DACL Source", aif1dacl_src), 2118SOC_ENUM("AIF2DACL Source", aif1dacl_src),