ASoC: omap-mcpdm: Move the WD enable write inside omap_mcpdm_open_streams()
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Wed, 18 May 2016 13:46:34 +0000 (16:46 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 30 May 2016 15:19:17 +0000 (16:19 +0100)
The DS4_WD_EN bit is only touched before calling omap_mcpdm_open_streams().
Move it inside of that function for simplicity.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/omap/omap-mcpdm.c

index b837265ac3e9afd90dc26e5e00b2b52d0d1d9239..11bd07cdce22e4fbd407c42c3663641d7b38d69b 100644 (file)
@@ -173,6 +173,10 @@ static inline int omap_mcpdm_active(struct omap_mcpdm *mcpdm)
  */
 static void omap_mcpdm_open_streams(struct omap_mcpdm *mcpdm)
 {
+       u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
+
+       omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
+
        omap_mcpdm_write(mcpdm, MCPDM_REG_IRQENABLE_SET,
                        MCPDM_DN_IRQ_EMPTY | MCPDM_DN_IRQ_FULL |
                        MCPDM_UP_IRQ_EMPTY | MCPDM_UP_IRQ_FULL);
@@ -258,12 +262,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
 
        mutex_lock(&mcpdm->mutex);
 
-       if (!dai->active) {
-               u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
-
-               omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
+       if (!dai->active)
                omap_mcpdm_open_streams(mcpdm);
-       }
+
        mutex_unlock(&mcpdm->mutex);
 
        return 0;