alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: ALSA <alsa-devel@alsa-project.org>,
	tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	Vinod Koul <vkoul@kernel.org>,
	broonie@kernel.org, Shreyas NC <shreyas.nc@intel.com>
Subject: [PATCH v6 08/13] ASoC: Add SoundWire stream programming interface
Date: Thu, 26 Apr 2018 18:50:04 +0530	[thread overview]
Message-ID: <1524748809-21860-9-git-send-email-vkoul@kernel.org> (raw)
In-Reply-To: <1524748809-21860-1-git-send-email-vkoul@kernel.org>

From: Shreyas NC <shreyas.nc@intel.com>

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@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 include/sound/soc-dai.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 58acd00cae19..03ae58c13b49 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,25 @@ 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 sink/source ports.
+ * Playback maps to source ports and Capture for sink ports.
+ *
+ * This should be invoked with NULL to clear the stream set previously.
+ * 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
-- 
2.7.4

  parent reply	other threads:[~2018-04-26 13:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 13:19 [PATCH v6 00/13] soundwire: Add stream support Vinod Koul
2018-04-26 13:19 ` [PATCH v6 01/13] Documentation: soundwire: Add more documentation Vinod Koul
2018-04-26 13:19 ` [PATCH v6 02/13] soundwire: Add support for SoundWire stream management Vinod Koul
2018-04-26 13:19 ` [PATCH v6 03/13] soundwire: Add support for port management Vinod Koul
2018-04-26 13:20 ` [PATCH v6 04/13] soundwire: Add Master and Slave port programming Vinod Koul
2018-04-26 13:20 ` [PATCH v6 05/13] soundwire: Add helpers for ports operations Vinod Koul
2018-04-26 13:20 ` [PATCH v6 06/13] soundwire: Add bank switch routine Vinod Koul
2018-04-26 13:20 ` [PATCH v6 07/13] soundwire: Add stream configuration APIs Vinod Koul
2018-04-26 13:20 ` Vinod Koul [this message]
2018-05-09  8:55   ` [PATCH v6 08/13] ASoC: Add SoundWire stream programming interface Mark Brown
2018-04-26 13:20 ` [PATCH v6 09/13] soundwire: Remove cdns_master_ops Vinod Koul
2018-04-26 13:20 ` [PATCH v6 10/13] soundwire: cdns: Add port routines Vinod Koul
2018-04-26 13:20 ` [PATCH v6 11/13] soundwire: cdns: Add stream routines Vinod Koul
2018-04-26 13:20 ` [PATCH v6 12/13] soundwire: intel: Add stream initialization Vinod Koul
2018-04-26 13:20 ` [PATCH v6 13/13] soundwire: intel: Add audio DAI ops Vinod Koul
2018-04-27 13:23 ` [PATCH v6 00/13] soundwire: Add stream support Pierre-Louis Bossart
2018-05-06  5:45 ` Vinod Koul
2018-05-11 11:48   ` Vinod Koul
2018-05-11 13:27     ` Greg KH
2018-05-11 16:30       ` Vinod

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524748809-21860-9-git-send-email-vkoul@kernel.org \
    --to=vkoul@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shreyas.nc@intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).