Commit 49681077 authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown

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: default avatarNamarta Kohli <namartax.kohli@intel.com>
Signed-off-by: default avatarRamesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6bf6d1af
...@@ -61,6 +61,7 @@ struct snd_compr_runtime { ...@@ -61,6 +61,7 @@ struct snd_compr_runtime {
u64 total_bytes_available; u64 total_bytes_available;
u64 total_bytes_transferred; u64 total_bytes_transferred;
wait_queue_head_t sleep; wait_queue_head_t sleep;
void *private_data;
}; };
/** /**
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
struct snd_pcm_substream; struct snd_pcm_substream;
struct snd_soc_dapm_widget; struct snd_soc_dapm_widget;
struct snd_compr_stream;
/* /*
* DAI hardware audio formats. * DAI hardware audio formats.
...@@ -205,6 +206,8 @@ struct snd_soc_dai_driver { ...@@ -205,6 +206,8 @@ struct snd_soc_dai_driver {
int (*remove)(struct snd_soc_dai *dai); int (*remove)(struct snd_soc_dai *dai);
int (*suspend)(struct snd_soc_dai *dai); int (*suspend)(struct snd_soc_dai *dai);
int (*resume)(struct snd_soc_dai *dai); int (*resume)(struct snd_soc_dai *dai);
/* compress dai */
bool compress_dai;
/* ops */ /* ops */
const struct snd_soc_dai_ops *ops; const struct snd_soc_dai_ops *ops;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/regmap.h> #include <linux/regmap.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/compress_driver.h>
#include <sound/control.h> #include <sound/control.h>
#include <sound/ac97_codec.h> #include <sound/ac97_codec.h>
...@@ -399,6 +400,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform, ...@@ -399,6 +400,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform,
int snd_soc_platform_write(struct snd_soc_platform *platform, int snd_soc_platform_write(struct snd_soc_platform *platform,
unsigned int reg, unsigned int val); unsigned int reg, unsigned int val);
int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
const char *dai_link, int stream); const char *dai_link, int stream);
...@@ -632,6 +634,13 @@ struct snd_soc_ops { ...@@ -632,6 +634,13 @@ struct snd_soc_ops {
int (*trigger)(struct snd_pcm_substream *, int); int (*trigger)(struct snd_pcm_substream *, int);
}; };
struct snd_soc_compr_ops {
int (*startup)(struct snd_compr_stream *);
void (*shutdown)(struct snd_compr_stream *);
int (*set_params)(struct snd_compr_stream *);
int (*trigger)(struct snd_compr_stream *);
};
/* SoC cache ops */ /* SoC cache ops */
struct snd_soc_cache_ops { struct snd_soc_cache_ops {
const char *name; const char *name;
...@@ -787,9 +796,12 @@ struct snd_soc_platform_driver { ...@@ -787,9 +796,12 @@ struct snd_soc_platform_driver {
snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
struct snd_soc_dai *); struct snd_soc_dai *);
/* platform stream ops */ /* platform stream pcm ops */
struct snd_pcm_ops *ops; struct snd_pcm_ops *ops;
/* platform stream compress ops */
struct snd_compr_ops *compr_ops;
/* platform stream completion event */ /* platform stream completion event */
int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
...@@ -891,6 +903,7 @@ struct snd_soc_dai_link { ...@@ -891,6 +903,7 @@ struct snd_soc_dai_link {
/* machine stream operations */ /* machine stream operations */
struct snd_soc_ops *ops; struct snd_soc_ops *ops;
struct snd_soc_compr_ops *compr_ops;
}; };
struct snd_soc_codec_conf { struct snd_soc_codec_conf {
...@@ -1027,6 +1040,7 @@ struct snd_soc_pcm_runtime { ...@@ -1027,6 +1040,7 @@ struct snd_soc_pcm_runtime {
/* runtime devices */ /* runtime devices */
struct snd_pcm *pcm; struct snd_pcm *pcm;
struct snd_compr *compr;
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
struct snd_soc_platform *platform; struct snd_soc_platform *platform;
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment