From patchwork Tue May 31 09:04:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143875 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 5173C60757 for ; Tue, 31 May 2016 09:04:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4551B27BF1 for ; Tue, 31 May 2016 09:04:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3841E28185; Tue, 31 May 2016 09:04:25 +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 98EFF27BF1 for ; Tue, 31 May 2016 09:04:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756702AbcEaJEY (ORCPT ); Tue, 31 May 2016 05:04:24 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:65156 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756598AbcEaJEW (ORCPT ); Tue, 31 May 2016 05:04:22 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 31 May 2016 18:04:21 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 360345029E; Tue, 31 May 2016 18:04:21 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 39D721806F; Tue, 31 May 2016 18:04:21 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 32FFA1800A; Tue, 31 May 2016 18:04:21 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id UAM09493; Tue, 31 May 2016 18:04:21 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="212431876" Received: from mail-sg2apc01lp0239.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.239]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:04:20 +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=4kFBeV00X1t2VQPPozI7ABHPwRHQ9XXEQ4F8cUxUi/s=; b=YoKWp046n7alUzfZEAOijN8b2ywFdo96+3XmA1XreczMp3i41Ui/eEecakuoV0ciJQhB+FTqbhgqgPoQGMfa4JLReb6WrEeH0ec+9BJFR4dRQTAHzf4pAuPSGVxKSvThA+B+fZ3KrOv32UuFDchBkc1z9g9KZAi8toSrKoH4L/o= 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 HK2PR06MB1698.apcprd06.prod.outlook.com (10.167.73.12) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 09:04:17 +0000 Message-ID: <87wpmar4du.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 13/39 v2] ASoC: simple-card-utils: add asoc_simple_card_canonicalize_cpu() 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:04:17 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0028.jpnprd01.prod.outlook.com (10.165.48.138) To HK2PR06MB1698.apcprd06.prod.outlook.com (10.167.73.12) X-MS-Office365-Filtering-Correlation-Id: f724b193-0bfa-4d1c-461e-08d389328c13 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1698; 2:/v6FYUWZw8IgsMgrPTpC5CV6N4jJDa5dRUSiYfq5DO1tpqUZ6RuyBIxenq1slCilI4D/LkzVCxo2pbornHIJW/kXK9ytj0fNB7i2xgJkgI/2R5rJyZ3T4XNQhSFbKXasZS+ZySKto0Fg7mF+gTBwkS6G1E2mipET6BGy1LyJblTYsYTkRpUoEkkMxcKvlt0+; 3:KXCYxXZxCLPfYhts378ROkYlgAoj4bwPxNlyrIOZpl4b4Jm4JZDKF4x+SBOnQRZXFrnBwazQ6HPvhbGiVtJZBCvNUF88uV20zog1AaL1mGbMGS+YKoiLK8/h0LBNxmHC X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1698; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1698; 25:aD8ZjT5evFknrSds+lZs58YftON5clCbmb70qLYblvLMv5aXBJJIIUa3JdS60Alrpg47r+vklw061X2w0gayyrNd2Wi422uo+DUdlMDsMMQAo9yhdCJPKq1BvJocmsXHLrnPjDq0j/KfpZ98VXWecEZ4u55Bo/MtF5HfmQ8oeeZD0romwS+FSJM2v6zEeDb/JvV+0GNgyO629rM45yQMK7Dp+Etavstp2XnqGrpRacAVzawLJHlLrXilfkjA+U5iY6/q7sRKB74/M4zfXrzIaCqZ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wY0BzBEPiDuAa7X+PVBqeI+536mPuHcjsk513B8EG/xdiqCd6YtgoPfHUVn0eV8KwC+/IloTu+W31xdyVWdWTLdFmyRePRve1rbxnMKigz4u8qt9F4+/y4AUzmtye8jEguvMnJDTRGs29QYGpNwvtFC6cJIIcOjAZWegwdAPxU5oKxkIxOHW6lS9AC3SMR1N6lpxVq9bhiJfLg/Xhv0iiqGrqt0OEl08rGhZEwnN7ilQkWHx46MM92hTttCH0E+XvYr51rDxgRiys4QpiFQKYImDIkgmj2sYiqZ4NuO4ocASxSII1MQt3+9/moMA== 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:HK2PR06MB1698; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1698; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(4326007)(110136002)(54356999)(50986999)(76176999)(3846002)(2906002)(23726003)(77096005)(230783001)(50466002)(6116002)(47776003)(5004730100002)(586003)(86362001)(4001350100001)(5008740100001)(42186005)(2950100001)(53416004)(66066001)(36756003)(229853001)(8676002)(19580395003)(19580405001)(81166006)(46406003)(33646002)(92566002)(189998001)(83506001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1698; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB1698; 23:8sqROJxqxGcuxZV4DjprAT7ps+ujCf9G1APf5FP6I?= =?us-ascii?Q?gDdaHvrmnFvLrAd5M2BMpwzE6I86exW9fkhElbOP1c4oJUYqTRG/r9xaqiwv?= =?us-ascii?Q?oruf4fZXryUrgztAuncljlM8hzkPr0SVGQHjZ/86blVbgX8Ad2Z7ZOcZJi3K?= =?us-ascii?Q?2rai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06MB1698; 5:k5nl9gSzKM2VOVwDK+Ub7tHWeTRkeEjln74OHmGKu3LhYmeVyXaVrwg1ZZhrhkou8gjhbyfDA/68xaFknmPldEwcGWPOw3PymysCeK1yVPiNr+WWI/pu+yJqWMjnzTEG1yQTa94jW998kcrQZqwnqw==; 24:UINMl0xPKWNuhIBETbWtim9m2oSZHnmH+HzM0xRk/gCqLC32O72ynJQmSLBF+vIqCvA70JpYPWbMcglRvLgb3AUdj4zFac65FSj/SFFQvVI=; 7:bZnEFtwLvPfycDm8/hxXlbMnwHtp+reHCTt35PsmeiaJrnd2zDR9DZeRtwWZF4OLupLan8SerQBLWInL1PvphYlrbaR/xw/BoSFPUA4SdsX9Hb8mS6d7wnMtDDnBeG0SBmDJGHaa+avPB4wDetdONr4YH8+W5CnzLdhjpyVLkKITwf+OgHIa+D2H0N2ph6VU; 20:c4sCH66LdBAG77hpE13Eow+MSpNBwWDtSuZXgr+1aTtOdCWZW265qgQinWPO6V50ti/ZSVymDLej8/6Dmwbov/UC88F27mJlI26qQxa//6ZKM7cH7SMgdxUpg3FGMf/Y19s73vpnoK9kR+wCBIpDihbkyju2ARhSscl6Rck/OlI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:04:17.6127 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1698 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 simple-card needs remove dai_link->cpu_dai_name if it CPU was single DAI. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 2 ++ sound/soc/generic/simple-card-utils.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index d5d88bb..7846467 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -69,5 +69,7 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai, struct asoc_simple_dai *simple_dai); int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link); +int asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, + int is_single_links); #endif /* __SIMPLE_CARD_CORE_H */ diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 2524f21..b8977ca 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -252,3 +252,22 @@ int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link) return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_canonicalize_dailink); + +int asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, + int is_single_links) +{ + /* + * In soc_bind_dai_link() will check cpu name after + * of_node matching if dai_link has cpu_dai_name. + * but, it will never match if name was created by + * fmt_single_name() remove cpu_dai_name if cpu_args + * was 0. See: + * fmt_single_name() + * fmt_multiple_name() + */ + if (is_single_links) + dai_link->cpu_dai_name = NULL; + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_canonicalize_cpu);