Commit 4968107786e75f5aaba3c1c8e959ccbae929457f

Authored by Vinod Koul
Committed by Mark Brown
1 parent 6bf6d1af86

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>

Showing 3 changed files with 19 additions and 1 deletions Side-by-side Diff

include/sound/compress_driver.h
... ... @@ -61,6 +61,7 @@
61 61 u64 total_bytes_available;
62 62 u64 total_bytes_transferred;
63 63 wait_queue_head_t sleep;
  64 + void *private_data;
64 65 };
65 66  
66 67 /**
include/sound/soc-dai.h
... ... @@ -18,6 +18,7 @@
18 18  
19 19 struct snd_pcm_substream;
20 20 struct snd_soc_dapm_widget;
  21 +struct snd_compr_stream;
21 22  
22 23 /*
23 24 * DAI hardware audio formats.
... ... @@ -205,6 +206,8 @@
205 206 int (*remove)(struct snd_soc_dai *dai);
206 207 int (*suspend)(struct snd_soc_dai *dai);
207 208 int (*resume)(struct snd_soc_dai *dai);
  209 + /* compress dai */
  210 + bool compress_dai;
208 211  
209 212 /* ops */
210 213 const struct snd_soc_dai_ops *ops;
... ... @@ -22,6 +22,7 @@
22 22 #include <linux/regmap.h>
23 23 #include <sound/core.h>
24 24 #include <sound/pcm.h>
  25 +#include <sound/compress_driver.h>
25 26 #include <sound/control.h>
26 27 #include <sound/ac97_codec.h>
27 28  
... ... @@ -399,6 +400,7 @@
399 400 int snd_soc_platform_write(struct snd_soc_platform *platform,
400 401 unsigned int reg, unsigned int val);
401 402 int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
  403 +int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
402 404  
403 405 struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
404 406 const char *dai_link, int stream);
... ... @@ -632,6 +634,13 @@
632 634 int (*trigger)(struct snd_pcm_substream *, int);
633 635 };
634 636  
  637 +struct 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 644 /* SoC cache ops */
636 645 struct snd_soc_cache_ops {
637 646 const char *name;
638 647  
... ... @@ -787,9 +796,12 @@
787 796 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
788 797 struct snd_soc_dai *);
789 798  
790   - /* platform stream ops */
  799 + /* platform stream pcm ops */
791 800 struct snd_pcm_ops *ops;
792 801  
  802 + /* platform stream compress ops */
  803 + struct snd_compr_ops *compr_ops;
  804 +
793 805 /* platform stream completion event */
794 806 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
795 807  
... ... @@ -891,6 +903,7 @@
891 903  
892 904 /* machine stream operations */
893 905 struct snd_soc_ops *ops;
  906 + struct snd_soc_compr_ops *compr_ops;
894 907 };
895 908  
896 909 struct snd_soc_codec_conf {
... ... @@ -1027,6 +1040,7 @@
1027 1040  
1028 1041 /* runtime devices */
1029 1042 struct snd_pcm *pcm;
  1043 + struct snd_compr *compr;
1030 1044 struct snd_soc_codec *codec;
1031 1045 struct snd_soc_platform *platform;
1032 1046 struct snd_soc_dai *codec_dai;