From patchwork Tue May 31 09:10:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143937 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 DD5F060777 for ; Tue, 31 May 2016 09:10:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0B1C27B89 for ; Tue, 31 May 2016 09:10:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C592E28185; Tue, 31 May 2016 09:10:49 +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 3080B27B89 for ; Tue, 31 May 2016 09:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756869AbcEaJKs (ORCPT ); Tue, 31 May 2016 05:10:48 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:28894 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756862AbcEaJKq (ORCPT ); Tue, 31 May 2016 05:10:46 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 31 May 2016 18:10:44 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id CAB8461426; Tue, 31 May 2016 18:10:44 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id C96D08002E; Tue, 31 May 2016 18:10:44 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id C3C748002D; Tue, 31 May 2016 18:10:44 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id UAA04645; Tue, 31 May 2016 18:10:44 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="212432454" 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; 31 May 2016 18:10:43 +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=MlZ0MB8jgOrDXQ8qaCZ7YoRM1RNYj6WZ0XjDYkLzauQ=; b=dw50aKe5t/hLP2QX60sfM16bhFfbxOM5jq+wPXrBe3jpD0w05AinBMnVJ6dT8dcmPSZY17nRmHjcqxpmLtb9QJ+0+ZkkMXUJNq2F3wULqLNJvsaHB8nts4icKInW9iNzEMEXMhxV6ecY5SGog951SHnIspr8WN+9Z7NEyUQ7Ovc= 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 KL1PR06MB1702.apcprd06.prod.outlook.com (10.167.63.16) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 09:10:41 +0000 Message-ID: <87a8j6r432.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 29/39 v2] ASoC: rsrc-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:10:41 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0035.jpnprd01.prod.outlook.com (10.164.162.17) To KL1PR06MB1702.apcprd06.prod.outlook.com (10.167.63.16) X-MS-Office365-Filtering-Correlation-Id: 29e48955-9a2d-4e35-d572-08d38933711c X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1702; 2:NUSQ6SuU7tB6BtjarmvLbfBdX2KWOMYCmlbZ8Y5N8mZ677D8LbOJ8tB/KVCmBdMUMPnCi32flua7shNXKDB3q/axkWq8oTkj/bFvlYp2BWpu5OoNhpieyFB4tjdVJg92MyJh9d0pt53eIRm11r26p1klz8OtXI/JNGxOf3m7BMfY+aMCaN7U+MdNl7bdYgqe; 3:mpt4pOY6X9AitYcDlMsStZAK3eBxwEtI1c6jVVZcIhp1ZxwlB/gprcvki/LODsWfgVk9gV9iysnIHsi3KeI8zkU4kCtO2AVrdGlJMOPawWuNOnLMWXPdRe/0lHATqnkY X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR06MB1702; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1702; 25:LcUAQC3DDkLtSgKSvtelktqN0Wd5pHCnFhvMQYJgu6zak07vRYvdscfxV6R4XgiurWki+y6wv86PqWAzm2ULqm8LMjdRDrnDT/wsCj2z2R/dg4v5TWQ3hsXRcvO3dqRiXVdpvg/EL0K+03jAi1FhS7F7A3VFfnTeyE7DomVuZcF4CGZSTftG8UadEf1cWlfaoEaUjJXZzjOf3o+A1rYKAExysSDJMk6ZTbOx8xdmTD0Z8Ft+fIP4UObLNSSwmXQvfrWsuG2vQXCf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Ij3s6CE5FljB0uBGRjhVIvYvJa7jEPwwiIfLytjfx/7BT+/IGvUlYTG7JS4znlGTVw0U++/3aAOB/j6HN5ixfsgyIFYPcmSxQYggK63I86aLCORUjobuU6Ws1vpMtI3TwzMPQmAk0SI9FUho/LUx2xbqun/IU8fNRF8C3upP97YKS4kN3VMghosxkGOP9lRIxZ4hY0mCVDc2LiRoEUPTNn09f0rKEhPRG1FXoEENg2v9O70sPstKi0+QGG+4eWlMegax8DSOZflPsbp9a/4mNQuea7Z/Hoc+27EIAlwy2jYv/GLOadWeSng== 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:KL1PR06MB1702; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1702; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(47776003)(6116002)(23726003)(3846002)(586003)(54356999)(50986999)(76176999)(4326007)(2906002)(4001350100001)(229853001)(19580395003)(2950100001)(81166006)(86362001)(50466002)(42186005)(53416004)(92566002)(110136002)(5004730100002)(36756003)(77096005)(33646002)(189998001)(66066001)(5008740100001)(83506001)(46406003)(8676002)(19580405001)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1702; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR06MB1702; 23:ysEzW+gsMlXqcUc2d9WpB5Q6QedhIS/bfG1gLfGTu?= =?us-ascii?Q?8mbF4vNA0KQhmmZwbGv2pQKUi/C+Qolegl5BAXCE0ttZjDKULhp1wNbf6I8A?= =?us-ascii?Q?Q8X4QoYx7NYQ0pXI5Q5JWr1FXTOWgpCmQYSN1p+iEGa1EcbzE4pcZTzCD6mh?= =?us-ascii?Q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06MB1702; 5:/5Hyd6gM5bq9ES+KfhyOl2Swl1ni2778luJKeZoyD7SgwHMvXKQTxUqcRF1ezK0tXHxVMIpqcRwMFFONK7plh5J007+n+nGCrDR1MyJF8o9w2eht32GCJfHsL/uBCwd92seJv81CJvymdGs4lnHllQ==; 24:GeR2UrSmPJkbzpOCRpIFQw9bQPPzcIzD+9vg2PyRvSAub3OUTfU/+u9qkS5v1nmgrF9YKU9BsOQhGZxFhODCzChl0JhKP78dmkd9jMGp9f0=; 7:N73gNaW37KFM4UPA8AK2M3Q93nq3DeZ/X0w9GvHmpaAGEWPbEKEYv0HOuPYYW9kqE5jdQ8G769ZJsFitoZ9cclmphvyO7aovZQ/Rbat1pceHVagH/9A9KTtIzAEvmvPxHdfMbA+WSt+C8AbkYSjQy8qkDkGoiNK23oMyf8LJFwfgUcLOE1JtzqCCfwCWGwMK; 20:nVYeIYAf0A27VD9K3OavlLxoRYlJYV6oCuEhqbMdzMzaFro+l0cBDhlSKDUYWWgrDB77oSqbVnWm0GjIczFukWA4cMmuJ5Kco8PzibsmuLDXbZYoOOMhM2ZY6+pMudxlduhd21HT7dGS0yGVUBgk82gGfWQyPeK9hHNWqq2Dv1E= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:10:41.6392 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1702 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/sh/rcar/rsrc-card.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index c326562..87b9d87 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -62,6 +62,9 @@ struct rsrc_card_priv { #define rsrc_priv_to_link(priv, i) ((priv)->snd_card.dai_link + (i)) #define rsrc_priv_to_props(priv, i) ((priv)->dai_props + (i)) +#define DAI "sound-dai" +#define CELL "#sound-dai-cells" + static int rsrc_card_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -155,18 +158,9 @@ static int rsrc_card_parse_links(struct device_node *np, struct device *dev = rsrc_priv_to_dev(priv); struct snd_soc_dai_link *dai_link = rsrc_priv_to_link(priv, idx); struct asoc_simple_dai *dai_props = rsrc_priv_to_props(priv, idx); - struct of_phandle_args args; + int is_single_links = 0; int ret; - /* - * 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; - /* Parse TDM slot */ ret = snd_soc_of_parse_tdm_slot(np, &dai_props->tx_slot_mask, @@ -185,9 +179,10 @@ static int rsrc_card_parse_links(struct device_node *np, /* FE settings */ dai_link->dynamic = 1; dai_link->dpcm_merged_format = 1; - dai_link->cpu_of_node = args.np; - ret = snd_soc_of_get_dai_name(np, &dai_link->cpu_dai_name); - if (ret < 0) + + ret = asoc_simple_card_parse_cpu(np, dai_link, DAI, CELL, + &is_single_links); + if (ret) return ret; ret = asoc_simple_card_parse_clk_cpu(np, dai_link, dai_props); @@ -203,7 +198,7 @@ static int rsrc_card_parse_links(struct device_node *np, * fmt_single_name() * fmt_multiple_name() */ - if (!args.args_count) + if (is_single_links) dai_link->cpu_dai_name = NULL; } else { const struct rsrc_card_of_data *of_data; @@ -218,8 +213,8 @@ static int rsrc_card_parse_links(struct device_node *np, /* BE settings */ dai_link->no_pcm = 1; dai_link->be_hw_params_fixup = rsrc_card_be_hw_params_fixup; - dai_link->codec_of_node = args.np; - ret = snd_soc_of_get_dai_name(np, &dai_link->codec_dai_name); + + ret = asoc_simple_card_parse_codec(np, dai_link, DAI, CELL); if (ret < 0) return ret;