diff options
author | Zidan Wang <zidan.wang@freescale.com> | 2015-11-24 10:18:27 +0800 |
---|---|---|
committer | Zidan Wang <zidan.wang@freescale.com> | 2016-03-04 19:24:43 +0800 |
commit | 06291d2c21c80adf139e7c1b46eb4441c7dcf81d (patch) | |
tree | a9a064aa2d36b90b5d3a3915c5af62d093460c8c /sound | |
parent | ce632c5ce696af1089b004adf1dd9611609460dd (diff) |
ASoC: cs42xx8: fix the noise in the right dac channel with mono playback
When playback mono wav with record in background, there will be some
nosie in the right dac channel. It seems that the ADC data has been
routed to the dac channel.
The cs42888 have 8 dac channels, it's appropriate to mute the unused
dac channels, and the noise will disappear.
Steps to reproduce this issue:
arecord -D hw:0,0 -f S16_LE -r 48000 -c 1 a.wav &
aplay -Dhw:0,0 audio48k16M.wav
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 1f1e60c9cdd573be271130e44a23efed48e0578d)
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/cs42xx8.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index ffe04a0b5bdf..51b183c66869 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c @@ -45,6 +45,7 @@ struct cs42xx8_priv { bool slave_mode; unsigned long sysclk; int rate[2]; + u32 tx_channels; }; /* -127.5dB to 0dB with step of 0.5dB */ @@ -250,6 +251,9 @@ static int cs42xx8_hw_params(struct snd_pcm_substream *substream, u32 fm_tx, fm_rx; u32 i, fm, val, mask; + if (tx) + cs42xx8->tx_channels = params_channels(params); + rate_tx = tx ? rate : cs42xx8->rate[0]; rate_rx = tx ? cs42xx8->rate[1] : rate; @@ -344,9 +348,11 @@ static int cs42xx8_digital_mute(struct snd_soc_dai *dai, int mute) { struct snd_soc_codec *codec = dai->codec; struct cs42xx8_priv *cs42xx8 = snd_soc_codec_get_drvdata(codec); + u8 dac_unmute = cs42xx8->tx_channels ? + ~((0x1 << cs42xx8->tx_channels) - 1) : 0; - regmap_update_bits(cs42xx8->regmap, CS42XX8_DACMUTE, - CS42XX8_DACMUTE_ALL, mute ? CS42XX8_DACMUTE_ALL : 0); + regmap_write(cs42xx8->regmap, CS42XX8_DACMUTE, + mute ? CS42XX8_DACMUTE_ALL : dac_unmute); return 0; } |