From patchwork Wed Aug 6 01:18:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 4682931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4CD0DC0338 for ; Wed, 6 Aug 2014 01:27:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7316E201DD for ; Wed, 6 Aug 2014 01:27:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BF1E20170 for ; Wed, 6 Aug 2014 01:27:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEpyi-00019B-7J; Wed, 06 Aug 2014 01:25:20 +0000 Received: from vps0.lunn.ch ([178.209.37.122]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEpya-0008BK-0X for linux-arm-kernel@lists.infradead.org; Wed, 06 Aug 2014 01:25:12 +0000 Received: from lunn by vps0.lunn.ch with local (Exim 4.80) (envelope-from ) id 1XEpsF-00054a-Dg; Wed, 06 Aug 2014 03:18:39 +0200 From: Andrew Lunn To: Russell King 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 Message-Id: <1407287912-19447-7-git-send-email-andrew@lunn.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1407287912-19447-1-git-send-email-andrew@lunn.ch> References: <1407287912-19447-1-git-send-email-andrew@lunn.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140805_182512_238969_6414E5EA X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -0.7 (/) Cc: Jean-Francois Moine , linux ARM , Andrew Lunn X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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) {