]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: Intel: add drain_notify support
authorVinod Koul <vinod.koul@intel.com>
Mon, 5 May 2014 16:49:23 +0000 (22:19 +0530)
committerMark Brown <broonie@linaro.org>
Mon, 5 May 2014 19:46:06 +0000 (12:46 -0700)
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/intel/sst-mfld-platform-compress.c
sound/soc/intel/sst-mfld-platform.h

index 16d79fb25e590959db5687ded351be6c263c3314..5c3e23492fe5324eb293a080d22ec94d8d0bd4de 100644 (file)
@@ -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) {
index 3ea4fee0ba0d385c7b499f38e9964c554db6e486..6c5e7dc49e3c9d58a6f610a3ff4ab2a99a6efd20 100644 (file)
@@ -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 {