]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ASoC: stm32: i2s: skip useless write in slave mode
authorOlivier Moysan <olivier.moysan@st.com>
Tue, 26 Feb 2019 13:51:10 +0000 (14:51 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 26 Feb 2019 15:42:10 +0000 (15:42 +0000)
Dummy write in capture master mode is used to gate
bus clocks. This write is useless in slave mode
as the clocks are not managed by slave.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/stm/stm32_i2s.c

index 42ce87a3510485a8246a6ab7fce6189d506fa4ae..47c334de6b0966a4e5fd4a589e8ce6fd757c1fce 100644 (file)
@@ -623,8 +623,8 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
                } else {
                        ier = I2S_IER_OVRIE;
 
-                       if (i2s->refcount == 1)
-                               /* dummy write to trigger capture */
+                       if (STM32_I2S_IS_MASTER(i2s) && i2s->refcount == 1)
+                               /* dummy write to gate bus clocks */
                                regmap_write(i2s->regmap,
                                             STM32_I2S_TXDR_REG, 0);
                }