From patchwork Thu Apr 14 05:48:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8831781 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4BF34C0553 for ; Thu, 14 Apr 2016 05:49:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94BCE20114 for ; Thu, 14 Apr 2016 05:49:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0139202EC for ; Thu, 14 Apr 2016 05:49:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753786AbcDNFtF (ORCPT ); Thu, 14 Apr 2016 01:49:05 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:58365 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752179AbcDNFtD (ORCPT ); Thu, 14 Apr 2016 01:49:03 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 14 Apr 2016 14:49:01 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 7042D3FF1D; Thu, 14 Apr 2016 14:49:01 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 56A4E1806F; Thu, 14 Apr 2016 14:49:01 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 519301800A; Thu, 14 Apr 2016 14:49:01 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id QAJ25946; Thu, 14 Apr 2016 14:49:01 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="209318932" Received: from mail-pu1apc01lp0015.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.15]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 14 Apr 2016 14:48:59 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KuWJa2fD0LM74a/U3Bs7i0gOPr0JlEAaejA1zXFWayc=; b=UqevOZ/v17zCatEokYXcQaVIdcCZdnOvlOC6h7zmAmxnAMIs5y4T+uMEuwhkLaWgtBsirs/YUEs9Z4n8MslQhJOWuAQCwLTIKY7w/FH20R0OC9lTAZOO2spSFPXzMVniimACrPs1QMReqxj38LUezuEiGW8Kfm2SV2E7HtPh8Qk= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by SG2PR06MB1712.apcprd06.prod.outlook.com (10.167.82.142) with Microsoft SMTP Server (TLS) id 15.1.453.26; Thu, 14 Apr 2016 05:48:57 +0000 Message-ID: <87vb3kvj7i.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/4] ASoC: simple-card: probe both sound-dai and remote-endpoint User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Laurent , Lars-Peter Clausen CC: Simon , Linux-Renesas , Linux-DT , Linux-ALSA , Liam Girdwood , Jose Abreu In-Reply-To: <871t68wxxe.wl%kuninori.morimoto.gx@renesas.com> References: <871t68wxxe.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 14 Apr 2016 05:48:57 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0011.jpnprd01.prod.outlook.com (10.161.74.149) To SG2PR06MB1712.apcprd06.prod.outlook.com (10.167.82.142) X-MS-Office365-Filtering-Correlation-Id: 1159119b-e030-4415-0ae0-08d364287924 X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1712; 2:wHh5QuC0050O88sjd8LOeypguMjenDcTiSzFnUFfgpI7tlo6Ui6plzyITBRxfBtb/Zg2xiGGNudbPiQ6KzEHNqJpUFcLm76MCxkNMbdk0zZCfy+ma+j14vWWaK7qOVNNwIi/nIllOfuWqPLlXpGev7koOegidpiZWzDMpyHo+DsdjrUtEPGw8qiLQxYrEmH4; 3:gDIH4y2WYplPsJUyDh/WXdXiD5ritqt5Vu9r7Xa5CRirUQCPKiZTZiCmekSQ5UupzayTadLJmPvDwGnbXJuTfnDKeuQ/YUkI4U0thYcRE92juJ8IytwBIxghD70vcpee; 25:E5nRWh1iVxX6ue44qsAS+knz6OlKK60mG8BdPcTcfM6sOqatf3Ba7/8+5Gen9vZxepRIHfwNEOWj9iGgV7XJr8q2Dr0kE+Ge9L2hrn0LHUziT7CT3h2UYjW4S8uy0fWx7sInK1mC4ZujKTBSO+kpv+sll2ntlcNEhYjY6RVkOjYCdjd8qzUSdLOszMX1gwJiQT8Wbvw6lXwoz7EbtfZ3Zy3wqhTcsXal8+EMxKOKb7tpvq+sk5GGhQoFJaQlt9UGGLvpArBfP/Yl3u8Q2vo0PmcUprA5LzvjD1g6l4rZJLUltH5KWQuMqSdm6kmnNcoZ6VgMYCxNYLFxNDhrW3dPsA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB1712; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1712; 20:IHGoiMnjKWaVAw9ksxTDezrg4oFWv3wM1kk07Oixzi6bwFcs6dIRsbB7P0IAfxtR35ElJnBzSglWuJRDvZoi3hd3Gl+6PhNZgI2dJS2Bb17Z85tSYkXoknJRXMoN0nYchi2x8KlRQaxoepAGuIHxSMQDWvTqAB4Z0mz6CevS6i1ssdtStKNLhnUtShlXzFaMGcT9k53w55k6vpvnNGihElNB1AyOgrCMb7zXx8JUW1vmPu3BLXME76dZWuWIxKfmX8IpG57i/zjmcZaKyF22WpKCtgl5h7SIQ2CE63dR4FAgFKPFLQ2FWK0ArwdLf8RwLh93IvoFR+h7gC5BE2FTPBVQU/is+hR0NzqQG+miUOghNWegTyHQcbFlvd4Fhgzh7vS8p/fjGm2NyLVbBBialiZrPD3xNyt+0nT+mLJ4GMI9LP4I0g+6zi48jaNIbnzJ/Dej5d2oVf8CtiouDWzutRwQSmVqpMVb8fbhZTbhLiwk0RzTlnYk4m6zyukRRsYP; 4:AAvA2Syv5G/2hnmFU/0e0Uur8mI/zsLAoJX0pmpsDz0ZfCrAhw1akZhDacTFGDzSMbhFKjVj1hnLWMhfVB1mVpg8n8FzgmG4mdnneeFwRH8eWxy3ZxLdUGDDL1ncV/iGAF0rFrMrlqtHOnSg112JlE77MIvdntoH+28vRdyJwxf1Bm6S22OXM1/g0OQKsyV2dzh2PdTtvFQ67zIv+T6E6muWnwV9wcWcCVemlth5bf0WiKrXH0FkzYXExUFPBIcWIPjS0s3rnX9qmMDUy6lWXzgiBQvYBbLQHsG8xPolbgp6k0gYB7jcERTvylLuquSSQ05NUHwScbq//+MTQuBQiETZc0kBL5ov6cgGnIfBInjefMnS0biU9FUGGPRhxlngTfp5s40zMpQSY/g2wX90rg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:SG2PR06MB1712; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1712; X-Forefront-PRVS: 0912297777 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(66066001)(46406003)(47776003)(3846002)(4001350100001)(2906002)(23726003)(6116002)(189998001)(81166005)(1096002)(53416004)(5008740100001)(586003)(5001770100001)(92566002)(42186005)(76176999)(50986999)(83506001)(77096005)(19580405001)(19580395003)(50466002)(4326007)(2950100001)(54356999)(86362001)(229853001)(36756003)(33646002)(5004730100002)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1712; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1712; 23:Md0uVY6nkNB0wvyjOBG3Csv/AQVY5joFFDHeQ656b?= =?us-ascii?Q?545pOvc2/Fv1FBKgW3gtDoHi+dmZMXA8YnSQ84Lnv2Agtwf2jFcc3137OOqs?= =?us-ascii?Q?Lxt9R9qTUi/ol39gQzHyhIYpqjkNKL1TEoDxby33AQsuHhGL9PLAyYOzUjKK?= =?us-ascii?Q?zyA2DO42Ov4UmXBIa0gVwHxEGCKjgBganCoeHI2iiOvyfvVhPF/PTsctu/NK?= =?us-ascii?Q?9XEK9vEiszoCaoqkaf3/uzIrG2Rd6Rqexo44t3JhYcMLvqwCq/ojs89HuZHp?= =?us-ascii?Q?pdJDdMv+vcOTbrjnDq04T+rX0sSJAlsSL5j7YrWYVeFC4FVC9R689lLyTZjd?= =?us-ascii?Q?6gXHqfsUCx2F7inDHOs/uz68xezm+JbqM/OsASusDd0R1U6hpXsIVzEjA0E0?= =?us-ascii?Q?Rs6KIp7KK1WBFo1QrjrWrA7YxhM4cbjVShWS4GvMrPL7p9GO6a+A+51tnGwT?= =?us-ascii?Q?7H+dq6TPgylC8FKd61WB0n1D3Uvqc8NoJQ0/fOHGA3bfwt9sHS7TTtktNpaO?= =?us-ascii?Q?m0cSCgg3ggjEdvt9fbAM07v4AVbCDRFU1Gl/+JbhCjz6T6U9Le8yV4tc5ujo?= =?us-ascii?Q?vsxHBL2E1Davcya3G0+cL0KAADnq7JRO/gkSyoqEvVPPICW+I3JXkC2MrAKM?= =?us-ascii?Q?uGjO4sITijvg6h03YB/QJrpgUilF+9vhlM+JWN4viP+GW+dlUdKNArzNc5JN?= =?us-ascii?Q?0auo8lZj3ytuYU8nzcuTY/pcW6dhASQeFbLQeiM8IljtsYnpRFf3SA+uz6eU?= =?us-ascii?Q?oJ84s3SKfJRbPvDsR1wPi9EBho281cuSGjuVSWUkau7n7zQaIW+HYM9vq1Us?= =?us-ascii?Q?caxyasvfuQxc3ZiXo6EWi6L4HFZy5XC+D8x3gJpQVqCF628CE7OAB3z+rfOi?= =?us-ascii?Q?Awq+0H0QCkQgJCSUC/BMtZYHbYdYA0Kh9KoIlvQ7s/o5+cPG+606GWmi6nFO?= =?us-ascii?Q?9LOTVAd8JpQEUl4BA0OjgfGvvS20/hP8zgoAN8Mnia52hVdEbeyqRITKedSZ?= =?us-ascii?Q?0k=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1712; 5:Bd9gYCE7kYsqibCTc/iRhmUj8AWipILLt0dUaoAhrS0aKQJtQ2V+rPe8l4jK7mStEXOg4qxRvNKQ7lutkUoEo+z64Wfm5XGPlooMJDFIep02spy+73u3L1MtbJdIh6GvR2AZlybueItmwvBODqKtXA==; 24:DiMTT4A0Yq9C6a+u+f2vVAsMZzqvEMiB7MuDM6CyieacVj53Zd4h+gN8wTwiKBSoOsziBiuGk8Zxv6GLkuEcdQGb8y33KRyawErFre1a3P8=; 20:Iv+AXFF4GOHGECRYtYpVKtDmCXXG7pUAwl233itz7l+OU4OLUoPS1nzYSkhvci1ZDrSxK+plR35rKUVVsmKJm7S96sHKEIXj8xyeppSc/nDWPLPLojnceZHZKRl9k304eknvAvNpoTZ3mnizcpX8m4d0RgYkIRszdkSdrP43rVs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2016 05:48:57.3089 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1712 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,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 From: Kuninori Morimoto Current simple-card can probe "sound-dai" base connection on DT. OTOH, V4L2 soc is using graph base connection. Because of this different style, DT will be confusable if it support both video/sound in same time. This patch enables both "sound-dai" (= current simple-card style) and "remote-endpoint" (= current V4L2 style) on simple-card. sound { compatible = "simple-audio-card"; ... sndcpu: simple-audio-card,cpu { sound-dai = <&xxxx>; }; sndcodec: simple-audio-card,codec { remote-endpoint = <&yyyy>; }; }; Signed-off-by: Kuninori Morimoto --- .../devicetree/bindings/sound/simple-card.txt | 19 +++++++++++++++++++ sound/soc/generic/simple-card.c | 9 ++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt index cf3979e..030edca 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.txt +++ b/Documentation/devicetree/bindings/sound/simple-card.txt @@ -70,6 +70,7 @@ properties should also be placed in the codec node if needed. Required CPU/CODEC subnodes properties: - sound-dai : phandle and port of CPU/CODEC +- remote-endpoint : graph endpoint of CPU/CODEC Optional CPU/CODEC subnodes properties: @@ -162,3 +163,21 @@ sound { }; }; }; + +Example 3 - sound-dai and remote-endpoint + +rsnd_ak4613: sound { + compatible = "simple-audio-card"; + + simple-audio-card,name = "R-Sound"; + simple-audio-card,format = "left_j"; + simple-audio-card,bitclock-master = <&sndcpu>; + simple-audio-card,frame-master = <&sndcpu>; + + sndcpu: simple-audio-card,cpu { + sound-dai = <&rcar_sound 1>; + }; + sndcodec: simple-audio-card,codec { + remote-endpoint = <&du_out_hdmi0>; + }; +}; diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 2389ab4..a1d6001 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -224,11 +225,13 @@ asoc_simple_card_sub_parse_of(struct device_node *np, int ret; /* - * Get node via "sound-dai = <&phandle port>" + * Get node via + * sound-dai = <&phandle port> + * or + * remote-endpoint = <&phandle> * it will be used as xxx_of_node on soc_bind_dai_link() */ - ret = of_parse_phandle_with_args(np, "sound-dai", - "#sound-dai-cells", 0, &args); + ret = of_parse_snd_soc_connection_with_args(np, &args); if (ret) return ret;