aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Oleszczyk <oleszczyk.m@gmail.com>2018-02-02 07:10:29 -0500
committerMark Brown <broonie@kernel.org>2018-02-14 10:36:41 -0500
commitc5489f9fc053c744c609f34b32efca395cc2fdad (patch)
tree5b3a7875eb76fe16c68ecd24c6b2d1b9e5871902
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff)
sgtl5000: change digital_mute policy
Current implementation mute codec in global way (DAC block). That means when user routes sound not from I2S but from AUX source (LINE_IN) it also will be muted by alsa core. This should not happen. Signed-off-by: Michal Oleszczyk <oleszczyk.m@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/sgtl5000.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index e1ab5537d27a..c445a0794a27 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -529,10 +529,15 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = {
529static int sgtl5000_digital_mute(struct snd_soc_dai *codec_dai, int mute) 529static int sgtl5000_digital_mute(struct snd_soc_dai *codec_dai, int mute)
530{ 530{
531 struct snd_soc_codec *codec = codec_dai->codec; 531 struct snd_soc_codec *codec = codec_dai->codec;
532 u16 adcdac_ctrl = SGTL5000_DAC_MUTE_LEFT | SGTL5000_DAC_MUTE_RIGHT; 532 u16 i2s_pwr = SGTL5000_I2S_IN_POWERUP;
533 533
534 snd_soc_update_bits(codec, SGTL5000_CHIP_ADCDAC_CTRL, 534 /*
535 adcdac_ctrl, mute ? adcdac_ctrl : 0); 535 * During 'digital mute' do not mute DAC
536 * because LINE_IN would be muted aswell. We want to mute
537 * only I2S block - this can be done by powering it off
538 */
539 snd_soc_update_bits(codec, SGTL5000_CHIP_DIG_POWER,
540 i2s_pwr, mute ? 0 : i2s_pwr);
536 541
537 return 0; 542 return 0;
538} 543}
@@ -1237,6 +1242,10 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
1237 */ 1242 */
1238 snd_soc_write(codec, SGTL5000_DAP_CTRL, 0); 1243 snd_soc_write(codec, SGTL5000_DAP_CTRL, 0);
1239 1244
1245 /* Unmute DAC after start */
1246 snd_soc_update_bits(codec, SGTL5000_CHIP_ADCDAC_CTRL,
1247 SGTL5000_DAC_MUTE_LEFT | SGTL5000_DAC_MUTE_RIGHT, 0);
1248
1240 return 0; 1249 return 0;
1241 1250
1242err: 1251err: