Unverified Commit 36d73c4a authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

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: default avatarPierre-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: default avatarMark Brown <broonie@kernel.org>
parent f5e056e1
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -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