Skip to contentSkip to conversation

ASoC: compress: Add support for compress dai ops

PATCH In review Vinod Koul 2 participants 2 messages Nov 13, 2016

Subsystems (3)
lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

PATCH 1/1 ASoC: compress: Add support for compress dai ops

ASoC Compress ops have only platform ops and no DAI ops unlike PCM device where we have both platform ops as well as DAI ops.

So add compress dai ops and add this new structure to the ASoC core to make compressed devices a first class ASoC citizen

Again like PCM ops, drivers are free to implement either or both of these ops based on device needs.

---

This was raised on hallway track at LPC by Lars & Patrick, so time to fix it up

 include/sound/soc-dai.h  | 25 ++++++++++++
 sound/soc/soc-compress.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 121 insertions(+), 2 deletions(-)
include/sound/soc-dai.h +25 -0
index 964b7de1a1cc..756ee1b78ffc 100644
@@ -207,6 +207,30 @@ struct snd_soc_dai_ops {
 		struct snd_soc_dai *);
 };
 
+struct snd_soc_cdai_ops {
+	/*
+	 * for compress ops
+	 */
+	int (*startup)(struct snd_compr_stream *,
+			struct snd_soc_dai *);
+	int (*shutdown)(struct snd_compr_stream *,
+			struct snd_soc_dai *);
+	int (*set_params)(struct snd_compr_stream *,
+			struct snd_compr_params *, struct snd_soc_dai *);
+	int (*get_params)(struct snd_compr_stream *,
+			struct snd_codec *, struct snd_soc_dai *);
+	int (*set_metadata)(struct snd_compr_stream *,
+			struct snd_compr_metadata *, struct snd_soc_dai *);
+	int (*get_metadata)(struct snd_compr_stream *,
+			struct snd_compr_metadata *, struct snd_soc_dai *);
+	int (*trigger)(struct snd_compr_stream *, int,
+			struct snd_soc_dai *);
+	int (*pointer)(struct snd_compr_stream *,
+			struct snd_compr_tstamp *, struct snd_soc_dai *);
+	int (*ack)(struct snd_compr_stream *, size_t,
+			struct snd_soc_dai *);
+};
+
 /*
  * Digital Audio Interface Driver.
  *
@@ -236,6 +260,7 @@ struct snd_soc_dai_driver {
 
 	/* ops */
 	const struct snd_soc_dai_ops *ops;
+	const struct snd_soc_cdai_ops *cops;
 
 	/* DAI capabilities */
 	struct snd_soc_pcm_stream capture;
sound/soc/soc-compress.c +96 -2

259 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#1 lore raw

Applied "ASoC: compress: Add support for compress dai ops" to the asoc tree

The patch

ASoC: compress: Add support for compress dai ops

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 2e622ae41e653cd71a6d3bc5a4685b01eacbee8d Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Sun, 13 Nov 2016 12:10:02 +0530
Subject: [PATCH] ASoC: compress: Add support for compress dai ops

ASoC Compress ops have only platform ops and no DAI ops unlike PCM device where we have both platform ops as well as DAI ops.

So add compress dai ops and add this new structure to the ASoC core to make compressed devices a first class ASoC citizen

Again like PCM ops, drivers are free to implement either or both of these ops based on device needs.

---
 include/sound/soc-dai.h  | 25 ++++++++++++
 sound/soc/soc-compress.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 121 insertions(+), 2 deletions(-)
include/sound/soc-dai.h +25 -0
index 964b7de1a1cc..756ee1b78ffc 100644
@@ -207,6 +207,30 @@ struct snd_soc_dai_ops {
 		struct snd_soc_dai *);
 };
 
+struct snd_soc_cdai_ops {
+	/*
+	 * for compress ops
+	 */
+	int (*startup)(struct snd_compr_stream *,
+			struct snd_soc_dai *);
+	int (*shutdown)(struct snd_compr_stream *,
+			struct snd_soc_dai *);
+	int (*set_params)(struct snd_compr_stream *,
+			struct snd_compr_params *, struct snd_soc_dai *);
+	int (*get_params)(struct snd_compr_stream *,
+			struct snd_codec *, struct snd_soc_dai *);
+	int (*set_metadata)(struct snd_compr_stream *,
+			struct snd_compr_metadata *, struct snd_soc_dai *);
+	int (*get_metadata)(struct snd_compr_stream *,
+			struct snd_compr_metadata *, struct snd_soc_dai *);
+	int (*trigger)(struct snd_compr_stream *, int,
+			struct snd_soc_dai *);
+	int (*pointer)(struct snd_compr_stream *,
+			struct snd_compr_tstamp *, struct snd_soc_dai *);
+	int (*ack)(struct snd_compr_stream *, size_t,
+			struct snd_soc_dai *);
+};
+
 /*
  * Digital Audio Interface Driver.
  *
@@ -236,6 +260,7 @@ struct snd_soc_dai_driver {
 
 	/* ops */
 	const struct snd_soc_dai_ops *ops;
+	const struct snd_soc_cdai_ops *cops;
 
 	/* DAI capabilities */
 	struct snd_soc_pcm_stream capture;
sound/soc/soc-compress.c +96 -2

259 lines not on this page · raw message

Signature · 1 line
2.10.2