From patchwork Fri May 20 10:02:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129107 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 78CEE6048B for ; Fri, 20 May 2016 10:02:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A7BA279C4 for ; Fri, 20 May 2016 10:02:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CF7527BF1; Fri, 20 May 2016 10:02:45 +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 7EB20279C4 for ; Fri, 20 May 2016 10:02:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753772AbcETKCn (ORCPT ); Fri, 20 May 2016 06:02:43 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:7814 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751971AbcETKCm (ORCPT ); Fri, 20 May 2016 06:02:42 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 20 May 2016 19:02:40 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id BBB05533A7; Fri, 20 May 2016 19:02:40 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 9D8E18002F; Fri, 20 May 2016 19:02:39 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 5CBB980030; Fri, 20 May 2016 19:02:39 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id VAT16646; Fri, 20 May 2016 19:02:39 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211275330" Received: from mail-hk2apc01lp0210.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.210]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 19:02:38 +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=YP5oKpKvUfhzviuqrtD9ujCbysuWkXm/D6ROuIEtmng=; b=V7S6kfKcHCkpyWBO8hkr4LzUVxFgI8+8xq+eiTg93lhYC8J4vdjpU8VNnQrQ5pHtViETNnsLbICueRt7IfA8slrHTlqMo6GuKtqd1YLQFoehZlZ+rqw0EQbQ0lfZwquGaeTBSJzD3OfINOMm3wE1+9IHm+0mko0pbKSv/g5HFpQ= 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.497.12; Fri, 20 May 2016 10:02:35 +0000 Message-ID: <8737pdqchm.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 37/49] 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: <87lh35rs8w.wl%kuninori.morimoto.gx@renesas.com> References: <87lh35rs8w.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 20 May 2016 10:02:35 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR0101CA0009.jpnprd01.prod.outlook.com (10.168.40.147) To KL1PR06MB1702.apcprd06.prod.outlook.com (10.167.63.16) X-MS-Office365-Filtering-Correlation-Id: 8f8e665e-3ba5-4c9f-0607-08d38095dea8 X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1702; 2:7fRSQgaQDEL56vjqjSmUUttv6kQvK1v/BVwN0t23XmRlPRchIyEmP3V1cdDcurJjRy+xDXJpONs+fI9ipJN0OJ/PnNVN07o4O+lCc6bvJYEhgru84wR0DxesdKbf+AAhBWRMm2xJw8inRyc0lu5vU2ZydpmxYxbSZhQd4PXKrZedNQGMmTZTddp6Zd23Qiwt; 3:0pelY4gCRzqQRiffZBREKsvX47RM9LYwbFVyMz+ycf1jX5de8Rc0lHmO+ZhjEyXL3cQeykM6yaXsFGoFjeCRUdkTrUFPo6u7UbdggYy+TK8eu7Gglfl4yay3F4JhArVZ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR06MB1702; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1702; 25:+gJTQCg/vOCDN12s7KlvCjJIo4sz7L5aAgxtmFwg65qpdlLi/swKc+pZ/FPY5A5by13T/scEi71+BGGdtQ3W8F4mMBuJPQvUig1dnkvUJjLyXKwKtom4Z8Qgl5fV/fsD2qJP8BW4CQ7jDIBASjITJuTI24dgN1LZg9TjwsNY9aLeFttVt62mDRCzzR7Bu4wntPx2C3gIPeAElFab0xdwV9vDntgkMEX2HaYYpWpAi1HOTTQp4zdrkGFOJc1ehua/d2L80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wdB7a1E0NnEagC2pgW3gknqd5LLnT3wP5/xTXWrOu9vPKFl+r3NCMwa68JYaYeK6HF91X5uEYUqzzVFv6lPdoSVUTFaLvKmcND9Szye7U0HeQf7SCngU193uRKis6+1Sdf/vz1DpMqa/oAkccrQq6A7j+Fl/nKxIMqBX/rektpvBKDIBQSWCf8dHi89LeX/wduSs2rk79utCZM8EvUsrGeAvcawb6EpQxOEhPkd82z1OBEBvEoadfWS7+ytgS9MOtDzX7rMf83eBmKynOIL68u25s0PwcJEhPl8bhPOu9Z2SRfqNKNCJMVlvAr1qYi4ZOUKI2CPCQASgAPQzy0A== 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:KL1PR06MB1702; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1702; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(47776003)(5008740100001)(66066001)(189998001)(53416004)(2950100001)(77096005)(86362001)(50466002)(33646002)(46406003)(2906002)(4326007)(110136002)(5004730100002)(92566002)(19580395003)(19580405001)(36756003)(23726003)(83506001)(6116002)(3846002)(586003)(54356999)(42186005)(76176999)(229853001)(50986999)(81166006)(8676002)(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: 1; KL1PR06MB1702; 23:bjfFYGU621u7N1opMsp3mIv5IZNvfFmuE01RcJq6weHHL7NzEnCPYItACvUqsohykGqPlOkFoGOlre4umYka06HXvq6VTPqCA9IHyHfdqcMtnweIqaLU5gkh0YtMcVOx29qfj4cgUrsGp8EM8Sxnxrv36EASYSikW+2Wuv+SD+ha5AFneZJJ/cQsTpIwWJqNJ1YLoP+Lw8jiHYZ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9K8wZzZoDz9cAdD42TjY/wrmx+r1LrO72QpOyy/7pC3+5EXSrXE+gfuN/k+hcpKHCIcBtjQ7GfYCgLuLeWM+SW+Zxe809f/COLZCj8eFhjsX8sDe0dPAlESwBn+n5iIZDYE0EVrd5RKAyyvOWZYHShS+twdicTC/; 20:8ulsRyacOgTqj17mNKDb5/Gzy3YkGTzpJIJSfXaS+Ifg4uSKmb5xp+MSnre+FXBwGk3uWp9S7sEWYe0zb4Y3azr3Bus6Yz0N3JsUlcpIh/8v63ejYcvyISLYy9cuNu0AFZgGmnPLcNwywuPVcq+RpMgDKEHx8jb0pNZVThLKmEc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 10:02:35.7313 (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 f61eff9..87f96e8 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -59,6 +59,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; @@ -152,18 +155,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, @@ -182,9 +176,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); @@ -200,7 +195,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; @@ -215,8 +210,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;