From patchwork Fri Jun 24 01:18:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9196291 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 915A56075A for ; Fri, 24 Jun 2016 01:18:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E63D2847D for ; Fri, 24 Jun 2016 01:18:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72E0528483; Fri, 24 Jun 2016 01:18:50 +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 0BE2C2847D for ; Fri, 24 Jun 2016 01:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbcFXBSt (ORCPT ); Thu, 23 Jun 2016 21:18:49 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:56583 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750996AbcFXBSs (ORCPT ); Thu, 23 Jun 2016 21:18:48 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 24 Jun 2016 10:18:47 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 5F25146FB6; Fri, 24 Jun 2016 10:18:47 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 5949A8002E; Fri, 24 Jun 2016 10:18:47 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 50E5F8002D; Fri, 24 Jun 2016 10:18:47 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id LAB21924; Fri, 24 Jun 2016 10:18:47 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214136746" Received: from mail-sg2apc01lp0246.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.246]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 24 Jun 2016 10:18:46 +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=4kFBeV00X1t2VQPPozI7ABHPwRHQ9XXEQ4F8cUxUi/s=; b=P096N2uyJCa4NpKdqOmT/IDsg4GvGrgr7MN2yqxqGBJhLZazjrYuKNUyudI6WJ1NUKyutc4OfPzfdRR2xnuSmiuj7KglCZ6AIuOuzbqC4uiA9oyJerZu0CivLqggWlCTv38ZVoCyXvnvAwFQusDPH57h78IxrLMAn7EmcCCB/Ck= 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 PS1PR06MB1707.apcprd06.prod.outlook.com (10.167.53.17) with Microsoft SMTP Server (TLS) id 15.1.523.12; Fri, 24 Jun 2016 01:18:42 +0000 Message-ID: <87inwzxuej.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 10/11] 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: <87wplfxumi.wl%kuninori.morimoto.gx@renesas.com> References: <87wplfxumi.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 24 Jun 2016 01:18:42 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0015.jpnprd01.prod.outlook.com (10.161.225.153) To PS1PR06MB1707.apcprd06.prod.outlook.com (10.167.53.17) X-MS-Office365-Filtering-Correlation-Id: 480ebe28-46b7-4cc4-f26b-08d39bcd7ba3 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1707; 2:iod/VB387L822uudbqFu13/pyVjOQ3zW7C6a66ZRwYWQ5eyqUJnYxqltVYFKR6LEVFVUNmwTrkcFyjwZli6z1cscNFS+cdoZW9Zq6arZ4N3siqvjP4FDBP6763VkidRNjh6awptLKAwwJdyg8EkCs9LJSYBAzPIBff+uwWPGrMV/ZxVrJiCm1mLm2ngtvljI; 3:PemZNXzKVQ8KIEeiOUvQHaEUge7lu2JlTwz70s1Dwo8cCKsVlJspP1wPXsUAEb45MkcWIt+egZcJTlWK/ieSoH6GQloMdE6YTxNSPOzCdi4uB5qUbFig5Zw1tAdoPcfb; 25:6YlgQpFeotScGDHtUhDdZKJ85t9PariYO+zXtXNOTQzlXbrq/9i7aP1UDqF0AirgDhnB4jtk5q/0BJF3ssmGNcadfSBKqmTz3Yq+MGel0eNEKcPX2VIqVlfJjT+g5OZ3rAVtiBoPlTjphDwM0X2oRHhvx/JTofTLlgdCNzPshIjJV5usw+uTYS0vnnCXvbUn7Wd+c0go8xV4xWYNbv3TFyGrXlgwMkAf1aXyAhzvLI6FIyanX9rz+WuIaMtvD9NE9oP3lp+UlfB4yrcHEsZ3hQ41EhxTzZRLe9fHvSd+3MbGe+8Z+Jrl+kyIHJEcZ63JG3HyWkqYdrC6QbG+IVkW7FH5eppi8ePacThXatL2FBULFyaawJHqaqJp+0h0pyhYliyFkbDkzcj3M/VbPrzj7pRihX3ZD1S/lPPSGcn19A0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR06MB1707; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1707; 20:z7r4emLd5rKyfryhHCTufwSiMrxOf4ucEUCl/nGpJuQOdZcCZygTiwIdzuoX5S+/JvUboSDwKgtVb2WaC2GhFLzpSdZD4dy42aeus+1lYRNQLFUB5WPtbbkLAVLe5EMRejs3Is5M0izEXu5Bl57Elfz5gInqmr9qry4z++0CILHkqPqmkNkQHaIB039toJUep/JE0+dE0Zf7FjpR+u/ydyTz+qAuKz+GMzUl0KI14zaezJAcxbTsoQcjztTSoLG7qrT7RJ49KE6Uz3lPSPCYckIOAMXBzgstvDg9EVa72I6gZETxiWOO2Uq1rygR7UdAEyecLyweOta7H56EOJTmnfe/ntJqGcP3Bg2j8DdPS0u8Se7kO6yIMJPSH2YZBhKJzY2pEcd4ZLMVNBRyqXNcnbFjijNBibDQxYvw26ktoz6Oar6zGwhe94n24IS7X88c+n/ktldfw0Xu1jLKGyn+SMQkmlIq2Gon0s1k1ebpRue7yYoLWcSJmQXZQp5777ok; 4:XwGZBdagRzar+pX3XohNV2GMFU6krLsfU7xdKnwhT666tGs2euuouumUQSkc38vtxxnSgVIBC9fEUAKxnLxHyaJ2qXO74UKXxPi3Ngd17Mmu/dmlMI27ud3dsbSlrQAlIoiVCHp2njtfU5gB4wCtniQa9qUYjtIeeusxJ19pZRBpwux8tusY568V9MoMHhM8rItuqjSIOkd5ANwoRTn3HPpYr/vLpKRN/XC6qzdsiEuzp5K475oOvrKegRK6CaqrdyuDDt9TKoTOtdpQQNsDdrihDkHMS+bpWZ9YutNjLjbn7mXKxjhYsbJJiW05YuJgZTWvJq+UgvapJAGAAhLP15eQKJ+cSQWGPCO7+MW5lITFZIFHDVsWNmsDR4VxEEDIxy/qFMYedigCw79UKOMXfA== 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:PS1PR06MB1707; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1707; X-Forefront-PRVS: 0983EAD6B2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(2906002)(586003)(76176999)(50986999)(54356999)(23726003)(6116002)(3846002)(229853001)(105586002)(4001350100001)(86362001)(106356001)(33646002)(110136002)(53416004)(42186005)(36756003)(97736004)(8676002)(81166006)(81156014)(66066001)(189998001)(92566002)(47776003)(50466002)(68736007)(7736002)(230783001)(2950100001)(19580395003)(305945005)(19580405001)(69596002)(77096005)(46406003)(7846002)(83506001)(101416001)(4326007)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1707; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1707; 23:PushWyyn1sGLNz2HniEJ/Vh0XHOOxIv9pfQ3wGo6a?= =?us-ascii?Q?XoEf4ItR6fixSDO8z4rE6X/JqpywHcWdnzn+LwGO8dvmiEZ/MUIk0K9XohYn?= =?us-ascii?Q?kyJz/E79iAHL0L5wdzJELNvNdAlZsaoSlZBASozuENlPSAy78f/8S34R7ZrE?= =?us-ascii?Q?KHK3aP3cImdRIvIj+UOZ/foWxtzqMJmbM3gRiDe8KZ4eW4YGVbfnG3ucSSn7?= =?us-ascii?Q?43viCUfnQ1cxA2I30VM/Oz85mvSoinNzt4MDvA2WKytphraIXf5fijEuTDi8?= =?us-ascii?Q?s1G+tuuilZ/yPLnPa+oOKRN3Si3X42tT8qg9WrIun59CNC11IJ5XWkZ4HA4u?= =?us-ascii?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ange-Diagnostics: 1; PS1PR06MB1707; 6:07YZx98u9aegzGGXcRxm8lv49JEo99HPsKxNasUJyWs1clPwSU7bgc/JesaLlb56YRQhwpNNniIdaTzoBnWO+ubvkUI7pCKeAdTgsS0NCGzeLDv1AKb0LoJ8xhyUe67VWF14USWfi7fvksF7v7POzcpWoVucBPc8UPmy3wT2QWk4Sg4fYarQfalMyPCTWdo4CpT6Yj0sxog+qknvJfXbiWBaj+lnRrK76RzwM2pJ4BedNdUs76x0IufAWqQ4SNOsbJa32qqXhJT7cYOtH9N4v4ZdQKFbnpG8PDds9cLZ6cuQH6fGTfMvb0/+50HPW6pgpB+BLDqQtfJlVzKyy6dWOp6Qay+hBjXYF9FlCZ2g9s4=; 5:+7UHo1tmxj/V5O2+oAlWfbJNwtV0MRTxz/c3QSQhU6UVo1CzyLbipwbkySXjD/msPFM/fyWTh+9vZPc7DoAJKbzM9YdYs5tdI9by49HICkpu+2hPNc1kd8reEcXaTvBeYg+XjZNT1x9L+0XIaoxTEA==; 24:WOWSxEi/PyW8Jf3hceTGmuDSJmpVQwicOEPqqsAxXcYzOlMfQB333cETDmyCP+FFN4vKRPpgBrlYUlXf8alusdxCZUxNl+HzIxbkftHemFA=; 7:ielbC8t9Tn2kDTA3MbA/5ZlsRVlkaHsLEPX1epVVdQb11hR1l87AH/NB26A0IiA/RnFFf9AD+VCjJsxuKapxVLCiow1FFoREYg6mk7CFsTzJ9QT/jmEsRAr2DLGbHuVgku0zoHIz/1A4OOVjq7+fOxzRlJZHVxs5HV6X/8UjQiA1OBCqDRGflJTx68lW1dZXa6YokM3uRG4Qt1Z/CYhbKsRlvP4ep/amRheFV+pkqsyx0AjEpzZK77kmlFnr/YCnyDCtk9XRylqlAyukT3mreQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1707; 20:CiVOF9XAzwr4/mwJirHlD+sy4o2C3bMNFwFTi7Vb0oiaFju156lCZdBtcHS5yJIbvNk0t9WXxlC5bzPGMvk1lD7vHABRp1etFPrzW0t9K/BO7Ei9YbJ6RCQC3fS+8Fh0yOTXv0nRMI6PSUI3AIVLFP/4LX5uifquMSe8FtDTxoM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2016 01:18:42.9460 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1707 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);