Merge remote-tracking branches 'asoc/topic/max98926', 'asoc/topic/mtk', 'asoc/topic...
authorMark Brown <broonie@kernel.org>
Sun, 13 Mar 2016 08:17:18 +0000 (15:17 +0700)
committerMark Brown <broonie@kernel.org>
Sun, 13 Mar 2016 08:17:18 +0000 (15:17 +0700)
1  2  3  4  5  6 
sound/soc/mxs/mxs-saif.c

diff --combined sound/soc/mxs/mxs-saif.c
@@@@@@@ -381,19 -381,9 -381,19 -381,9 -381,9 -381,9 +381,19 @@@@@@@ static int mxs_saif_startup(struct snd_
        __raw_writel(BM_SAIF_CTRL_CLKGATE,
                saif->base + SAIF_CTRL + MXS_CLR_ADDR);
      
 + +++  clk_prepare(saif->clk);
 + +++
        return 0;
      }
      
 + +++static void mxs_saif_shutdown(struct snd_pcm_substream *substream,
 + +++                        struct snd_soc_dai *cpu_dai)
 + +++{
 + +++  struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai);
 + +++
 + +++  clk_unprepare(saif->clk);
 + +++}
 + +++
      /*
       * Should only be called when port is inactive.
       * although can be called multiple times by upper layers.
@@@@@@@ -418,7 -408,7 -418,7 -408,7 -408,7 -408,7 +418,7 @@@@@@@ static int mxs_saif_hw_params(struct sn
        }
      
        stat = __raw_readl(saif->base + SAIF_STAT);
--- --  if (stat & BM_SAIF_STAT_BUSY) {
+++ ++  if (!saif->mclk_in_use && (stat & BM_SAIF_STAT_BUSY)) {
                dev_err(cpu_dai->dev, "error: busy\n");
                return -EBUSY;
        }
                return ret;
        }
      
 - ---  /* prepare clk in hw_param, enable in trigger */
 - ---  clk_prepare(saif->clk);
        if (saif != master_saif) {
                /*
                * Set an initial clock rate for the saif internal logic to work
@@@@@@@ -619,7 -611,6 -619,7 -611,6 -611,6 -611,6 +619,7 @@@@@@@ static int mxs_saif_trigger(struct snd_
      
      static const struct snd_soc_dai_ops mxs_saif_dai_ops = {
        .startup = mxs_saif_startup,
 + +++  .shutdown = mxs_saif_shutdown,
        .trigger = mxs_saif_trigger,
        .prepare = mxs_saif_prepare,
        .hw_params = mxs_saif_hw_params,