From patchwork Tue May 31 09:03:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143873 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 1322D60757 for ; Tue, 31 May 2016 09:03:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 073CA27BF1 for ; Tue, 31 May 2016 09:03:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F077228185; Tue, 31 May 2016 09:03:57 +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 954AA27BF1 for ; Tue, 31 May 2016 09:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756452AbcEaJD5 (ORCPT ); Tue, 31 May 2016 05:03:57 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:31150 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755920AbcEaJD4 (ORCPT ); Tue, 31 May 2016 05:03:56 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 31 May 2016 18:03:54 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 0F63350275; Tue, 31 May 2016 18:03:54 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 129392806E; Tue, 31 May 2016 18:03:54 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 0AE2F2806D; Tue, 31 May 2016 18:03:54 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id UBZ11194; Tue, 31 May 2016 18:03:54 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211980548" Received: from mail-sg2apc01lp0246.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.246]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:03:53 +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=vK7ny6DJoP0UcrQ4dFKpqSscYXvl0+ieUcD11r5RNYs=; b=Wm0GamfRMRdb4yUVd4hisiO9tLsUo5YMJEQZ7xS7fwjxdI4BHByz91tdAA+xiR/2Q64QxZoR22oB+PC1TGuq8h8rkB46hRAfj39LlL6T2bJ48Icu0dnJi43vjnHgYYx34/IhJnr4rk7hvakyjHipn263D7vmVjsZ/wfUSNKJi8Q= 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:03:50 +0000 Message-ID: <87y46qr4ei.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 12/39 v2] ASoC: simple-card-utils: add asoc_simple_card_canonicalize_dailink() 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:03:50 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR0101CA0020.jpnprd01.prod.outlook.com (10.168.40.158) To HK2PR06MB1698.apcprd06.prod.outlook.com (10.167.73.12) X-MS-Office365-Filtering-Correlation-Id: 8517d2f6-47ad-49ee-4a51-08d389327bfb X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1698; 2:W3awhDzblpgDo3zRldtvKWCWPteSKNigJEsZICf3+OwuhYq/U61cIJCpqBmbjmRDRJZeedr8JePivc1QTjJ8XYdzXkiTO6O5J6K7iHe3WMVIXZPKpXIcNWJ+fY4gmYO4P0RV0Mw7tRlDSBCZn4rgUSXOaueyjU1VVnHTUWOWUxuEaT+Ire03ZIIqYXlsQSpl; 3:YfA9i/xOYGmxL3xCCDlNaTU/BPHPbWOMgXlRwyxn/sCRV3VhAJscY+g5Zu1Lh2f/jVqoRAn2FvEwpKQoQz6wu7E2bJpuMKalW4R3JtQE6ebE/LjaMe8cuaTM1l8IRioi; 25:Av0Do2J1PJtC62UL7f+o7RfHNnlFVdn2vCVOnR7ceWsdUrbO5iCiTY7toERwS5a8RfN8vmCScieP63ATFX62EaigfYd8Ca9MYiIC8YPgBOO/J5erPn23EB3cSN43eem9N3h3CIQgSJEwLSV9x5bkgyMzOiDr9Uw0q8J5tqH0TDnu0pzc7JIwOM8qGrvuzyy+vcFxG67KVM+IWVCobB6juAwchFCbZwqG6SshxkeZLlaDDELUNBokUy1/5FReNz4C6F6gcSPIyhgMK/aqXK+gcQ+1ASdv4nCj5N1LAGpDKSGTyV5T7MxxwjaEv1/zwGWeFYFEZ8932Y8UkHS8aO8gWo4dR27K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a2dYE95CyA== 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:RqggdKyD1l+AqVsM/sZ34KRI6ykv9KDsEf3CgHIRq?= =?us-ascii?Q?2vZd1qyvIfzf2thN7e4AXe57P8EdgTBrACbue2B6DduZ/Q1bAMfiPbEf15zq?= =?us-ascii?Q?zv7W0JRVoay9fHNm29o7RRvr+vX0hX9U2q0eCHQuceE8o1ygjzp/a1ynTpoB?= =?us-ascii?Q?oKDIqBLyYw+J0tnTWY7RuuxERf1kMiSVY4DVzoHO7v8T0jSZCXaPbEt4s2lE?= =?us-ascii?Q?tIMQbfttwaMEnhec5S4rLBckzUxF1GY2XMp9wzlVsawuF8slEoVzjvvEm/0H?= =?us-ascii?Q?2yFOI1Q4/xcwOnwmXEeaGLB3nt8yCuEnfIEvDNqZK4eS+nogyWoWZCSgtGMo?= =?us-ascii?Q?Iju9WeK91U+f/tFmblxrwiqNC9pKJAGTNEgs3j/GKn8yUn/0bdhfWeslD7Ij?= =?us-ascii?Q?JXVG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wCFp6s48DFp1unYGJxcJiSlxgEv1cjRFrG+4I7P1+AqoeaR0ggGvwyUdTVHxh3qoautAcoqtvaqOFcVzA+6tvovZMOzfOUs2B2TEBVN3lt+QBwJGY4HNyQ4uGSUpIeXULZbR/sbl6KvPiL/cU0OHFT9m8F5T4czvxM; 20:z3l6rYjOMxYeDuNoxgOVespaZHHsEhBMc3Kw5AdCBmIM0WNH2OHqEaTbMXsEubeF09h/HUL6up0qnBYKdt/apDCwCdQhFaADGEgWukXuu21MNoxyKkYKAbFjhtkv79IVN1rXW/2GDZM9XENkh4hhiCn36AxnnyqemRwahTKMVuI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:03:50.6589 (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 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_utils.h | 3 +++ sound/soc/generic/simple-card-utils.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 289e61d..d5d88bb 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -67,4 +67,7 @@ int asoc_simple_card_parse_endpoint(struct device_node *port_np, 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-utils.c b/sound/soc/generic/simple-card-utils.c index 4f434c4..2524f21 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -239,3 +239,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);