未验证 提交 6e682580 编写于 作者: R Richard Fitzgerald 提交者: Mark Brown

ASoC: cs42l42: Always configure both ASP TX channels

An I2S frame always has two slots (left and right) even when sending
mono. The right channel (channel 2) of ASP TX will always have the
same bit width as the left channel and will always be on the high
phase of LRCLK.

The previous implementation always passed the field masks for both
channels to snd_soc_component_update_bits() but for mono the written value
only contained the settings for channel 1. The result was that for mono
channel 2 was set to 8-bit (which is an invalid configuration) with both
channels on the low phase of LRCLK.
Signed-off-by: NRichard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 585e7079 ("ASoC: cs42l42: Add Capture Support")
Link: https://lore.kernel.org/r/20211015133619.4698-3-rf@opensource.cirrus.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 06441c82
...@@ -861,11 +861,10 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -861,11 +861,10 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream,
switch(substream->stream) { switch(substream->stream) {
case SNDRV_PCM_STREAM_CAPTURE: case SNDRV_PCM_STREAM_CAPTURE:
if (channels == 2) { /* channel 2 on high LRCLK */
val |= CS42L42_ASP_TX_CH2_AP_MASK; val = CS42L42_ASP_TX_CH2_AP_MASK |
val |= width << CS42L42_ASP_TX_CH2_RES_SHIFT; (width << CS42L42_ASP_TX_CH2_RES_SHIFT) |
} (width << CS42L42_ASP_TX_CH1_RES_SHIFT);
val |= width << CS42L42_ASP_TX_CH1_RES_SHIFT;
snd_soc_component_update_bits(component, CS42L42_ASP_TX_CH_AP_RES, snd_soc_component_update_bits(component, CS42L42_ASP_TX_CH_AP_RES,
CS42L42_ASP_TX_CH1_AP_MASK | CS42L42_ASP_TX_CH2_AP_MASK | CS42L42_ASP_TX_CH1_AP_MASK | CS42L42_ASP_TX_CH2_AP_MASK |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册