From patchwork Fri May 20 09:49:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129467 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 5A07A60467 for ; Fri, 20 May 2016 13:13:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4355C27BF1 for ; Fri, 20 May 2016 13:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3812D27BFE; Fri, 20 May 2016 13:13:55 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8B4127BF1 for ; Fri, 20 May 2016 13:13:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 776AA266AD6; Fri, 20 May 2016 15:13:52 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DAB7A266B1A; Fri, 20 May 2016 12:40:26 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5D18D266B1B; Fri, 20 May 2016 12:40:25 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 5F1B0266B1A for ; Fri, 20 May 2016 11:49:39 +0200 (CEST) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 20 May 2016 18:49:37 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id ED7DA52BC0; Fri, 20 May 2016 18:49:37 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id D0E3D8002F; Fri, 20 May 2016 18:49:37 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id CC6D58002D; Fri, 20 May 2016 18:49:37 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id UAN10772; Fri, 20 May 2016 18:49:37 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211713888" Received: from mail-pu1apc01lp0019.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.19]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:49:36 +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=R1HYa3LkkSDBe2N6vDsyHCiUCDzNlWeV8sQu+qbhRNM=; b=dU660ayrFYVRqwYpgoyCP+lHEcEWI54vFS/R8M5Vjokj9NTrvzKsWvNl1INisTtilFY96n5g/TjDQgRMRLuGxk6+vWHBYXVTPIHUnO3OAE1WtscxCgvdf1Z0t1OWTNByLSAmmKCXn79uT3mnc01bEGu76vUWFifkZC9d5tEfgnI= 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 KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:49:34 +0000 Message-ID: <87wpmpqd3a.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown 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 09:49:34 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0089.jpnprd01.prod.outlook.com (10.167.153.177) To KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) X-MS-Office365-Filtering-Correlation-Id: 91c5a2d5-f2d2-4514-88d9-08d380940cb7 X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 2:dtp+QpiRnChV1nZTlZKzEIxxnhTYfVEk5CTToW2c4CI5CAoHL7/AsKe+zsCi1cAtsAM8neE3IeOuKIAMNMs3fjgXIuLVJ8DdXNWVCSqAF/YSR5OH4BkDQo+vnX1/J9HUttZ72+cbMVXwRGIzSvkd2JFEAzPGesSoXJMSVGa/2urHf0Vx0ZrpcebpElXqdTtO; 3:rVDnt26LfWbCMhEBVyIP7iNTD8drpq9tXxXzwokqiemVE4C4xYYjP1IY5qk7gI41Kd+NrOnLdPAUp8Qk+Ga5O6Tf5Couz2HUE5Sa0NQMKmJPoFGStsrsLXapW7Z81YvV X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR06MB1704; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 25:GD2bRe6O4SSiHdQJhJdkHl0zT67nRpLDqJ0K7cK0oQvvqLwcCY4Msv0gm/6yxvqMNxqGOqaOV2zaXjZ3OxGbYBWYe6ZOM+y5IhUPwsDo+tMdm6JI0bTcn7snKF+6RStGMiLHkW52ZHa9k47BJa7WUGhyETpZUbmDn9UTbST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U6RKvMQImouVKonQRhD5g1zAbU2KaLn2vAzksUjvWn; 4:D0CiIPReI4uRmTJJdNIEwnd6GPfy7F6ohHvvufBTFkjAIAcdL359Ho0naKNZHIw2xx7/BGyicvkcYJB7nijJyiOaJo9w9BbubCQGUWk4UFukhoW4mMA9b1zVbaTRs9qqrE2Whh8AwKysVpz757r9b4GDBOBDRJgjT/PBkPuvLVlJt2wNisnS8zsexmPAOgML+UFT5oEnEkaRMOVFPpA7+i/dqYb4b6F6ZsPkye2caVdIn+WSIrt0MmAdPmtpyiGhjFxXlIEVx0AhJaNjW2YjCqK//7eLMYARagmAqPj+5cHq5+bvym542bWOuZbwEIxBvrMTot6jKU/CIw5/fzYFhUxjqY5uvHbT31lZ8/3Z0n5e4mG/7qTFWkzYbvgCRws1 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: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(2906002)(42186005)(33646002)(50466002)(4326007)(189998001)(46406003)(230783001)(3846002)(83506001)(19580395003)(53416004)(19580405001)(81166006)(92566002)(54356999)(76176999)(586003)(6116002)(110136002)(50986999)(23726003)(229853001)(5008740100001)(8676002)(36756003)(66066001)(2950100001)(47776003)(86362001)(77096005)(5004730100002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1704; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 23:zzGymYVz+6e7Jz2rs77U5aeP+s1zpUfm2UN6Dy33A56uMbIm+JecngwyYtWrYzHyh1fxZ7S5hbpZjqpp/YFkQlm+iyUL3RgZSr2J2OgCfDTKjH1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Vx28EhsL3w5kwqTQAK6L1Hx1dpttV3xlSGJTBpz3JMFNHcoATQ4hG/U=; 7:tCzXO8sBpRVbKywCqBUbHpdKA0JLs+YiHJULXGJAVkg7wmdJOrZZhzbrFzmK5osoL2LjAFm3HHYUvWqbiIeR9c8HIlne8h/91eSotkGdG1wNCtXEgdJ8u7tzErQSXJ6x84LLtCC8czgIoSJn1Foy7932Btc5IeCm+ydnrf7C8DBGrL5BnsJdVOCOGHWS7OZA; 20:4SuSc+U+ZPMkPE+rL/sPbJMcau5HJOJJgBvlCP5vb2LFMaeYlvWCIru1FIDDh/05QnYf80iZ7sPGp9jgHMvvJCEeLOtKwBcMomwOzQqMpqrlTDbbF05UoPG3267N/g4+5xDdtfKD8ZK3lN3pEqf1+ep/3J8YLjTMFoDA2v0i9QA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:49:34.0147 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1704 Cc: linux-renesas-soc@vger.kernel.org, Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 17/49] ASoC: simple-card-core: add asoc_simple_card_canonicalize_dailink() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto simple-card is assuming that sometimes platform and cpu are same. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_core.h | 2 ++ sound/soc/generic/simple-card-core.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index 9146825..2db9de8 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.h @@ -97,4 +97,6 @@ void asoc_simple_card_remove_jack(struct asoc_simple_jack *sjack); 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); + #endif /* __SIMPLE_CARD_CORE_H */ diff --git a/sound/soc/generic/simple-card-core.c b/sound/soc/generic/simple-card-core.c index cc638e9..5c2ea50 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.c @@ -360,3 +360,16 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai, return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_init_dai); + +int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link) +{ + if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name) + return -EINVAL; + + /* Assumes platform == cpu */ + if (!dai_link->platform_of_node) + dai_link->platform_of_node = dai_link->cpu_of_node; + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_canonicalize_dailink);