summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-02-26 18:14:18 +0000
committerMark Brown <broonie@kernel.org>2020-02-26 18:14:18 +0000
commit870dede07ee685ce89a0aa2ccbeac35909864724 (patch)
tree5b85b98e8d04f073db80400635e5ce52d62af013
parent14f8c8d8fd62207f081549d45099a90dd3717696 (diff)
parent36d73c4a9ed7c8a0988cfb9d1282c62d8c422a3b (diff)
SoundWire: ASoC interfaces for multi-cpu dais and DisCo helpers
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: The first two patches prepare the support of multi-cpu dais for synchronized playback and capture. We remove an unused set of prototypes and add a get_sdw_stream() callback prototype currently missing (the implementation will come later as part of the synchronized playback) The last exposes macros used internally, so that they can be reused to extract information from the _ADR 64-bit values in SOF platform drivers and related machine drivers. I think it's simpler if all these simple patches are merged through the SoundWire tree. With the additional changes to remove the platform drivers and the merge of interrupt handling, that will result in a single immutable tag provided to Mark Brown. Pierre-Louis Bossart (3): soundwire: cadence: remove useless prototypes ASoC: soc-dai: add get_sdw_stream() callback soundwire: add helper macros for devID fields drivers/soundwire/bus.c | 21 +++++---------------- drivers/soundwire/cadence_master.h | 8 -------- include/linux/soundwire/sdw.h | 23 +++++++++++++++++++++++ include/sound/soc-dai.h | 21 +++++++++++++++++++++ 4 files changed, 49 insertions(+), 24 deletions(-) -- 2.20.1
-rw-r--r--include/sound/soc-dai.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 92c382690930..7f70db149b81 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -202,6 +202,8 @@ struct snd_soc_dai_ops {
int (*set_sdw_stream)(struct snd_soc_dai *dai,
void *stream, int direction);
+ void *(*get_sdw_stream)(struct snd_soc_dai *dai, int direction);
+
/*
* DAI digital mute - optional.
* Called by soc-core to minimise any pops.
@@ -423,4 +425,23 @@ static inline int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai,
return -ENOTSUPP;
}
+/**
+ * snd_soc_dai_get_sdw_stream() - Retrieves SDW stream from DAI
+ * @dai: DAI
+ * @direction: Stream direction(Playback/Capture)
+ *
+ * This routine only retrieves that was previously configured
+ * with snd_soc_dai_get_sdw_stream()
+ *
+ * Returns pointer to stream or NULL;
+ */
+static inline void *snd_soc_dai_get_sdw_stream(struct snd_soc_dai *dai,
+ int direction)
+{
+ if (dai->driver->ops->get_sdw_stream)
+ return dai->driver->ops->get_sdw_stream(dai, direction);
+ else
+ return NULL;
+}
+
#endif