[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3238f813-ac71-69e2-45bf-badb461dac82@intel.com>
Date: Wed, 3 Jul 2019 22:56:19 +0200
From: Cezary Rojewski <cezary.rojewski@...el.com>
To: shengjiu.wang@....com
Cc: timur@...nel.org, nicoleotsuka@...il.com, Xiubo.Lee@...il.com,
festevam@...il.com, broonie@...nel.org,
alsa-devel@...a-project.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 2/2] ASoC: fsl_esai: recover the channel swap after
xrun
On 2019-07-03 08:42, shengjiu.wang@....com wrote:
> +static void fsl_esai_reset(unsigned long arg)
> +{
> + struct fsl_esai *esai_priv = (struct fsl_esai *)arg;
> + u32 saisr, tfcr, rfcr;
> +
> + /* save the registers */
> + regmap_read(esai_priv->regmap, REG_ESAI_TFCR, &tfcr);
> + regmap_read(esai_priv->regmap, REG_ESAI_RFCR, &rfcr);
> +
> + /* stop the tx & rx */
> + fsl_esai_trigger_stop(esai_priv, 1);
> + fsl_esai_trigger_stop(esai_priv, 0);
> +
> + /* reset the esai, and restore the registers */
> + fsl_esai_init(esai_priv);
<comment below applies>
> +
> + regmap_update_bits(esai_priv->regmap, REG_ESAI_TCR,
> + ESAI_xCR_xPR_MASK,
> + ESAI_xCR_xPR);
> + regmap_update_bits(esai_priv->regmap, REG_ESAI_RCR,
> + ESAI_xCR_xPR_MASK,
> + ESAI_xCR_xPR);
> +
> + /* restore registers by regcache_sync */
> + fsl_esai_register_restore(esai_priv);
> +
Both _init and _restore may fail given their declaration in 1/2 "ASoC:
fsl_esai: Wrap some operations to be functions" yet here you simply
ignore the return values.
If failure of said functions is permissive, it might be a good place for
a comment.
Czarek
Powered by blists - more mailing lists