]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: renesas: msiof: cleanup status clear method
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 28 Aug 2025 02:21:57 +0000 (02:21 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 28 Aug 2025 09:08:27 +0000 (11:08 +0200)
Current MSIOF driver clear status 1) after starting HW, and 2) clear all
status. But it should be 1') before starting HW, 2') clear necessary
status only. Cleanup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-ID: <87ecswuqwr.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/renesas/rcar/msiof.c

index 56bf64e55ba3d3a8e22f0600966b7b1fedc7a084..90ca3357392ebb63be6ad3e65f0f1e88b7a131e9 100644 (file)
@@ -37,7 +37,6 @@
 /* SISTR */
 #define SISTR_ERR_TX   (SISTR_TFSERR | SISTR_TFOVF | SISTR_TFUDF)
 #define SISTR_ERR_RX   (SISTR_RFSERR | SISTR_RFOVF | SISTR_RFUDF)
-#define SISTR_ERR      (SISTR_ERR_TX | SISTR_ERR_RX)
 
 /*
  * The data on memory in 24bit case is located at <right> side
@@ -80,7 +79,6 @@ struct msiof_priv {
 #define msiof_is_play(substream)       ((substream)->stream == SNDRV_PCM_STREAM_PLAYBACK)
 #define msiof_read(priv, reg)          ioread32((priv)->base + reg)
 #define msiof_write(priv, reg, val)    iowrite32(val, (priv)->base + reg)
-#define msiof_status_clear(priv)       msiof_write(priv, SISTR, SISTR_ERR)
 
 static int msiof_update(struct msiof_priv *priv, u32 reg, u32 mask, u32 val)
 {
@@ -174,6 +172,13 @@ static int msiof_hw_start(struct snd_soc_component *component,
                val = SIIER_RDREQE | SIIER_RDMAE | SISTR_ERR_RX;
        msiof_update(priv, SIIER, val, val);
 
+       /* clear status */
+       if (is_play)
+               val = SISTR_ERR_TX;
+       else
+               val = SISTR_ERR_RX;
+       msiof_update(priv, SISTR, val, val);
+
        /* SICTR */
        if (is_play)
                val = SICTR_TXE | SICTR_TEDG;
@@ -181,8 +186,6 @@ static int msiof_hw_start(struct snd_soc_component *component,
                val = SICTR_RXE | SICTR_REDG;
        msiof_update_and_wait(priv, SICTR, val, val, val);
 
-       msiof_status_clear(priv);
-
        /* Start DMAC */
        snd_dmaengine_pcm_trigger(substream, cmd);
 
@@ -439,7 +442,7 @@ static irqreturn_t msiof_interrupt(int irq, void *data)
        spin_lock(&priv->lock);
 
        sistr = msiof_read(priv, SISTR);
-       msiof_status_clear(priv);
+       msiof_write(priv, SISTR, SISTR_ERR_TX | SISTR_ERR_RX);
 
        spin_unlock(&priv->lock);