From 923eb442d6761b7779ad87c2cc7e88987e5f8104 Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Mon, 5 May 2014 22:19:23 +0530 Subject: [PATCH] ASoC: Intel: add drain_notify support Signed-off-by: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/sst-mfld-platform-compress.c | 11 +++++++++++ sound/soc/intel/sst-mfld-platform.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/sound/soc/intel/sst-mfld-platform-compress.c b/sound/soc/intel/sst-mfld-platform-compress.c index 16d79fb25e59..5c3e23492fe5 100644 --- a/sound/soc/intel/sst-mfld-platform-compress.c +++ b/sound/soc/intel/sst-mfld-platform-compress.c @@ -38,6 +38,15 @@ static void sst_compr_fragment_elapsed(void *arg) snd_compr_fragment_elapsed(cstream); } +static void sst_drain_notify(void *arg) +{ + struct snd_compr_stream *cstream = (struct snd_compr_stream *)arg; + + pr_debug("drain notify by driver\n"); + if (cstream) + snd_compr_drain_notify(cstream); +} + static int sst_platform_compr_open(struct snd_compr_stream *cstream) { @@ -143,6 +152,8 @@ static int sst_platform_compr_set_params(struct snd_compr_stream *cstream, cb.param = cstream; cb.compr_cb = sst_compr_fragment_elapsed; + cb.drain_cb_param = cstream; + cb.drain_notify = sst_drain_notify; retval = stream->compr_ops->open(&str_params, &cb); if (retval < 0) { diff --git a/sound/soc/intel/sst-mfld-platform.h b/sound/soc/intel/sst-mfld-platform.h index 3ea4fee0ba0d..6c5e7dc49e3c 100644 --- a/sound/soc/intel/sst-mfld-platform.h +++ b/sound/soc/intel/sst-mfld-platform.h @@ -104,6 +104,8 @@ struct sst_stream_params { struct sst_compress_cb { void *param; void (*compr_cb)(void *param); + void *drain_cb_param; + void (*drain_notify)(void *param); }; struct compress_sst_ops { -- 2.39.5