Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+22 -5
+22 -5
sound/soc/codecs/wm8994.c
··· 2069 2069 return 0; 2070 2070 } 2071 2071 2072 - static const char *aifdac_src_text[] = { 2072 + static const char *aif_chan_src_text[] = { 2073 2073 "Left", "Right" 2074 2074 }; 2075 2075 2076 + static const struct soc_enum aif1adcl_src = 2077 + SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 15, 2, aif_chan_src_text); 2078 + 2079 + static const struct soc_enum aif1adcr_src = 2080 + SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 14, 2, aif_chan_src_text); 2081 + 2082 + static const struct soc_enum aif2adcl_src = 2083 + SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 15, 2, aif_chan_src_text); 2084 + 2085 + static const struct soc_enum aif2adcr_src = 2086 + SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 14, 2, aif_chan_src_text); 2087 + 2076 2088 static 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 2079 2091 static 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 2082 2094 static 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 2085 2097 static 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 2088 2100 static const struct snd_kcontrol_new wm8994_snd_controls[] = { 2089 2101 SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME, ··· 2107 2095 SOC_DOUBLE_R_TLV("AIF2ADC Volume", WM8994_AIF2_ADC_LEFT_VOLUME, 2108 2096 WM8994_AIF2_ADC_RIGHT_VOLUME, 2109 2097 1, 119, 0, digital_tlv), 2098 + 2099 + SOC_ENUM("AIF1ADCL Source", aif1adcl_src), 2100 + SOC_ENUM("AIF1ADCR Source", aif1adcr_src), 2101 + SOC_ENUM("AIF2ADCL Source", aif1adcl_src), 2102 + SOC_ENUM("AIF2ADCR Source", aif1adcr_src), 2110 2103 2111 2104 SOC_ENUM("AIF1DACL Source", aif1dacl_src), 2112 2105 SOC_ENUM("AIF1DACR Source", aif1dacr_src),