linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [stable 4.19][PATCH 13/17] ASoC: stm32: i2s: fix dma configuration
Date: Thu, 28 Nov 2019 09:49:58 -0700	[thread overview]
Message-ID: <20191128165002.6234-14-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org>

From: Olivier Moysan <olivier.moysan@st.com>

commit 1ac2bd16448997d9ec01922423486e1e85535eda upstream

DMA configuration is not balanced on start/stop.
Move DMA configuration to trigger callback.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable <stable@vger.kernel.org> # 4.19
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 sound/soc/stm/stm32_i2s.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c
index 6d0bf78d114d..449bb7049a28 100644
--- a/sound/soc/stm/stm32_i2s.c
+++ b/sound/soc/stm/stm32_i2s.c
@@ -488,7 +488,7 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai,
 {
 	struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai);
 	int format = params_width(params);
-	u32 cfgr, cfgr_mask, cfg1, cfg1_mask;
+	u32 cfgr, cfgr_mask, cfg1;
 	unsigned int fthlv;
 	int ret;
 
@@ -529,15 +529,11 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai,
 	if (ret < 0)
 		return ret;
 
-	cfg1 = I2S_CFG1_RXDMAEN | I2S_CFG1_TXDMAEN;
-	cfg1_mask = cfg1;
-
 	fthlv = STM32_I2S_FIFO_SIZE * I2S_FIFO_TH_ONE_QUARTER / 4;
-	cfg1 |= I2S_CFG1_FTHVL_SET(fthlv - 1);
-	cfg1_mask |= I2S_CFG1_FTHVL_MASK;
+	cfg1 = I2S_CFG1_FTHVL_SET(fthlv - 1);
 
 	return regmap_update_bits(i2s->regmap, STM32_I2S_CFG1_REG,
-				  cfg1_mask, cfg1);
+				  I2S_CFG1_FTHVL_MASK, cfg1);
 }
 
 static int stm32_i2s_startup(struct snd_pcm_substream *substream,
@@ -589,6 +585,10 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
 		/* Enable i2s */
 		dev_dbg(cpu_dai->dev, "start I2S\n");
 
+		cfg1_mask = I2S_CFG1_RXDMAEN | I2S_CFG1_TXDMAEN;
+		regmap_update_bits(i2s->regmap, STM32_I2S_CFG1_REG,
+				   cfg1_mask, cfg1_mask);
+
 		ret = regmap_update_bits(i2s->regmap, STM32_I2S_CR1_REG,
 					 I2S_CR1_SPE, I2S_CR1_SPE);
 		if (ret < 0) {
-- 
2.17.1


  parent reply	other threads:[~2019-11-28 16:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-28 16:49 [stable 4.19][PATCH 00/17] candidates for stable 4.19.y Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 01/17] mailbox: stm32_ipcc: add spinlock to fix channels concurrent access Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 02/17] crypto: stm31/hash - Fix hmac issue more than 256 bytes Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 03/17] media: stm32-dcmi: fix DMA corruption when stopping streaming Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 04/17] media: stm32-dcmi: fix check of pm_runtime_get_sync return value Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 05/17] hwrng: stm32 - fix unbalanced pm_runtime_enable Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 06/17] remoteproc: fix rproc_da_to_va in case of unallocated carveout Mathieu Poirier
2019-12-03 19:43   ` Greg KH
2019-12-04 18:13     ` Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 07/17] clk: stm32mp1: fix HSI divider flag Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 08/17] clk: stm32mp1: fix mcu divider table Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 09/17] clk: stm32mp1: add CLK_SET_RATE_NO_REPARENT to Kernel clocks Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 10/17] clk: stm32mp1: parent clocks update Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 11/17] mailbox: mailbox-test: fix null pointer if no mmio Mathieu Poirier
2019-11-28 16:49 ` [stable 4.19][PATCH 12/17] pinctrl: stm32: fix memory leak issue Mathieu Poirier
2019-11-28 16:49 ` Mathieu Poirier [this message]
2019-11-28 16:49 ` [stable 4.19][PATCH 14/17] ASoC: stm32: i2s: fix 16 bit format support Mathieu Poirier
2019-11-28 16:50 ` [stable 4.19][PATCH 15/17] ASoC: stm32: i2s: fix IRQ clearing Mathieu Poirier
2019-11-28 16:50 ` [stable 4.19][PATCH 16/17] ASoC: stm32: sai: add missing put_device() Mathieu Poirier
2019-11-28 16:50 ` [stable 4.19][PATCH 17/17] dmaengine: stm32-dma: check whether length is aligned on FIFO threshold Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191128165002.6234-14-mathieu.poirier@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).