summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2014-05-15 20:08:16 +0400
committerMark Brown <broonie@linaro.org>2014-05-16 22:46:06 +0400
commitbd17aa45cd16d1bdb373484d35b87bbee656d98e (patch)
tree6b8d8edb60b9a3f27876fa7fc27e2e96526b8268 /sound/soc
parent5106f5a17e40534edbb74edf5d769abcbfadf55c (diff)
downloadlinux-bd17aa45cd16d1bdb373484d35b87bbee656d98e.tar.xz
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>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/intel/sst-mfld-platform-compress.c11
-rw-r--r--sound/soc/intel/sst-mfld-platform.h2
2 files changed, 13 insertions, 0 deletions
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 {