Re: [PATCH v3 08/13] ASoC: Add SoundWire stream programming interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 04/16/2018 10:23 AM, Vinod Koul wrote:
From: Shreyas NC <shreyas.nc@xxxxxxxxx>

SoundWire stream needs to be propagated to all the DAIs(cpu, codec).
So, add a snd_soc_dai_set_sdw_stream() API for the same.

Signed-off-by: Shreyas NC <shreyas.nc@xxxxxxxxx>
Signed-off-by: Vinod Koul <vinod.koul@xxxxxxxxx>
---
  include/sound/soc-dai.h | 21 +++++++++++++++++++++
  1 file changed, 21 insertions(+)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 58acd00cae19..0997d4593f6d 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -168,6 +168,8 @@ struct snd_soc_dai_ops {
  		unsigned int rx_num, unsigned int *rx_slot);
  	int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
+ int (*set_sdw_stream)(struct snd_soc_dai *dai,
+			void *stream, int direction);
  	/*
  	 * DAI digital mute - optional.
  	 * Called by soc-core to minimise any pops.
@@ -359,4 +361,23 @@ static inline void *snd_soc_dai_get_drvdata(struct snd_soc_dai *dai)
  	return dev_get_drvdata(dai->dev);
  }
+/**
+ * snd_soc_dai_set_sdw_stream() - Configures a DAI for SDW stream operation
+ * @dai: DAI
+ * @stream: STREAM
+ * @direction: Stream direction(Playback/Capture)
+ * SoundWire subsystem doesn't have a notion of direction and we reuse
+ * the ASoC stream direction to configure source/sink ports.
same issue as in v2, what is the convention here? How do you map playback/capture to source/sink?

+ *
+ * Returns 0 on success, a negative error code otherwise.
+ */
+static inline int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai,
+				void *stream, int direction)
+{
+	if (dai->driver->ops->set_sdw_stream)
+		return dai->driver->ops->set_sdw_stream(dai, stream, direction);
+	else
+		return -ENOTSUPP;
+}
+
  #endif

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux