All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl_ssi: Fix TDM slot setup for I2S mode
@ 2021-02-16 11:42 Alexander Shiyan
  2021-02-18  6:26 ` Nicolin Chen
  2021-02-23 14:10 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shiyan @ 2021-02-16 11:42 UTC (permalink / raw)
  To: alsa-devel
  Cc: Alexander Shiyan, Timur Tabi, Xiubo Li, Shengjiu Wang,
	Nicolin Chen, Mark Brown, Fabio Estevam

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

Fixes: 4f14f5c11db1 ("ASoC: fsl_ssi: Fix number of words per frame for I2S-slave mode")
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 sound/soc/fsl/fsl_ssi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 404be27c15fe..1d774c876c52 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -878,6 +878,7 @@ static int fsl_ssi_hw_free(struct snd_pcm_substream *substream,
 static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt)
 {
 	u32 strcr = 0, scr = 0, stcr, srcr, mask;
+	unsigned int slots;
 
 	ssi->dai_fmt = fmt;
 
@@ -909,10 +910,11 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt)
 			return -EINVAL;
 		}
 
+		slots = ssi->slots ? : 2;
 		regmap_update_bits(ssi->regs, REG_SSI_STCCR,
-				   SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2));
+				   SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots));
 		regmap_update_bits(ssi->regs, REG_SSI_SRCCR,
-				   SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2));
+				   SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots));
 
 		/* Data on rising edge of bclk, frame low, 1clk before data */
 		strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP | SSI_STCR_TEFS;
-- 
2.26.2


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

* Re: [PATCH] ASoC: fsl_ssi: Fix TDM slot setup for I2S mode
  2021-02-16 11:42 [PATCH] ASoC: fsl_ssi: Fix TDM slot setup for I2S mode Alexander Shiyan
@ 2021-02-18  6:26 ` Nicolin Chen
  2021-02-23 14:10 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolin Chen @ 2021-02-18  6:26 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: alsa-devel, Timur Tabi, Xiubo Li, Shengjiu Wang, Mark Brown,
	Fabio Estevam

On Tue, Feb 16, 2021 at 02:42:21PM +0300, Alexander Shiyan wrote:
> When using the driver in I2S TDM mode, the _fsl_ssi_set_dai_fmt()
> function rewrites the number of slots previously set by the
> fsl_ssi_set_dai_tdm_slot() function to 2 by default.
> To fix this, let's use the saved slot count value or, if TDM
> is not used and the slot count is not set, proceed as before.
> 
> Fixes: 4f14f5c11db1 ("ASoC: fsl_ssi: Fix number of words per frame for I2S-slave mode")
> 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_ssi: Fix TDM slot setup for I2S mode
  2021-02-16 11:42 [PATCH] ASoC: fsl_ssi: Fix TDM slot setup for I2S mode Alexander Shiyan
  2021-02-18  6:26 ` Nicolin Chen
@ 2021-02-23 14:10 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-02-23 14:10 UTC (permalink / raw)
  To: alsa-devel, Alexander Shiyan
  Cc: Nicolin Chen, Fabio Estevam, Shengjiu Wang, Timur Tabi, Xiubo Li

On Tue, 16 Feb 2021 14:42:21 +0300, Alexander Shiyan wrote:
> When using the driver in I2S TDM mode, the _fsl_ssi_set_dai_fmt()
> function rewrites the number of slots previously set by the
> fsl_ssi_set_dai_tdm_slot() function to 2 by default.
> To fix this, let's use the saved slot count value or, if TDM
> is not used and the slot count is not set, proceed as before.

Applied to

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

Thanks!

[1/1] ASoC: fsl_ssi: Fix TDM slot setup for I2S mode
      commit: 9fd914d917da05641b42cab7d40bdf8ab06dac3b

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-02-23 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 11:42 [PATCH] ASoC: fsl_ssi: Fix TDM slot setup for I2S mode Alexander Shiyan
2021-02-18  6:26 ` Nicolin Chen
2021-02-23 14:10 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.