From: Mark Brown Date: Wed, 14 Feb 2018 15:39:30 +0000 (+0000) Subject: Merge branch 'fix/sgtl5000' of https://git.kernel.org/pub/scm/linux/kernel/git/brooni... X-Git-Tag: v5.15~8593^2~32^2~30^3~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58fadc19e484a6269521eede6bdb1030d2dc18c0;p=platform%2Fkernel%2Flinux-starfive.git Merge branch 'fix/sgtl5000' of https://git./linux/kernel/git/broonie/sound into asoc-sgtl5000 --- 58fadc19e484a6269521eede6bdb1030d2dc18c0 diff --cc sound/soc/codecs/sgtl5000.c index c26ac22,c445a07..975a9d7 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@@ -528,11 -528,16 +528,16 @@@ static const struct snd_kcontrol_new sg /* mute the codec used by alsa core */ static int sgtl5000_digital_mute(struct snd_soc_dai *codec_dai, int mute) { - struct snd_soc_codec *codec = codec_dai->codec; + struct snd_soc_component *component = codec_dai->component; - u16 adcdac_ctrl = SGTL5000_DAC_MUTE_LEFT | SGTL5000_DAC_MUTE_RIGHT; + u16 i2s_pwr = SGTL5000_I2S_IN_POWERUP; - snd_soc_component_update_bits(component, SGTL5000_CHIP_ADCDAC_CTRL, - adcdac_ctrl, mute ? adcdac_ctrl : 0); + /* + * During 'digital mute' do not mute DAC + * because LINE_IN would be muted aswell. We want to mute + * only I2S block - this can be done by powering it off + */ - snd_soc_update_bits(codec, SGTL5000_CHIP_DIG_POWER, ++ snd_soc_component_update_bits(component, SGTL5000_CHIP_DIG_POWER, + i2s_pwr, mute ? 0 : i2s_pwr); return 0; } @@@ -1235,8 -1240,12 +1240,12 @@@ static int sgtl5000_probe(struct snd_so * TODO: * Enable DAP in kcontrol and dapm. */ - snd_soc_write(codec, SGTL5000_DAP_CTRL, 0); + snd_soc_component_write(component, SGTL5000_DAP_CTRL, 0); + /* Unmute DAC after start */ - snd_soc_update_bits(codec, SGTL5000_CHIP_ADCDAC_CTRL, ++ snd_soc_component_update_bits(component, SGTL5000_CHIP_ADCDAC_CTRL, + SGTL5000_DAC_MUTE_LEFT | SGTL5000_DAC_MUTE_RIGHT, 0); + return 0; err: