diff options
author | Shengjiu Wang <shengjiu.wang@nxp.com> | 2019-10-12 13:19:35 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:48:52 +0800 |
commit | d92835b3d06facb54890535d8f18ca55c78585fb (patch) | |
tree | 05917b55721109ce5ad737353a9caa08a8e188c9 /sound/soc/fsl/fsl_easrc.c | |
parent | 03944b23b2f2da1b05e79dad3d46db3cd31fd1c6 (diff) |
MLK-22722: ASoC: fsl_easrc: Use global variable instead local variable
After suspend & resume, there may be noise in asrc output. The reason
is the coeff variable is local, in resume function this variable is
invalid to access, so that cause the prefilter coeff not correctly be
setted.
This patch is to change the coeff variable to be global that we can
get the correct value in resume.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 56aa181b23f82280af01dbe1193123d30af61690)
Diffstat (limited to 'sound/soc/fsl/fsl_easrc.c')
-rw-r--r-- | sound/soc/fsl/fsl_easrc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index d35957c85a9a..c7917ccf8c82 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -503,7 +503,6 @@ static int fsl_easrc_prefilter_config(struct fsl_easrc *easrc, struct device *dev; u32 inrate, outrate, offset = 0; int ret, i; - u64 coeff = 0x3FF0000000000000; /* Used by float->int */ /* to modify prefilter coeficients, the user must perform * a write in ASRC_PRE_COEFF_FIFO[COEFF_DATA] while the @@ -553,20 +552,20 @@ static int fsl_easrc_prefilter_config(struct fsl_easrc *easrc, if (ctx->in_params.sample_format == SNDRV_PCM_FORMAT_FLOAT_LE && ctx->out_params.sample_format != SNDRV_PCM_FORMAT_FLOAT_LE) { ctx->st1_num_taps = 1; - ctx->st1_coeff = &coeff; + ctx->st1_coeff = &easrc->const_coeff; ctx->st1_num_exp = 1; ctx->st2_num_taps = 0; ctx->st1_addexp = 31; } else if (ctx->in_params.sample_format != SNDRV_PCM_FORMAT_FLOAT_LE && ctx->out_params.sample_format == SNDRV_PCM_FORMAT_FLOAT_LE) { ctx->st1_num_taps = 1; - ctx->st1_coeff = &coeff; + ctx->st1_coeff = &easrc->const_coeff; ctx->st1_num_exp = 1; ctx->st2_num_taps = 0; ctx->st1_addexp -= ctx->in_params.fmt.addexp; } else { ctx->st1_num_taps = 1; - ctx->st1_coeff = &coeff; + ctx->st1_coeff = &easrc->const_coeff; ctx->st1_num_exp = 1; ctx->st2_num_taps = 0; } @@ -2318,6 +2317,7 @@ static int fsl_easrc_probe(struct platform_device *pdev) /*Set default value*/ easrc->chn_avail = 32; easrc->rs_num_taps = EASRC_RS_128_TAPS; + easrc->const_coeff = 0x3FF0000000000000; ret = of_property_read_u32(np, "fsl,asrc-rate", &easrc->easrc_rate); |