From: Vinod Koul <vinod.koul@intel.com>
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,
broonie@kernel.org, Shreyas NC <shreyas.nc@intel.com>,
Vinod Koul <vinod.koul@intel.com>
Subject: [PATCH 08/13] ASoC: Add SoundWire stream programming interface
Date: Wed, 28 Mar 2018 15:08:33 +0530 [thread overview]
Message-ID: <1522229918-4748-9-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1522229918-4748-1-git-send-email-vinod.koul@intel.com>
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 <vinod.koul@intel.com>
---
include/sound/soc-dai.h | 5 +++++
sound/soc/soc-core.c | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 58acd00cae19..78fa068560cf 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -129,6 +129,9 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width);
+int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai,
+ void *stream, int direction);
+
int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai,
unsigned int tx_num, unsigned int *tx_slot,
unsigned int rx_num, unsigned int *rx_slot);
@@ -168,6 +171,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.
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c0edac80df34..690e56a35237 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2882,6 +2882,26 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot);
/**
+ * 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.
+ *
+ * Returns 0 on success, a negative error code otherwise.
+ */
+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;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_set_sdw_stream);
+
+/**
* snd_soc_dai_set_channel_map - configure DAI audio channel map
* @dai: DAI
* @tx_num: how many TX channels
--
2.7.4
next prev parent reply other threads:[~2018-03-28 9:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 9:38 [PATCH 00/13] soundwire: Add stream support Vinod Koul
2018-03-28 9:38 ` [PATCH 01/13] soundwire: Add more documentation Vinod Koul
2018-03-30 1:47 ` Pierre-Louis Bossart
2018-03-30 6:38 ` Vinod Koul
2018-03-28 9:38 ` [PATCH 02/13] soundwire: Add support for SoundWire stream management Vinod Koul
2018-03-30 1:57 ` Pierre-Louis Bossart
2018-03-30 6:42 ` Vinod Koul
2018-03-30 6:44 ` Vinod Koul
2018-03-28 9:38 ` [PATCH 03/13] soundwire: Add support for port management Vinod Koul
2018-03-28 9:38 ` [PATCH 04/13] soundwire: Add Master and Slave port programming Vinod Koul
2018-03-28 9:38 ` [PATCH 05/13] soundwire: Add helpers for ports operations Vinod Koul
2018-03-28 9:38 ` [PATCH 06/13] soundwire: Add bank switch routine Vinod Koul
2018-03-28 9:38 ` [PATCH 07/13] soundwire: Add stream configuration APIs Vinod Koul
2018-03-28 9:38 ` Vinod Koul [this message]
2018-03-30 3:05 ` [PATCH 08/13] ASoC: Add SoundWire stream programming interface Takashi Sakamoto
2018-03-30 6:03 ` Greg KH
2018-04-02 6:26 ` Takashi Sakamoto
2018-04-03 12:03 ` Takashi Iwai
2018-04-05 5:03 ` Takashi Sakamoto
2018-04-05 6:38 ` Vinod Koul
2018-03-28 9:38 ` [PATCH 09/13] soundwire: Remove cdns_master_ops Vinod Koul
2018-03-28 9:38 ` [PATCH 10/13] soundwire: cdns: Add port routines Vinod Koul
2018-03-28 9:38 ` [PATCH 11/13] soundwire: cdns: Add stream routines Vinod Koul
2018-03-28 9:38 ` [PATCH 12/13] soundwire: intel: Add stream initialization Vinod Koul
2018-03-28 9:38 ` [PATCH 13/13] soundwire: intel: Add audio DAI ops Vinod Koul
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=1522229918-4748-9-git-send-email-vinod.koul@intel.com \
--to=vinod.koul@intel.com \
--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).