aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-12 08:56:57 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-12 08:56:57 -0400
commit54b019cbd993bb9d432a27a51a800f4981aa2f1c (patch)
tree875dea2d6a3aaf4e66a947a40226fdaf1f496f84 /sound
parent13419625774f9f3e65e07257ad2a7beb445e9942 (diff)
parent0cd5751ab360573f607d1cbf97aa072667f888c8 (diff)
Merge remote-tracking branch 'asoc/topic/compress' into asoc-next
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/mid-x86/sst_platform.c12
-rw-r--r--sound/soc/mid-x86/sst_platform.h2
-rw-r--r--sound/soc/soc-compress.c27
3 files changed, 40 insertions, 1 deletions
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c
index 31a829cca5ef..392fc0b8f5b8 100644
--- a/sound/soc/mid-x86/sst_platform.c
+++ b/sound/soc/mid-x86/sst_platform.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * sst_platform.c - Intel MID Platform driver 2 * sst_platform.c - Intel MID Platform driver
3 * 3 *
4 * Copyright (C) 2010-2012 Intel Corp 4 * Copyright (C) 2010-2013 Intel Corp
5 * Author: Vinod Koul <vinod.koul@intel.com> 5 * Author: Vinod Koul <vinod.koul@intel.com>
6 * Author: Harsha Priya <priya.harsha@intel.com> 6 * Author: Harsha Priya <priya.harsha@intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -656,11 +656,21 @@ static int sst_platform_compr_get_codec_caps(struct snd_compr_stream *cstream,
656 return stream->compr_ops->get_codec_caps(codec); 656 return stream->compr_ops->get_codec_caps(codec);
657} 657}
658 658
659static int sst_platform_compr_set_metadata(struct snd_compr_stream *cstream,
660 struct snd_compr_metadata *metadata)
661{
662 struct sst_runtime_stream *stream =
663 cstream->runtime->private_data;
664
665 return stream->compr_ops->set_metadata(stream->id, metadata);
666}
667
659static struct snd_compr_ops sst_platform_compr_ops = { 668static struct snd_compr_ops sst_platform_compr_ops = {
660 669
661 .open = sst_platform_compr_open, 670 .open = sst_platform_compr_open,
662 .free = sst_platform_compr_free, 671 .free = sst_platform_compr_free,
663 .set_params = sst_platform_compr_set_params, 672 .set_params = sst_platform_compr_set_params,
673 .set_metadata = sst_platform_compr_set_metadata,
664 .trigger = sst_platform_compr_trigger, 674 .trigger = sst_platform_compr_trigger,
665 .pointer = sst_platform_compr_pointer, 675 .pointer = sst_platform_compr_pointer,
666 .ack = sst_platform_compr_ack, 676 .ack = sst_platform_compr_ack,
diff --git a/sound/soc/mid-x86/sst_platform.h b/sound/soc/mid-x86/sst_platform.h
index d61c5d514ffa..cacc9066ec52 100644
--- a/sound/soc/mid-x86/sst_platform.h
+++ b/sound/soc/mid-x86/sst_platform.h
@@ -124,6 +124,8 @@ struct compress_sst_ops {
124 int (*close) (unsigned int str_id); 124 int (*close) (unsigned int str_id);
125 int (*get_caps) (struct snd_compr_caps *caps); 125 int (*get_caps) (struct snd_compr_caps *caps);
126 int (*get_codec_caps) (struct snd_compr_codec_caps *codec); 126 int (*get_codec_caps) (struct snd_compr_codec_caps *codec);
127 int (*set_metadata) (unsigned int str_id,
128 struct snd_compr_metadata *mdata);
127 129
128}; 130};
129 131
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index ed0bfb0ddb96..29093a306ea2 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -330,11 +330,38 @@ static int soc_compr_copy(struct snd_compr_stream *cstream,
330 return ret; 330 return ret;
331} 331}
332 332
333static int sst_compr_set_metadata(struct snd_compr_stream *cstream,
334 struct snd_compr_metadata *metadata)
335{
336 struct snd_soc_pcm_runtime *rtd = cstream->private_data;
337 struct snd_soc_platform *platform = rtd->platform;
338 int ret = 0;
339
340 if (platform->driver->compr_ops && platform->driver->compr_ops->set_metadata)
341 ret = platform->driver->compr_ops->set_metadata(cstream, metadata);
342
343 return ret;
344}
345
346static int sst_compr_get_metadata(struct snd_compr_stream *cstream,
347 struct snd_compr_metadata *metadata)
348{
349 struct snd_soc_pcm_runtime *rtd = cstream->private_data;
350 struct snd_soc_platform *platform = rtd->platform;
351 int ret = 0;
352
353 if (platform->driver->compr_ops && platform->driver->compr_ops->get_metadata)
354 ret = platform->driver->compr_ops->get_metadata(cstream, metadata);
355
356 return ret;
357}
333/* ASoC Compress operations */ 358/* ASoC Compress operations */
334static struct snd_compr_ops soc_compr_ops = { 359static struct snd_compr_ops soc_compr_ops = {
335 .open = soc_compr_open, 360 .open = soc_compr_open,
336 .free = soc_compr_free, 361 .free = soc_compr_free,
337 .set_params = soc_compr_set_params, 362 .set_params = soc_compr_set_params,
363 .set_metadata = sst_compr_set_metadata,
364 .get_metadata = sst_compr_get_metadata,
338 .get_params = soc_compr_get_params, 365 .get_params = soc_compr_get_params,
339 .trigger = soc_compr_trigger, 366 .trigger = soc_compr_trigger,
340 .pointer = soc_compr_pointer, 367 .pointer = soc_compr_pointer,