MLK-15039: ASoC: fsl_esai: Fix channels swap when recording 3 channels audio
authorMihai Serban <mihai.serban@nxp.com>
Thu, 8 Jun 2017 12:48:50 +0000 (15:48 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:28:10 +0000 (15:28 -0500)
The change introduced by commit 00c174b3b28a
("MLK-14525: ASoC: fsl_esai: channel swap issue in 3 channels or 5 channels")
is no longer valid after improvements added with commit c35bc6ae5c48
("MLK-14778: ASoC: fsl: imx-cs42888: Improve support for odd number of channels")

Because we use TDM instead of I2S for 3,5 and 7 channels we must
initialize ESAI with the actual number of channels. There is no need
to count the additional channel required when I2S was used.

Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
sound/soc/fsl/fsl_esai.c

index d056d9e..c62dc87 100644 (file)
@@ -830,7 +830,7 @@ static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd,
                                   ESAI_xFCR_xFEN_MASK, ESAI_xFCR_xFEN);
 
                /* Write initial words reqiured by ESAI as normal procedure */
-               for (i = 0; tx && i < pins * esai_priv->slots; i++)
+               for (i = 0; tx && i < channels; i++)
                        regmap_write(esai_priv->regmap, REG_ESAI_ETDR, 0x0);
 
                regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx),