From: Shengjiu Wang <[email protected]>
The context private data persists for the lifetime of an open substream,
but fsl_easrc_prefilter_config() does not reset the prefilter exponent
adjustments when hw_params reconfigures it.
Repeated integer-to-float configurations therefore accumulate negative
adjustments, while configurations that no longer need format scaling
retain the previous adjustments. Changing between single-stage and
two-stage prefilters can also leave an adjustment on the wrong stage.
This incorrectly scales the prefilter coefficients and can eventually
cause coefficient normalization to fail with -EINVAL.
Reset both stage adjustments before deriving them from the current rates
and formats, so each configuration is independent of the previous one.
Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Shengjiu Wang <[email protected]>
---
sound/soc/fsl/fsl_easrc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index f8da492beb82..7aea67622314 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -564,6 +564,8 @@ static int fsl_easrc_prefilter_config(struct fsl_asrc
*easrc,
ctx_priv->st1_num_taps = 0;
ctx_priv->st2_num_taps = 0;
+ ctx_priv->st1_addexp = 0;
+ ctx_priv->st2_addexp = 0;
regmap_write(easrc->regmap, REG_EASRC_CCE1(ctx_id), 0);
regmap_write(easrc->regmap, REG_EASRC_CCE2(ctx_id), 0);
--
2.34.1