]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting
authorDharageswari R <dharageswari.r@intel.com>
Fri, 3 Jun 2016 12:59:36 +0000 (18:29 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 7 Jun 2016 13:19:11 +0000 (14:19 +0100)
If pipeline is not STARTED, we do not need to pause pipeline while
deleting.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/skylake/skl-messages.c

index 07d2a73ff2071ebd78ab5c2ac6bf66b3686e636b..804091aa6e64dcf7e1720e1749fdaaaa434c6f54 100644 (file)
@@ -1046,7 +1046,7 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)
 
        dev_dbg(ctx->dev, "%s: pipe = %d\n", __func__, pipe->ppl_id);
 
-       /* If pipe is not started, do not try to stop the pipe in FW. */
+       /* If pipe is started, do stop the pipe in FW. */
        if (pipe->state > SKL_PIPE_STARTED) {
                ret = skl_set_pipe_state(ctx, pipe, PPL_PAUSED);
                if (ret < 0) {
@@ -1055,18 +1055,20 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)
                }
 
                pipe->state = SKL_PIPE_PAUSED;
-       } else {
-               /* If pipe was not created in FW, do not try to delete it */
-               if (pipe->state < SKL_PIPE_CREATED)
-                       return 0;
+       }
 
-               ret = skl_ipc_delete_pipeline(&ctx->ipc, pipe->ppl_id);
-               if (ret < 0)
-                       dev_err(ctx->dev, "Failed to delete pipeline\n");
+       /* If pipe was not created in FW, do not try to delete it */
+       if (pipe->state < SKL_PIPE_CREATED)
+               return 0;
 
-               pipe->state = SKL_PIPE_INVALID;
+       ret = skl_ipc_delete_pipeline(&ctx->ipc, pipe->ppl_id);
+       if (ret < 0) {
+               dev_err(ctx->dev, "Failed to delete pipeline\n");
+               return ret;
        }
 
+       pipe->state = SKL_PIPE_INVALID;
+
        return ret;
 }