未验证 提交 b4b5f29a 编写于 作者: P Philipp Zabel 提交者: Mark Brown

ASoC: codec: tlv320aic32x4: fix mono playback via I2S

The two commits referenced below break mono playback via I2S DAI because
they set BCLK to half the required speed. For PCM transport over I2S, the
number of transmitted channels is always 2, even for mono playback.

Fixes: dcd79364 ("ASoC: codec: tlv3204: Enable 24 bit audio support")
Fixes: 40b37136 ("ASoC: tlv320aic32x4: Fix bdiv clock rate derivation")
Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20220810104156.665452-1-p.zabel@pengutronix.deSigned-off-by: NMark Brown <broonie@kernel.org>
上级 50ee138f
...@@ -49,6 +49,8 @@ struct aic32x4_priv { ...@@ -49,6 +49,8 @@ struct aic32x4_priv {
struct aic32x4_setup_data *setup; struct aic32x4_setup_data *setup;
struct device *dev; struct device *dev;
enum aic32x4_type type; enum aic32x4_type type;
unsigned int fmt;
}; };
static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w, static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w,
...@@ -611,6 +613,7 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai, ...@@ -611,6 +613,7 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{ {
struct snd_soc_component *component = codec_dai->component; struct snd_soc_component *component = codec_dai->component;
struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component);
u8 iface_reg_1 = 0; u8 iface_reg_1 = 0;
u8 iface_reg_2 = 0; u8 iface_reg_2 = 0;
u8 iface_reg_3 = 0; u8 iface_reg_3 = 0;
...@@ -653,6 +656,8 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -653,6 +656,8 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
return -EINVAL; return -EINVAL;
} }
aic32x4->fmt = fmt;
snd_soc_component_update_bits(component, AIC32X4_IFACE1, snd_soc_component_update_bits(component, AIC32X4_IFACE1,
AIC32X4_IFACE1_DATATYPE_MASK | AIC32X4_IFACE1_DATATYPE_MASK |
AIC32X4_IFACE1_MASTER_MASK, iface_reg_1); AIC32X4_IFACE1_MASTER_MASK, iface_reg_1);
...@@ -757,6 +762,10 @@ static int aic32x4_setup_clocks(struct snd_soc_component *component, ...@@ -757,6 +762,10 @@ static int aic32x4_setup_clocks(struct snd_soc_component *component,
return -EINVAL; return -EINVAL;
} }
/* PCM over I2S is always 2-channel */
if ((aic32x4->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S)
channels = 2;
madc = DIV_ROUND_UP((32 * adc_resource_class), aosr); madc = DIV_ROUND_UP((32 * adc_resource_class), aosr);
max_dosr = (AIC32X4_MAX_DOSR_FREQ / sample_rate / dosr_increment) * max_dosr = (AIC32X4_MAX_DOSR_FREQ / sample_rate / dosr_increment) *
dosr_increment; dosr_increment;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册