diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2020-02-25 11:00:40 -0600 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-02-26 17:50:37 +0000 |
commit | 36d73c4a9ed7c8a0988cfb9d1282c62d8c422a3b (patch) | |
tree | 2f0a694f692ee32b8ead6d2e86f194e735cf9a6c /include | |
parent | f5e056e1e46fcbb5f74ce560792aeb7d57ce79e6 (diff) |
ASoC: soc-dai: add get_sdw_stream() callback
We only have a set() operation, provide the dual get() operation to
retrieve the stream information.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200225170041.23644-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/soc-dai.h | 21 |
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 |