From patchwork Tue May 31 09:05:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143891 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 71A4060757 for ; Tue, 31 May 2016 09:06:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6579325D97 for ; Tue, 31 May 2016 09:06:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A3AD27D17; Tue, 31 May 2016 09:06:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8528825D97 for ; Tue, 31 May 2016 09:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756398AbcEaJGI (ORCPT ); Tue, 31 May 2016 05:06:08 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:35505 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755920AbcEaJGG (ORCPT ); Tue, 31 May 2016 05:06:06 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 31 May 2016 18:06:04 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id E184B50400; Tue, 31 May 2016 18:06:04 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id E40D28002E; Tue, 31 May 2016 18:06:04 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id DCF5F8002D; Tue, 31 May 2016 18:06:04 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id UAH03029; Tue, 31 May 2016 18:06:04 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211980720" Received: from mail-pu1apc01lp0015.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.15]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:05:52 +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=4W+MUBQuiz5aXMkK5wgLPS154E4FjYhD+aEMM8e3U5Q=; b=N6WWILlNQEJ8tAN9+m4GGbE/yXNf7LmV3L1cb2QZgoQiuJYVBjIP5UoUiFfA1T60VRiQThYYXPM8WZhUA4d9GFr3LeboWtftW9muSQSFxELb8DtFotbpf/uboLiOZ605SdKg/35EKDERuv9LNUV9qD9jBgiu31KNL5u8+d5pjwM= 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 HK2PR06MB1697.apcprd06.prod.outlook.com (10.167.73.11) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 09:05:50 +0000 Message-ID: <87r3cir4b4.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 17/39 v2] ASoC: simple-card: use asoc_simple_card_parse_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 31 May 2016 09:05:50 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0104.jpnprd01.prod.outlook.com (10.167.154.22) To HK2PR06MB1697.apcprd06.prod.outlook.com (10.167.73.11) X-MS-Office365-Filtering-Correlation-Id: 205b08a8-ece6-4333-2d6a-08d38932c356 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1697; 2:knYNl9xqg+BXXckmBS3eKc7L8OSbsAtGtIjRRUU55xLiSMIuhrwsQb7P/ElkTFPrHTxCq1Ry2ljYRDWSedJDe8yw2k7RKEzfdcCw6NbKOOMmyF1jOdNJXrYvO7PWwTd7pxpUUwPMkGSDp+iPbGCZOAQvDebQIRif+YTvMCPFyzaxAIr9ozDCHKtSFy92nbQx; 3:bJBEa7JAY99muf7/stY1hRnmEdGOY/mh6TmDiBV/2e+DNW1OIOMTPNuoAhW+dNfZmSG5ABLs2ZIf2aCeazKWCz4aCOAW+/UOTqT48r9tqU0ZLkii1SjZz5l6iLuhQ8H+; 25:jI5o2SeOP92K6fV4iHa9eLLHhAr1lkx3v7SsXDJMKjUV/JWwsq+7NqVgVhonuu0Zko23s3iLCCmvCiT1BAaSYDVOovUYZuAj5onxaYQN4nZX0rKUaVa+5R4vZfGmbf818IfV22WeATKHDH7uEcAnf4wP/+6aM6ntyaHzFdZda4FRwxnI7hJ9Cq6Qbk4I9ORkhbqrYdslfZEjCxQpcELTqh5oFDJ7vk6mM3oI/tV6VTCY/a5PLG3mnlgNSaPvj4iaGOQnJORtx7mDb1GgmN5AYMmkQk3OtJzMlcLPg6Com9SduumhgRXgzUVzbdCQihiTIfu+5w7X7coKC8src1tFOXHfWLmC9X+oZ8mXWqm8UsD4qKXDqbl+fWdDcnpNXArLToJpiWa+sCUpA9EQWRlFvYOabLKme8UdsH0n893qn8k= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1697; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1697; 20:P2EOkD5VNw8S4Wf9xtMf4aZ4GC7ipJvkX9+zINV0DmV61ykbTEOaSStKK0651IvPIhEPVnjn79AM94DsJvkph3ogjdo2j5COOSXHzn2yIugt9SgqwmDB9K+jIEiBdPqjpTqsAeG/6ooNT1ZYXY/mqY3S2HDqboxD0Nq9NTB6fSRRzL78hV4YT7aAeaFPa40PTplZEkMmCvw49hKNhUt+T9q5QfRIDg7yXfYyFLdggq0WXofzjq9+PFj1Tf8KjVcHpXOrRZrB8AhcaIn94LlcNXeHo2BQw089KUW+7YDMYxqGbutvzJrq3OxqPEY1tTwtMRUWg3uwTi8iZlH77nsMW143yVLzVyuBbHjYfhJDVoFBFOAkDcLxTw7Syi5trPX8oqlGhExNMRI2V0MMNCI1DDu5sOrLU+V7Ozl1ZhQgeqfSF7N70dlC1LSICSfQCG605GuYq8VReEaXfjevRW5HNcdiPnJBSIDAmMwS0fTlb26pOiUeUO/lq7T909oD7hJF; 4:e+X77WmeAbGJi+VuDNBB+la0OXEiibCp3wpTvDP13EghVB5cFJSCO4AkEXtAOsZipFysWZi9FoDh/1dh7AeZJZ0dZieaI4fZD8EAvcak9dD5FHl5m6tWMeqYiTBL6sYRejxllk3Yluftbl68lH5qfze0JfoiUzfKnSNwrTX4FGfybLGWHX3m0uqKfxw244IdnTfme5uRfF50maXpR4PXM7H/4xSxhXExPTc6JdbzDFVyf4DA/xDd2R9P6UHisUGqkesXvfUT9M/xKnZFRydLsHsoEXj4rQ3uMXFWy1zpWG74oVN7g7AE+viytSSLhPyRYlSOXNcwNnVzHdBCo+Pnf7y6iUkgdLIEPSO7SwILrVCpqBQeLOC7seGUJVJORn3jdOOguCkeUcOMvu678BtURA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HK2PR06MB1697; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1697; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(46406003)(50986999)(92566002)(4001350100001)(8676002)(33646002)(81166006)(77096005)(83506001)(19580405001)(86362001)(5004730100002)(6116002)(586003)(3846002)(19580395003)(76176999)(110136002)(5008740100001)(189998001)(575784001)(50466002)(36756003)(23726003)(54356999)(66066001)(47776003)(4326007)(2906002)(53416004)(42186005)(2950100001)(229853001)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1697; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB1697; 23:RWSefTmfMxrYSKfy6v6qVThVB7nVKyJp5eYNtHF25?= =?us-ascii?Q?MQnW7P7BCnBpY8O9mgJCTJ6wXhwTUjpcP37aboxydkaAQuGOQCfIzufBa+8d?= =?us-ascii?Q?l5qgFSF2lP6UKR5keaabfx7ozLgSK+Wz4vDwb9HAuW/kxWkmNXOd8ZrSG9Xl?= =?us-ascii?Q?WIXIrlTzcrDJzq+RfdgVvxdw6ufqrOKqY10VKJKxs9dGW1MRZ6uuu/9ZVVN1?= =?us-ascii?Q?dO6L5h1Utg0gszQ0uJ/OLQmrLoyZGnU9nErXWKa0NoM9CCNBNyD6goW9dyXy?= =?us-ascii?Q?sI1NPBqhzgYML52lbPRj0GFZCUkKmgfaJQeCJ5AYkRDOYvM+TlK0jx7Pwhkl?= =?us-ascii?Q?Q4uS/pPmU4i0s86SfhD2D/rh+0hPIh3uSnonVvK08gQZ1RXHRJiKAvt89s+K?= =?us-ascii?Q?ct06ByO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bbrE1ILPoVJU1Qpiw/b/KP5nQ30zGQgP38ADemZ9feFbN4JHC5EVSbs14opL8OlIT67a3TPVGwT5vV/Tl+e2FAyDbbCAfuYkR9QEPyJ8WLxUw0RtsHkl8dTkJt/Bnvq0KaOXY9ZOWJy/lhBN4ihWNFWp0QuplwxF3OG3fqzje2Dfe01hXIgfFw; 20:mUCr9vww/vsb+NquGQ8UG7eAwD2fwcmwJeltijkM3I23Q3OYolofP06uScRFUzjizSEnbHcJyGJx+NqE0VBUjKF4QEKwX++VTfduEf6QJm/qqNhTBBjhwxBdCS+mfGChBtLgirFnPlkibZKmQvsR01kQZ07+nv5Vg7z33egeYIg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:05:50.3415 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1697 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 43 +++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 6a4d1d4..f0f45bf 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -44,6 +44,8 @@ struct simple_card_data { #define simple_priv_to_link(priv, i) ((priv)->snd_card.dai_link + i) #define simple_priv_to_props(priv, i) ((priv)->dai_props + i) +#define DAI "sound-dai" +#define CELL "#sound-dai-cells" #define PREFIX "simple-audio-card," #define asoc_simple_card_init_hp(card, sjack, prefix)\ @@ -243,33 +245,11 @@ asoc_simple_card_sub_parse_of(struct device_node *np, const char **name, int *args_count) { - struct of_phandle_args args; int ret; if (!np) return 0; - /* - * Get node via "sound-dai = <&phandle port>" - * 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); - if (ret) - return ret; - - *p_node = args.np; - - if (args_count) - *args_count = args.args_count; - - /* Get dai->name */ - if (name) { - ret = snd_soc_of_get_dai_name(np, name); - if (ret < 0) - return ret; - } - if (!dai) return 0; @@ -299,7 +279,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, char *name; char prop[128]; char *prefix = ""; - int ret, cpu_args; + int ret, single_cpu; u32 val; /* For single DAI link & old style of DT node */ @@ -329,10 +309,23 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, if (!of_property_read_u32(node, "mclk-fs", &val)) dai_props->mclk_fs = val; + ret = asoc_simple_card_parse_cpu(cpu, dai_link, + DAI, CELL, &single_cpu); + if (ret < 0) + goto dai_link_of_err; + + ret = asoc_simple_card_parse_codec(codec, dai_link, DAI, CELL); + if (ret < 0) + goto dai_link_of_err; + + ret = asoc_simple_card_parse_platform(plat, dai_link, DAI, CELL); + if (ret < 0) + goto dai_link_of_err; + ret = asoc_simple_card_sub_parse_of(cpu, &dai_props->cpu_dai, &dai_link->cpu_of_node, &dai_link->cpu_dai_name, - &cpu_args); + &single_cpu); if (ret < 0) goto dai_link_of_err; @@ -399,7 +392,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, * fmt_single_name() * fmt_multiple_name() */ - if (!cpu_args) + if (single_cpu) dai_link->cpu_dai_name = NULL; dai_link_of_err: