From patchwork Thu Jun 30 06:04:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9206661 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 C4131607D6 for ; Thu, 30 Jun 2016 06:05:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3E152860B for ; Thu, 30 Jun 2016 06:05:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A59682865A; Thu, 30 Jun 2016 06:05:02 +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 5FED32860B for ; Thu, 30 Jun 2016 06:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751830AbcF3GEz (ORCPT ); Thu, 30 Jun 2016 02:04:55 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:41644 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751827AbcF3GEy (ORCPT ); Thu, 30 Jun 2016 02:04:54 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 30 Jun 2016 15:04:46 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id CDB6E49B4B; Thu, 30 Jun 2016 15:04:46 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id C7E068002E; Thu, 30 Jun 2016 15:04:46 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id B7CD78002D; Thu, 30 Jun 2016 15:04:46 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id RAX17687; Thu, 30 Jun 2016 15:04:46 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214579559" Received: from mail-sg2apc01lp0242.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.242]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 30 Jun 2016 15:04:45 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=licd6GltWtD/VKfFoSUVb0J4gpF1E39b8ToO3cn9oqI=; b=GhzRDlgJKbjHIUDSMKsXLekTv2bHL7L7bN/w7u00UNrKPbixMAaGYEvHBROVhsiUChTAf832IIFVapkUIPL+T2qiuqAns6X2jbq1WcNpLuPqjcVtwdWfjZCGYKK3lHoc3lr+JLN7bcglgsuqQiVTB2B9AH9CoR3pHIUDRHgCZRk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) with Microsoft SMTP Server (TLS) id 15.1.528.16; Thu, 30 Jun 2016 06:04:43 +0000 Message-ID: <87poqz9q23.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/6] ASoC: rsrc-card: use asoc_simple_card_parse_dailink_name() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87wpl79q79.wl%kuninori.morimoto.gx@renesas.com> References: <87wpl79q79.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 30 Jun 2016 06:04:43 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR0201CA0030.apcprd02.prod.outlook.com (10.164.90.168) To KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) X-MS-Office365-Filtering-Correlation-Id: f29e85d5-1d3e-4656-15f8-08d3a0ac6e8d X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 2:Wc/HLmoHkWUkbrs/Uz0TUgZ6ZDjXbRz64Roa78+0MDxqaUgx3BcayMVf8TnzlhwHjp2FiFUOjsnp6PFHhJvSKd82hQyBlYw0jF/YmkOLkxt1/A5vOXt7nWaNRBRbT/c6uOzBoQeIaxZyqWk7aKYOipX8PfxOS2oTdLUW6MA84QPaJ89+SPgHjJ8KtvfUVjhb; 3:KnKKwQJ/I1Swe0GNAUS8sHThHd3pBuov5k2PcSbpIDv1ZtxTuyJYgaRAd1dqc6r77f5jzvrA9APe8hs1FQxFvdhoBOK/2r3Mg3OzNjlQCX3AwMDdKTCh2fywumHNj6de X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR06MB1704; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 25:8tJR7HtZwPygAlxcT454ULLa0CIoMxvLk1evqk8fwlUPS6ofX3NQJ1jUMaT1nbLeIb/HyLHI/s1hOkSjKLd9w2ngzvuS3diq8rNlN0Uzegc5PrVbD2i+cXWwQ12286gJw0iF8HErB7P727ppXEwOOdO9poHK/XsqmdxiJd2QnguQS5GneEBzK6xGyrl4fw6SVl6y2jZODaqR9RkJ3h+UceXBVGeuRWNVTdw12h9Y2kI5SvDtZgR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nm5EYzGgFJokXE2KDiniwKOCwTiauqn/RMi0ZF6sXgN8qMzeHetWdV1b0IAv+YJvEnYJ11h4vHm862F54j92T1XTCp2Awu/uAkUeW+BWIDnHFzwsD2/3epilvnQLFnli59W0Xsmg4Q6OeOpZHf2ypLmiQDmwNhYOIB3EHhqMyIpx2B4l0LI+nCh; 4:vstnJm7X7a8Thxdlg6NDrQoaRPTILSorbdcuSWRllbkHR+vbA7h06QEicBm4/bYgaqRT9Fjglb7X+dMwkOv+8YUxR5xJGOPkCrWBL4YeihHnCi0uHB2QOYdaCDRl0Cojhfwk/07gPRp+E6Bn+GiPuqkFeffDxvQjpqUnEMEXp0sfq4RFYuukd85o4sl+XdBZVbvkArLb1HfEp762EpFjqaRKAIIfCpSI7ihyk/tmisE2PhZkyMQG5TrI0ezEaIJOYMUt/f1DPFWpW/g05vvity5QvVnN3xro+SsdZWtmQ93mDtqcezesojPh7xnB3rWs3H/di7/LaEh/1sGdCqy6x+le5SJzi8PeFwPeC3m76Z9labHVIW8RZu7YRcWEywX99SMobKHm1+KMpp85MsWnsg== 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:KL1PR06MB1704; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1704; X-Forefront-PRVS: 0989A7979C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(47776003)(23726003)(189998001)(97736004)(7736002)(50466002)(54356999)(76176999)(101416001)(50986999)(7846002)(305945005)(19580405001)(19580395003)(2950100001)(66066001)(77096005)(4001350100001)(36756003)(110136002)(4326007)(69596002)(105586002)(42186005)(92566002)(8676002)(106356001)(53416004)(2906002)(68736007)(33646002)(6116002)(3846002)(586003)(46406003)(86362001)(83506001)(229853001)(81166006)(81156014)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1704; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR06MB1704; 23:YV6fSJ3evFd4x6tdSJkleqlQU/F4uIVeHQGNFNE14?= =?us-ascii?Q?XYani5+uuU88PjxmmaOsTtSaXY/f9s1C1d4zjYp6/TBOywj64petLVCZpv3O?= =?us-ascii?Q?KLkf9dqZroGT71j1owX5LDDTgXj3kkBjScXbG1nZc0X4yRN051G+g6yRKTy6?= =?us-ascii?Q?9eSPM9kXiIaNbdp+iB6S72a2sS7iPBVTkCR7e/ufUbi/AHG+hRsI9xuUfI9v?= =?us-ascii?Q?7BF3dMeP1Ls1pwquodRr6k8VWpREExy4Hv/B6RxsBzvbx5E1ASU9UOkeSiAZ?= =?us-ascii?Q?ELJQxqSikKLsfSL/m2G8WW9Pzek5ehBNieQDNNqgivHqsMddnKZAmq0FmfSz?= =?us-ascii?Q?MgiZoi6wZ6i/VaOovd7P4v5oXoLWJzcjFzLBMVYAPVWkzjo2WiWoDTEdsN6D?= =?us-ascii?Q?GocRXgTXoeU227xG9vXA8L8z0rXW8EoC53xoP8SCETuC8NVhzr29Z5rXOi3l?= =?us-ascii?Q?otYnln81E9YKE8ohzi7/E5vS+Ik3cKS0EqZ4r3g1TXLGlsLbNiSGdBrqkn8t?= =?us-ascii?Q?Jg7pIbIxW9y0nJB3kqmVnUDzW/Q84/4pM9G5OMz/oeGYjMQZ9wJ/LQ5xclmc?= =?us-ascii?Q?RaTpSsVqImzqPA95WFrQJLiVcNS9Sa/F2T+E/UMf7tHGCnVv57G74UfhQkdb?= =?us-ascii?Q?mFk3kVQGnzHZSY86Hybp1Tf/T3hEsKn/3hEm2WhqF/wEnDMus779U+RaRf/E?= =?us-ascii?Q?MXMsCoeg3VmOV3k7FtoSxfOcCk1aN4lJ/GN6c8E1RACHK2ZsbL9FkicltwMF?= =?us-ascii?Q?j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vst1WkKErx0SB8McyYeb0od2lh+MCFoRH2YWt/NAnzA3dVIlhsuLc3zq54x4lU142PU+Zo2ohaGo=; 7:BV3Xdgb/GcQ6qdSQgi8b4MSq6I2F3wTg/TBCCtIZHNg43OSxmDmiL/LtQYoQL0kWQqxvhuNtdU4YwGtDAHyCqm3K9MuNODVHJI0z8nUtKwbfmXB+szFcRiezagngkepD6LUB2HZQYywsWY3Kuaa+kwqKyEOmGH3rkyWhUuNk1riSCd77qJBrrszcQj+vqGaiwKMCh8xU5rdZwBqyOhSawFx3Gn/+MB8I8AhR3OooqghViCp/ZAj4bYgwTJoS2Obo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 20:qdsFzJiz5Dy7EVIBKLdpPDi9adpne8Mc+TWzxC6MsjwL2u0MdJwR8bHO5gMW7VXJZmGl//kQR2f83CFj0qF14w5zUA38P07hF/8dSJWCm6iU8aXcdDFSXutDCbK7hoVh4Fa3NeBJqqwgjQ6B3xZJY/4qSVbZMxHSBCSJUmsg8KM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2016 06:04:43.2675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1704 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 | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index c065a6d..aad8f8c 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -47,7 +47,6 @@ static const struct of_device_id rsrc_card_of_match[] = { }; MODULE_DEVICE_TABLE(of, rsrc_card_of_match); -#define DAI_NAME_NUM 32 struct rsrc_card_dai { unsigned int sysclk; unsigned int tx_slot_mask; @@ -55,7 +54,7 @@ struct rsrc_card_dai { int slots; int slot_width; struct clk *clk; - char dai_name[DAI_NAME_NUM]; + const char *name; }; #define IDX_CPU 0 @@ -163,6 +162,7 @@ static int rsrc_card_parse_links(struct device_node *np, struct rsrc_card_priv *priv, int idx, bool is_fe) { + struct device *dev = rsrc_priv_to_dev(priv); struct snd_soc_dai_link *dai_link = rsrc_priv_to_link(priv, idx); struct rsrc_card_dai *dai_props = rsrc_priv_to_props(priv, idx); struct of_phandle_args args; @@ -200,10 +200,6 @@ static int rsrc_card_parse_links(struct device_node *np, if (ret < 0) return ret; - /* set dai_name */ - snprintf(dai_props->dai_name, DAI_NAME_NUM, "fe.%s", - dai_link->cpu_dai_name); - /* * In soc_bind_dai_link() will check cpu name after * of_node matching if dai_link has cpu_dai_name. @@ -216,7 +212,6 @@ static int rsrc_card_parse_links(struct device_node *np, if (!args.args_count) dai_link->cpu_dai_name = NULL; } else { - struct device *dev = rsrc_priv_to_dev(priv); const struct rsrc_card_of_data *of_data; of_data = of_device_get_match_data(dev); @@ -244,18 +239,16 @@ static int rsrc_card_parse_links(struct device_node *np, dai_link->codec_of_node, "audio-prefix"); } - - /* set dai_name */ - snprintf(dai_props->dai_name, DAI_NAME_NUM, "be.%s", - dai_link->codec_dai_name); } + ret = asoc_simple_card_parse_dailink_name(dev, dai_link); + if (ret < 0) + return ret; + /* Simple Card assumes platform == cpu */ dai_link->platform_of_node = dai_link->cpu_of_node; dai_link->dpcm_playback = 1; dai_link->dpcm_capture = 1; - dai_link->name = dai_props->dai_name; - dai_link->stream_name = dai_props->dai_name; dai_link->ops = &rsrc_card_ops; dai_link->init = rsrc_card_dai_init; @@ -316,7 +309,7 @@ static int rsrc_card_dai_sub_link_of(struct device_node *node, return ret; dev_dbg(dev, "\t%s / %04x / %d\n", - dai_props->dai_name, + dai_link->name, dai_link->dai_fmt, dai_props->sysclk);