ASoC: Intel: add support for pause and resume in sst
authorVinod Koul <vinod.koul@intel.com>
Thu, 12 Feb 2015 04:29:56 +0000 (09:59 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 23 Feb 2015 15:43:59 +0000 (00:43 +0900)
This adds missing pcm pause and resume ops in the driver

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/sst/sst_drv_interface.c

index 5f75ef3cdd229613cd37a11ade1d3d3831385763..5d56fcdd58d882188a52aa6f576ee779e16678af 100644 (file)
@@ -572,6 +572,35 @@ static int sst_stream_drop(struct device *dev, int str_id)
        return sst_drop_stream(ctx, str_id);
 }
 
+static int sst_stream_pause(struct device *dev, int str_id)
+{
+       struct stream_info *str_info;
+       struct intel_sst_drv *ctx = dev_get_drvdata(dev);
+
+       if (ctx->sst_state != SST_FW_RUNNING)
+               return 0;
+
+       str_info = get_stream_info(ctx, str_id);
+       if (!str_info)
+               return -EINVAL;
+
+       return sst_pause_stream(ctx, str_id);
+}
+
+static int sst_stream_resume(struct device *dev, int str_id)
+{
+       struct stream_info *str_info;
+       struct intel_sst_drv *ctx = dev_get_drvdata(dev);
+
+       if (ctx->sst_state != SST_FW_RUNNING)
+               return 0;
+
+       str_info = get_stream_info(ctx, str_id);
+       if (!str_info)
+               return -EINVAL;
+       return sst_resume_stream(ctx, str_id);
+}
+
 static int sst_stream_init(struct device *dev, struct pcm_stream_info *str_info)
 {
        int str_id = 0;
@@ -633,6 +662,8 @@ static struct sst_ops pcm_ops = {
        .stream_init = sst_stream_init,
        .stream_start = sst_stream_start,
        .stream_drop = sst_stream_drop,
+       .stream_pause = sst_stream_pause,
+       .stream_pause_release = sst_stream_resume,
        .stream_read_tstamp = sst_read_timestamp,
        .send_byte_stream = sst_send_byte_stream,
        .close = sst_close_pcm_stream,