From: Timur Tabi Date: Thu, 7 Aug 2008 16:22:32 +0000 (-0500) Subject: ASoC: Disable automatic volume control in the CS4270 sound driver X-Git-Tag: firefly_0821_release~16490^2~11^2~149 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c235d1e837c142b7565814318b6ba5917d5ac32;p=firefly-linux-kernel-4.4.55.git ASoC: Disable automatic volume control in the CS4270 sound driver Disable the automatic volume control feature of the CS4270 audio codec. This feature, which is enabled by default, causes volume change commands to be delayed. Sometimes the volume change happens after playback is started. Signed-off-by: Timur Tabi Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index 0bbd94501d7e..0ff476d7057c 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c @@ -450,6 +450,19 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream, return ret; } + /* Disable automatic volume control. It's enabled by default, and + * it causes volume change commands to be delayed, sometimes until + * after playback has started. + */ + + reg = cs4270_read_reg_cache(codec, CS4270_TRANS); + reg &= ~(CS4270_TRANS_SOFT | CS4270_TRANS_ZERO); + ret = cs4270_i2c_write(codec, CS4270_TRANS, reg); + if (ret < 0) { + printk(KERN_ERR "I2C write failed\n"); + return ret; + } + /* Thaw and power-up the codec */ ret = snd_soc_write(codec, CS4270_PWRCTL, 0);