From patchwork Fri May 20 09:50:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129061 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 1213460762 for ; Fri, 20 May 2016 09:50:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02B831FF6C for ; Fri, 20 May 2016 09:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8C7A25D91; Fri, 20 May 2016 09:50:10 +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 84E591FF6C for ; Fri, 20 May 2016 09:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932812AbcETJuK (ORCPT ); Fri, 20 May 2016 05:50:10 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:41822 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932604AbcETJuI (ORCPT ); Fri, 20 May 2016 05:50:08 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 20 May 2016 18:50:06 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 7883252C9B; Fri, 20 May 2016 18:50:06 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 5DEFC1806F; Fri, 20 May 2016 18:50:06 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 58A121800A; Fri, 20 May 2016 18:50:06 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id UAD02123; Fri, 20 May 2016 18:50:06 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211272863" Received: from mail-pu1apc01lp0024.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.24]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:50:03 +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=1mBhxCx35NFftbVs0res+ZaYp9RMp+V9vedo//u/hsc=; b=b+sSxHa4gT/mkMwJLTiOg58J70h7kuvKo5VTp6WUUbQmqiKc1BWTe6u2WMjsoYFgMV83IDKhBAvyd2Vh+78PkvI6PhnCrrT8t8amjwBI0/wCGVCYcG23ysHF+zpXnS78oJxC+tjqOCSXnCqmEKSbBaA9EZG+WoNgR0fX8vpXOvc= 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 PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) with Microsoft SMTP Server (TLS) id 15.1.501.7; Fri, 20 May 2016 09:50:01 +0000 Message-ID: <87vb29qd2j.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 18/49] ASoC: simple-card-core: 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: <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:50:01 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0065.jpnprd01.prod.outlook.com (10.165.51.153) To PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) X-MS-Office365-Filtering-Correlation-Id: 441f507a-c662-45f2-c909-08d380941cf6 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 2:V8VVf4MxjaN/JJXr4gDzeHEh3Bmcl+WgSz+oxaV4NWORYM7xqnIZ9F+ukN0x/vijxIEwnjldgJPuJWs3ZKqpZMtMz22T4vMVmrVvFZ5CFQbA0CdLggKjTU6xObD09oY4FUgn1eSCvkFKdql5/OdIzdRynrSnDztrMVrspkvBKijtm6RpK89Eac/ZGMSwsRrT; 3:LBIOiY28TMMlIv6HdZz8Ufym39NUQuxueWZNuKgJ9bJ3W3nwFpIuwnDJ0kMueMLajBWuO4up8lg06eZn4VxsVj/q6FlAudvHNmHloos3yBejwrb8Enj4BGJIkQXuU28F; 25:+VwetP3WIsez9kz7Lz0GWX3qXzOPtzkfETNJyiO7F5wdWo7mXlABeQQ1rKVf0bl9Hh4YI1zsWNkJROMPovLnogmc2IYBN0oCv7hqCCsN/8yL7uGYHVNDYBm8I8O0cg6TbcDbKwL2Ykz1XB9r0grBJ7ad4gWtV3v5Btp0TxolloQcKM1IrcHX5hBdSDg3+6KF/jpoc+s89y6h3v9lBpZ0LWe+ibskdCJeRhytHJvIW5v4j/dbh/JG/zULYo+T42REOdXtIrlEOHfueJnOdq6Z8nhkMeFqvooVoJBPhlr9HDLnBtbp5WwsoZmR6p6wINNTxfYUeJpbm5qcSz3keoqmFj/y77+TI4kpwMVod0eoynG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== 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:PS1PR06MB1705; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1705; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(6009001)(46406003)(4326007)(5004730100002)(5008740100001)(229853001)(83506001)(33646002)(23726003)(2906002)(3846002)(6116002)(50466002)(586003)(230783001)(66066001)(47776003)(36756003)(4001350100001)(2950100001)(81166006)(53416004)(8676002)(77096005)(42186005)(110136002)(189998001)(92566002)(86362001)(19580405001)(19580395003)(54356999)(76176999)(50986999)(16060500001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1705; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1705; 23:+QhsdG0xTguuuuApGQYvmpeRbw8HvuDEKTKVONjxW?= =?us-ascii?Q?Gs+2K2fwVcvktbHSVGGDwKUk0eqP5wMP7kOck/2gAjufaYzfUhr7BqVX8Gjc?= =?us-ascii?Q?44OP13iLBoXzZVxXEIJ7wZNDcx/wMbSuAdLOAu0gMHkpyWE9OKIi8D63PyVY?= =?us-ascii?Q?/qCBpt6o11GkwoxvA14ivcGjvjBimRfjMxcsEr2G9wbouU4RBkaiIwZJ1jpu?= =?us-ascii?Q?uy0PlOrQuURG69IzMz3a3+6khhpiaTUqH9spCsswfCGaDqceDubzQiFKvt8Z?= =?us-ascii?Q?OB9E73JhM9Q9EBNyDy1j5jOsge0O+YqdtLqhMw4Ukki5ZXJpCTDa3myQ/RAX?= =?us-ascii?Q?waGEfb2yrFjNPSCvyOKUKagjZpLsZp1Tdx1psI4cadr9Tp+Veh3nx5+x5c7V?= =?us-ascii?Q?lr3vAj/PmqgxrhNUtwMsMPio0+43ULlc10Dvcm6F/83oW9aznj1p+dsu2s9E?= =?us-ascii?Q?wTmVjrZvRWr0F9zSPstOfTyWL0u0G+xcOP2DMVUK5wI8LjcnqEwAdGbFBx0A?= =?us-ascii?Q?N0hrSjriz/8jkoId+hp7wiYAazt39r1sAnBQl8Vc42lqNhInGnL3WbLYmz9T?= =?us-ascii?Q?lplGCBh7HTHr5BuLcNaab/NPFj75DbFirfaukHRHSpSLhSZLisC9SUzHNS/z?= =?us-ascii?Q?kS5teLgxXBaafzPx2wlw+9WLP8spgMrZqvxTgi+utZq2j1CkmmL5LlvDmeUB?= =?us-ascii?Q?as9c4Phq9Vs7xcofIZzy5zKro4NodcnNX24tGAe1R/vSUx5HYDUUMu36lW5M?= =?us-ascii?Q?lv9OaVWl+9E2Q56MA8FnyjynCNjgXvYLjpL+4zSTuxhrbuXGma8chE3KECRr?= =?us-ascii?Q?Bvj2YHl6904bOyVm6OHM6fB78gPWLnY3IneU/VQh7wIVoo1QztzVQIt/UrN5?= =?us-ascii?Q?lKUCaQp1Q9H95QIl4f6Q2mfsm/zgbpf1VqbOxGHrBmfjfICBlHabQNyX0y6/?= =?us-ascii?Q?qAPc3/JCDtMGumfQvaQZPRi+glwhiHKrx8TO4lZynbmh0F3pBLPnxztaug/S?= =?us-ascii?Q?odkNnA9hhMLlmXwg6E/63ngHrds4orgnLai4UYhsdX5kT6Tv5lE1rAWxqAeq?= =?us-ascii?Q?ZgrQGpMGvzq7btjcNldPIKV8L1b?= X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 5:0weXhQUlNKnV/Mv5LECiTZMIs37NPj1Z2igg+ZlH1A2rpsfoJEv5FUl12G4ecg7IdGK7StZlEnAOUm+wx4spIhgR8ZnWl8N50suIma+/usq2cbb09zyGSEMHNUko7kT2bAx2MbNOOuyqXyhcNuaeTA==; 24:ED+ug8z8r4E1QSj5KcG0cudpgW/Is2ZG4Lle5hVv8gpu/4y5Rkq12vqjYeZlQwPndd9FPW6Lx1gN3Jurtyj3DLe8awVziPXQrIao1F3An28=; 7:qD5DGdjTJWsy8KenhEeBQsFSbuC1Q6ZN3O8C8wsGvF0GGpsYpetcVbUz0eWpgPZ4+S6gASGm+PcLgR1ROQgCexWE4ZlMgHCCifr71FsO9hK454yN3ZX5ZlvQDXHL5PtvSJVykRw2ceTHBUHcGW1XLMkJfxDHEmQ1vf3uXLIwvtTZGSLUQZbp+dckSgBrIlwr; 20:qawz4LXMq36ghCaSwAlphRef3Gwf3H+s3juVPohLpVNKJVx+MhTqBE8iL7x8uAoS/jUPDlbfh7g158ONsIzegVwqFtNRVnjVmWrAQIuSlt2EW4y5usMrN28VqXFBZYwhJfB7K66SuBNefLUYCXiUyioAuQGp2DXWXEmjrDjg0JE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:50:01.3822 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1705 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_core.h | 2 ++ sound/soc/generic/simple-card-core.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index 2db9de8..cd69d52 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.h @@ -98,5 +98,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-core.c b/sound/soc/generic/simple-card-core.c index 5c2ea50..bcc7826 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.c @@ -373,3 +373,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);