MLK-11948: ASoC: fsl_esai: fix the channel swap issue after bootup
authorShengjiu Wang <shengjiu.wang@freescale.com>
Thu, 3 Dec 2015 02:47:05 +0000 (10:47 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:28 +0000 (14:49 -0500)
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 <shengjiu.wang@freescale.com>
sound/soc/fsl/fsl_esai.c

index cf0d356..dc7be81 100644 (file)
@@ -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) {