Commit 86c823d4 authored by Olivier Moysan's avatar Olivier Moysan Committed by Greg Kroah-Hartman

ASoC: stm32: i2s: fix IRQ clearing

commit 8ba3c521 upstream.

Because of regmap cache, interrupts may not be cleared
as expected.
Declare IFCR register as write only and make writings
to IFCR register unconditional.
Signed-off-by: default avatarOlivier Moysan <olivier.moysan@st.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cacd33b1
...@@ -246,8 +246,8 @@ static irqreturn_t stm32_i2s_isr(int irq, void *devid) ...@@ -246,8 +246,8 @@ static irqreturn_t stm32_i2s_isr(int irq, void *devid)
return IRQ_NONE; return IRQ_NONE;
} }
regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG,
I2S_IFCR_MASK, flags); I2S_IFCR_MASK, flags);
if (flags & I2S_SR_OVR) { if (flags & I2S_SR_OVR) {
dev_dbg(&pdev->dev, "Overrun\n"); dev_dbg(&pdev->dev, "Overrun\n");
...@@ -276,7 +276,6 @@ static bool stm32_i2s_readable_reg(struct device *dev, unsigned int reg) ...@@ -276,7 +276,6 @@ static bool stm32_i2s_readable_reg(struct device *dev, unsigned int reg)
case STM32_I2S_CFG2_REG: case STM32_I2S_CFG2_REG:
case STM32_I2S_IER_REG: case STM32_I2S_IER_REG:
case STM32_I2S_SR_REG: case STM32_I2S_SR_REG:
case STM32_I2S_IFCR_REG:
case STM32_I2S_TXDR_REG: case STM32_I2S_TXDR_REG:
case STM32_I2S_RXDR_REG: case STM32_I2S_RXDR_REG:
case STM32_I2S_CGFR_REG: case STM32_I2S_CGFR_REG:
...@@ -547,8 +546,8 @@ static int stm32_i2s_startup(struct snd_pcm_substream *substream, ...@@ -547,8 +546,8 @@ static int stm32_i2s_startup(struct snd_pcm_substream *substream,
i2s->refcount++; i2s->refcount++;
spin_unlock(&i2s->lock_fd); spin_unlock(&i2s->lock_fd);
return regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, return regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG,
I2S_IFCR_MASK, I2S_IFCR_MASK); I2S_IFCR_MASK, I2S_IFCR_MASK);
} }
static int stm32_i2s_hw_params(struct snd_pcm_substream *substream, static int stm32_i2s_hw_params(struct snd_pcm_substream *substream,
...@@ -603,8 +602,8 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -603,8 +602,8 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
return ret; return ret;
} }
regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG,
I2S_IFCR_MASK, I2S_IFCR_MASK); I2S_IFCR_MASK, I2S_IFCR_MASK);
if (playback_flg) { if (playback_flg) {
ier = I2S_IER_UDRIE; ier = I2S_IER_UDRIE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment