ASoC: Intel: add drain_notify support
This patch adds the support to implement drain_notify in Intels mfld driver
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
diff --git a/sound/soc/intel/sst-mfld-platform-compress.c b/sound/soc/intel/sst-mfld-platform-compress.c
index 16d79fb..5c3e234 100644
--- a/sound/soc/intel/sst-mfld-platform-compress.c
+++ b/sound/soc/intel/sst-mfld-platform-compress.c
@@ -38,6 +38,15 @@
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 @@
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) {