Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c235d1e authored by Timur Tabi's avatar Timur Tabi Committed by Mark Brown
Browse files

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: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent ca53fb24
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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);