summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/es8316.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2019-01-03 16:45:27 +0300
committerMark Brown <broonie@kernel.org>2019-01-04 18:12:05 +0300
commit24b53f17a3f24967b8b523243f9f7fc361427119 (patch)
treec8b8dbc8831f56afbb6dad29f8f5e04c67e98c21 /sound/soc/codecs/es8316.c
parent822257661031faa437336058d8a32bf1844ad9c6 (diff)
downloadlinux-24b53f17a3f24967b8b523243f9f7fc361427119.tar.xz
ASoC: es8316: Add DAC mono mix switch mixer control
Export the DAC functionality to mix left + right together and then output the same (mixed) signal on both outputs. Various (x86) tablets with an ES8316 codec use a single speaker connected between the headhpone LOUT and ROUT pins, expecting the output to be in a mono differential mode. Presumably this is done to use the power of both the left and right outputs to allow the speaker to be louder. The ES8316 codec does not have a differential output mode, but we can emulate this by making both channels output the same through the mono mix switch, combined with setting the Playback Polarity control to "R Invert", which applias a 180 degrees phase inversion to the right channel. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/es8316.c')
-rw-r--r--sound/soc/codecs/es8316.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index 26413851e434..98464ba1046c 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -101,6 +101,7 @@ static const struct snd_kcontrol_new es8316_snd_controls[] = {
SOC_SINGLE("DAC Notch Filter Switch", ES8316_DAC_SET2, 6, 1, 0),
SOC_SINGLE("DAC Double Fs Switch", ES8316_DAC_SET2, 7, 1, 0),
SOC_SINGLE("DAC Stereo Enhancement", ES8316_DAC_SET3, 0, 7, 0),
+ SOC_SINGLE("DAC Mono Mix Switch", ES8316_DAC_SET3, 3, 1, 0),
SOC_ENUM("Capture Polarity", adcpol),
SOC_SINGLE("Mic Boost Switch", ES8316_ADC_D2SEPGA, 0, 1, 0),