From: Fabio Estevam <fabio.estevam@freescale.com>
To: broonie@kernel.org
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
alsa-devel@alsa-project.org, lars@metafoo.de,
shawn.guo@linaro.org
Subject: [PATCH 1/2] ASoC: soc-pcm: Allow to specify unidirectional dai_link
Date: Thu, 29 Aug 2013 10:32:13 -0300 [thread overview]
Message-ID: <1377783134-23528-1-git-send-email-fabio.estevam@freescale.com> (raw)
Add 'playback_only' and 'capture_only' fields that can be used for specifying
that a dai_link has a unidirectional capability.
The motivation for this is for the cases of systems, such as Freescale MX28,
that has two unidirectional DAIs.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
include/sound/soc.h | 4 ++++
sound/soc/soc-pcm.c | 10 ++++++++++
2 files changed, 14 insertions(+)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 8e2ad52..774d3be 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -934,6 +934,10 @@ struct snd_soc_dai_link {
/* machine stream operations */
const struct snd_soc_ops *ops;
const struct snd_soc_compr_ops *compr_ops;
+
+ /* For unidirectional dai links */
+ bool playback_only;
+ bool capture_only;
};
struct snd_soc_codec_conf {
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index fb70fbe..5e44863 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2020,6 +2020,16 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
capture = 1;
}
+ if (rtd->dai_link->playback_only) {
+ playback = 1;
+ capture = 0;
+ }
+
+ if (rtd->dai_link->capture_only) {
+ playback = 0;
+ capture = 1;
+ }
+
/* create the PCM */
if (rtd->dai_link->no_pcm) {
snprintf(new_name, sizeof(new_name), "(%s)",
--
1.8.1.2
next reply other threads:[~2013-08-29 13:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 13:32 Fabio Estevam [this message]
2013-08-29 13:32 ` [PATCH 2/2] ASoC: mxs-sgtl5000: Configure the dai_links as unidirectional Fabio Estevam
2013-09-01 15:29 ` [PATCH 1/2] ASoC: soc-pcm: Allow to specify unidirectional dai_link Mark Brown
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=1377783134-23528-1-git-send-email-fabio.estevam@freescale.com \
--to=fabio.estevam@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=shawn.guo@linaro.org \
/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).