From dd379656a052e9261cabdbaa948ae779805af0cd Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Thu, 3 Dec 2015 10:47:05 +0800 Subject: [PATCH] MLK-11948: ASoC: fsl_esai: fix the channel swap issue after bootup Patch 11626b6a79e27c716f3731b7dc2208631afbc665 is not a complete workaround. The complete workaround is that: Each time playback/recording, firstly clear the xSMA/xSMB, then enable TE/RE, then enable xSMB and xSMA (xSMB must be enabled before xSMA). Because the xSMA and xSMB is in enabled state after reset, so in original fix the first time playback/recording after bootup, didn't follow the workaround flow. There maybe still have channel swap issue. The PDM ticket of this issue is TKT251104. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_esai.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index cf0d356dfdc8..dc7be8158a9b 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -603,10 +603,11 @@ static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd, tx ? ESAI_xCR_TE_MASK : ESAI_xCR_RE_MASK, tx ? ESAI_xCR_TE(pins) : ESAI_xCR_RE(pins)); mask = tx ? esai_priv->tx_mask : esai_priv->rx_mask; - regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMA(tx), - ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(mask)); + regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMB(tx), ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(mask)); + regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMA(tx), + ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(mask)); break; case SNDRV_PCM_TRIGGER_SUSPEND: @@ -1016,6 +1017,12 @@ static int fsl_esai_probe(struct platform_device *pdev) return ret; } + /* Clear the TSMA, TSMB, RSMA, RSMB */ + regmap_write(esai_priv->regmap, REG_ESAI_TSMA, 0); + regmap_write(esai_priv->regmap, REG_ESAI_TSMB, 0); + regmap_write(esai_priv->regmap, REG_ESAI_RSMA, 0); + regmap_write(esai_priv->regmap, REG_ESAI_RSMB, 0); + ret = devm_snd_soc_register_component(&pdev->dev, &fsl_esai_component, &fsl_esai_dai, 1); if (ret) { -- 2.17.1