alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl_esai: Fix TDM slot setup for I2S mode
@ 2021-04-02  8:14 Alexander Shiyan
  2021-04-02  8:57 ` Nicolin Chen
  2021-04-02 16:45 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shiyan @ 2021-04-02  8:14 UTC (permalink / raw)
  To: alsa-devel
  Cc: Alexander Shiyan, Timur Tabi, Xiubo Li, Fabio Estevam,
	Takashi Iwai, Liam Girdwood, Nicolin Chen, Mark Brown,
	Shengjiu Wang

When using the driver in I2S TDM mode, the fsl_esai_startup()
function rewrites the number of slots previously set by the
fsl_esai_set_dai_tdm_slot() function to 2.
To fix this, let's use the saved slot count value or, if TDM
is not used and the number of slots is not set, the driver will use
the default value (2), which is set by fsl_esai_probe().

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 sound/soc/fsl/fsl_esai.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 08056fa0a0fa..a857a624864f 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -519,11 +519,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
 				   ESAI_SAICR_SYNC, esai_priv->synchronous ?
 				   ESAI_SAICR_SYNC : 0);
 
-		/* Set a default slot number -- 2 */
+		/* Set slots count */
 		regmap_update_bits(esai_priv->regmap, REG_ESAI_TCCR,
-				   ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
+				   ESAI_xCCR_xDC_MASK,
+				   ESAI_xCCR_xDC(esai_priv->slots));
 		regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,
-				   ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
+				   ESAI_xCCR_xDC_MASK,
+				   ESAI_xCCR_xDC(esai_priv->slots));
 	}
 
 	return 0;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: fsl_esai: Fix TDM slot setup for I2S mode
  2021-04-02  8:14 [PATCH] ASoC: fsl_esai: Fix TDM slot setup for I2S mode Alexander Shiyan
@ 2021-04-02  8:57 ` Nicolin Chen
  2021-04-02 16:45 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolin Chen @ 2021-04-02  8:57 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: alsa-devel, Timur Tabi, Xiubo Li, Fabio Estevam, Takashi Iwai,
	Liam Girdwood, Mark Brown, Shengjiu Wang

On Fri, Apr 02, 2021 at 11:14:05AM +0300, Alexander Shiyan wrote:
> When using the driver in I2S TDM mode, the fsl_esai_startup()
> function rewrites the number of slots previously set by the
> fsl_esai_set_dai_tdm_slot() function to 2.
> To fix this, let's use the saved slot count value or, if TDM
> is not used and the number of slots is not set, the driver will use
> the default value (2), which is set by fsl_esai_probe().
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: fsl_esai: Fix TDM slot setup for I2S mode
  2021-04-02  8:14 [PATCH] ASoC: fsl_esai: Fix TDM slot setup for I2S mode Alexander Shiyan
  2021-04-02  8:57 ` Nicolin Chen
@ 2021-04-02 16:45 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-04-02 16:45 UTC (permalink / raw)
  To: alsa-devel, Alexander Shiyan
  Cc: Timur Tabi, Xiubo Li, Fabio Estevam, Liam Girdwood, Takashi Iwai,
	Nicolin Chen, Mark Brown, Shengjiu Wang

On Fri, 2 Apr 2021 11:14:05 +0300, Alexander Shiyan wrote:
> When using the driver in I2S TDM mode, the fsl_esai_startup()
> function rewrites the number of slots previously set by the
> fsl_esai_set_dai_tdm_slot() function to 2.
> To fix this, let's use the saved slot count value or, if TDM
> is not used and the number of slots is not set, the driver will use
> the default value (2), which is set by fsl_esai_probe().

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl_esai: Fix TDM slot setup for I2S mode
      commit: e7a48c710defa0e0fef54d42b7d9e4ab596e2761

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-02 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02  8:14 [PATCH] ASoC: fsl_esai: Fix TDM slot setup for I2S mode Alexander Shiyan
2021-04-02  8:57 ` Nicolin Chen
2021-04-02 16:45 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).