aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@linux.intel.com>2012-08-16 07:40:40 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-20 15:50:37 -0400
commit4968107786e75f5aaba3c1c8e959ccbae929457f (patch)
tree7aa955471bbea40c208f75668d2c17c4b6ab63df /include/sound
parent6bf6d1af86e7dec914f7916f2a00910650a73469 (diff)
ASoC: add definations for compressed operations
Here we update the asoc structures to add compress stream definations First the struct snd_soc_dai_driver adds a new member to indicate if the dai is compressed or pcm. Next we add a new structre the struct snd_soc_compr_ops in the struct snd_soc_dai_link. This is to be used for machine driver to perform any opertaions required for setting up compressed audio streams next is the compressed data operations, they are added using struct snd_compr_ops in the struct snd_soc_platform_driver. Signed-off-by: Namarta Kohli <namartax.kohli@intel.com> Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/compress_driver.h1
-rw-r--r--include/sound/soc-dai.h3
-rw-r--r--include/sound/soc.h16
3 files changed, 19 insertions, 1 deletions
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h
index 48f2a1ff2bbc..f2912abacdf3 100644
--- a/include/sound/compress_driver.h
+++ b/include/sound/compress_driver.h
@@ -61,6 +61,7 @@ struct snd_compr_runtime {
61 u64 total_bytes_available; 61 u64 total_bytes_available;
62 u64 total_bytes_transferred; 62 u64 total_bytes_transferred;
63 wait_queue_head_t sleep; 63 wait_queue_head_t sleep;
64 void *private_data;
64}; 65};
65 66
66/** 67/**
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 1f69e0af2941..628db7bca4fd 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -18,6 +18,7 @@
18 18
19struct snd_pcm_substream; 19struct snd_pcm_substream;
20struct snd_soc_dapm_widget; 20struct snd_soc_dapm_widget;
21struct snd_compr_stream;
21 22
22/* 23/*
23 * DAI hardware audio formats. 24 * DAI hardware audio formats.
@@ -205,6 +206,8 @@ struct snd_soc_dai_driver {
205 int (*remove)(struct snd_soc_dai *dai); 206 int (*remove)(struct snd_soc_dai *dai);
206 int (*suspend)(struct snd_soc_dai *dai); 207 int (*suspend)(struct snd_soc_dai *dai);
207 int (*resume)(struct snd_soc_dai *dai); 208 int (*resume)(struct snd_soc_dai *dai);
209 /* compress dai */
210 bool compress_dai;
208 211
209 /* ops */ 212 /* ops */
210 const struct snd_soc_dai_ops *ops; 213 const struct snd_soc_dai_ops *ops;
diff --git a/include/sound/soc.h b/include/sound/soc.h
index e063380f63a2..313b7660562c 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -22,6 +22,7 @@
22#include <linux/regmap.h> 22#include <linux/regmap.h>
23#include <sound/core.h> 23#include <sound/core.h>
24#include <sound/pcm.h> 24#include <sound/pcm.h>
25#include <sound/compress_driver.h>
25#include <sound/control.h> 26#include <sound/control.h>
26#include <sound/ac97_codec.h> 27#include <sound/ac97_codec.h>
27 28
@@ -399,6 +400,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform,
399int snd_soc_platform_write(struct snd_soc_platform *platform, 400int snd_soc_platform_write(struct snd_soc_platform *platform,
400 unsigned int reg, unsigned int val); 401 unsigned int reg, unsigned int val);
401int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); 402int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
403int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
402 404
403struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, 405struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
404 const char *dai_link, int stream); 406 const char *dai_link, int stream);
@@ -632,6 +634,13 @@ struct snd_soc_ops {
632 int (*trigger)(struct snd_pcm_substream *, int); 634 int (*trigger)(struct snd_pcm_substream *, int);
633}; 635};
634 636
637struct snd_soc_compr_ops {
638 int (*startup)(struct snd_compr_stream *);
639 void (*shutdown)(struct snd_compr_stream *);
640 int (*set_params)(struct snd_compr_stream *);
641 int (*trigger)(struct snd_compr_stream *);
642};
643
635/* SoC cache ops */ 644/* SoC cache ops */
636struct snd_soc_cache_ops { 645struct snd_soc_cache_ops {
637 const char *name; 646 const char *name;
@@ -787,9 +796,12 @@ struct snd_soc_platform_driver {
787 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, 796 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
788 struct snd_soc_dai *); 797 struct snd_soc_dai *);
789 798
790 /* platform stream ops */ 799 /* platform stream pcm ops */
791 struct snd_pcm_ops *ops; 800 struct snd_pcm_ops *ops;
792 801
802 /* platform stream compress ops */
803 struct snd_compr_ops *compr_ops;
804
793 /* platform stream completion event */ 805 /* platform stream completion event */
794 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); 806 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
795 807
@@ -891,6 +903,7 @@ struct snd_soc_dai_link {
891 903
892 /* machine stream operations */ 904 /* machine stream operations */
893 struct snd_soc_ops *ops; 905 struct snd_soc_ops *ops;
906 struct snd_soc_compr_ops *compr_ops;
894}; 907};
895 908
896struct snd_soc_codec_conf { 909struct snd_soc_codec_conf {
@@ -1027,6 +1040,7 @@ struct snd_soc_pcm_runtime {
1027 1040
1028 /* runtime devices */ 1041 /* runtime devices */
1029 struct snd_pcm *pcm; 1042 struct snd_pcm *pcm;
1043 struct snd_compr *compr;
1030 struct snd_soc_codec *codec; 1044 struct snd_soc_codec *codec;
1031 struct snd_soc_platform *platform; 1045 struct snd_soc_platform *platform;
1032 struct snd_soc_dai *codec_dai; 1046 struct snd_soc_dai *codec_dai;