diff options
Diffstat (limited to 'sound/soc/intel/atom/sst/sst.c')
-rw-r--r-- | sound/soc/intel/atom/sst/sst.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c index 8afdff457579..0962bc9adc62 100644 --- a/sound/soc/intel/atom/sst/sst.c +++ b/sound/soc/intel/atom/sst/sst.c @@ -449,6 +449,13 @@ static int intel_sst_suspend(struct device *dev) dev_err(dev, "stream %d is running, can't suspend, abort\n", i); return -EBUSY; } + + if (ctx->pdata->streams_lost_on_suspend) { + stream->resume_status = stream->status; + stream->resume_prev = stream->prev; + if (stream->status != STREAM_UN_INIT) + sst_free_stream(ctx, i); + } } synchronize_irq(ctx->irq_num); flush_workqueue(ctx->post_msg_wq); @@ -509,8 +516,8 @@ static int intel_sst_resume(struct device *dev) { struct intel_sst_drv *ctx = dev_get_drvdata(dev); struct sst_fw_save *fw_save = ctx->fw_save; - int ret = 0; struct sst_block *block; + int i, ret = 0; if (!fw_save) return 0; @@ -550,6 +557,21 @@ static int intel_sst_resume(struct device *dev) sst_set_fw_state_locked(ctx, SST_FW_RUNNING); } + if (ctx->pdata->streams_lost_on_suspend) { + for (i = 1; i <= ctx->info.max_streams; i++) { + struct stream_info *stream = &ctx->streams[i]; + + if (stream->resume_status != STREAM_UN_INIT) { + dev_dbg(ctx->dev, "Re-allocing stream %d status %d prev %d\n", + i, stream->resume_status, + stream->resume_prev); + sst_realloc_stream(ctx, i); + stream->status = stream->resume_status; + stream->prev = stream->resume_prev; + } + } + } + sst_free_block(ctx, block); return ret; } |