linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 6/8] ASoC: dt: Allow the platform name to be set for a DAI
Date: Wed,  6 Aug 2014 03:18:30 +0200	[thread overview]
Message-ID: <1407287912-19447-7-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1407287912-19447-1-git-send-email-andrew@lunn.ch>

In order to use DPCM, we need to be able to set the platform name per
DAI. In particular, we need to use the "snd-soc-dummy" platform for
DPCM backends.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 include/sound/soc.h             | 2 ++
 sound/soc/generic/simple-card.c | 5 +++--
 sound/soc/soc-core.c            | 7 +++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 060e2f955292..3e4fd6eb5f32 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1380,6 +1380,8 @@ void snd_soc_of_parse_dynamic(struct device_node *np,
 			      struct snd_soc_dai_link *dai_link);
 void snd_soc_of_parse_no_pcm(struct device_node *np,
 			     struct snd_soc_dai_link *dai_link);
+void snd_soc_of_parse_platform_name(struct device_node *np,
+				    struct snd_soc_dai_link *dai_link);
 int snd_soc_of_get_dai_name(struct device_node *of_node,
 			    const char **dai_name);
 
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index c3235923b12f..a99aad16d8f9 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -237,6 +237,7 @@ static int simple_card_dai_link_of(struct device_node *node,
 	snd_soc_of_parse_dpcm(node, dai_link);
 	snd_soc_of_parse_dynamic(node, dai_link);
 	snd_soc_of_parse_no_pcm(node, dai_link);
+	snd_soc_of_parse_platform_name(node, dai_link);
 
 	/* Factor to mclk, used in hw_params() */
 	of_property_read_u32(node, "mclk-fs",
@@ -295,8 +296,8 @@ static int simple_card_dai_link_of(struct device_node *node,
 		goto dai_link_of_err;
 	}
 
-	/* simple-card assumes platform == cpu */
-	dai_link->platform_of_node = dai_link->cpu_of_node;
+	if (!dai_link->platform_name)
+		dai_link->platform_of_node = dai_link->cpu_of_node;
 
 	/* Link name is created from CPU/CODEC dai name */
 	name = devm_kzalloc(dev,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 8aa3a21d37af..667129078e44 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4767,6 +4767,13 @@ void snd_soc_of_parse_no_pcm(struct device_node *np,
 }
 EXPORT_SYMBOL_GPL(snd_soc_of_parse_no_pcm);
 
+void snd_soc_of_parse_platform_name(struct device_node *np,
+				    struct snd_soc_dai_link *dai_link)
+{
+	of_property_read_string(np, "platform_name", &dai_link->platform_name);
+}
+EXPORT_SYMBOL_GPL(snd_soc_of_parse_platform_name);
+
 int snd_soc_of_get_dai_name(struct device_node *of_node,
 			    const char **dai_name)
 {
-- 
2.0.1

  parent reply	other threads:[~2014-08-06  1:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06  1:18 [RFC 0/8] DPCM with simple-card support for Kirkwood Andrew Lunn
2014-08-06  1:18 ` [RFC 1/8] ASoC: kirkwood: add DPCM support Andrew Lunn
2014-08-06  1:18 ` [RFC 2/8] ASoC: simple-card: Make mclk setting a dai link property Andrew Lunn
2014-08-06  1:18 ` [RFC 3/8] ARM: Kirkwood: Update sound DT node to reflect DPCM support Andrew Lunn
2014-08-06  1:18 ` [RFC 4/8] ASoC: dt: Parse DPCM properties Andrew Lunn
2014-08-06  1:18 ` [RFC 5/8] ASoC: simple-card: Don't set DAI format for dynamic DAIs Andrew Lunn
2014-08-06  1:18 ` Andrew Lunn [this message]
2014-08-06  1:18 ` [RFC 7/8] ASoC: simple-card: Allow use of snd-soc-dummy as codec Andrew Lunn
2014-08-06  1:18 ` [RFC 8/8] ARM: Kirkwood: Describe DPCM audio support in DT Andrew Lunn
2014-08-06  8:33 ` [RFC 0/8] DPCM with simple-card support for Kirkwood Jean-Francois Moine
2014-08-06 14:30   ` Andrew Lunn
2014-08-06 17:43     ` Jean-Francois Moine
2014-08-06 17:53       ` Andrew Lunn
2014-08-06 18:29         ` Jean-Francois Moine

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=1407287912-19447-7-git-send-email-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.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).