From patchwork Mon Jul 11 23:59:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9224417 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 2275A60572 for ; Mon, 11 Jul 2016 23:59:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 141D62236A for ; Mon, 11 Jul 2016 23:59:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06FBA26252; Mon, 11 Jul 2016 23:59:23 +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 6E26B2236A for ; Mon, 11 Jul 2016 23:59:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751559AbcGKX7W (ORCPT ); Mon, 11 Jul 2016 19:59:22 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:53699 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751365AbcGKX7V (ORCPT ); Mon, 11 Jul 2016 19:59:21 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie4.idc.renesas.com with ESMTP; 12 Jul 2016 08:59:19 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id AB225448E1; Tue, 12 Jul 2016 08:59:19 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 8A5582806E; Tue, 12 Jul 2016 08:59:19 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 84E6E2806D; Tue, 12 Jul 2016 08:59:19 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id JAJ29907; Tue, 12 Jul 2016 08:59:19 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="214867881" Received: from mail-hk2apc01lp0208.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.208]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 12 Jul 2016 08:59:18 +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=7tOdTSWw0MjM64AFTKGiVZdq6iJvuNcwZ2OwuhiOYtE=; b=MfaKcCw45NFA/J9LArRwmah+kn3hm5luBRvM9tOycrDaVogajZ4awtVs6x/If9qVzGaUq14TcTYIbWUB0V+nE0wsEpM9C/b7OhOkAfSvQq3QDzQ1JDraZQFj81gT56eLCcL1cRK75i77tt/R0iupEE2UJSer1RCaRiGZQgGYD1c= 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 PS1PR0601MB1449.apcprd06.prod.outlook.com (10.165.210.153) with Microsoft SMTP Server (TLS) id 15.1.539.14; Mon, 11 Jul 2016 23:59:16 +0000 Message-ID: <878tx7n36n.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/7 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87furfn3bj.wl%kuninori.morimoto.gx@renesas.com> References: <87furfn3bj.wl%kuninori.morimoto.gx@renesas.com> Date: Mon, 11 Jul 2016 23:59:16 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0034.apcprd06.prod.outlook.com (10.164.91.44) To PS1PR0601MB1449.apcprd06.prod.outlook.com (10.165.210.153) X-MS-Office365-Filtering-Correlation-Id: 5ac5bd25-5847-468b-e5a2-08d3a9e75e1e X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1449; 2:K+u9H+pov8yFzIcAe6dM6R/97uvejuXyeW4ViCtmyoJLF23Ye0rDORQsQnLbbKasvfPWOy5C0+gACCKN54PEqjqFVAcPpMM6giDZ+FIve4oWHJRaSr787mH0cysZsG6Q+UVNe6wMb4GnVGxhhwyVnaBpwsDVWWwYYcuAn5a+K8EMfMtBRCLQbxrzxcAagbr6; 3:6EILLEW2PbQss4KAnwlp3XM80aHwTCfr7hICLgnazMPY1m46E76cZMq3gI1FU5CN01CBeX08jf/z7dC5XfknVCBEeCFQlQAX3/apxDtPOwMPsQYoTcXlSo4eRywhPokc; 25:O6MzeFuV06pUTN6jAMpuJGP8R7au3cZa1mijNWH4i22Rx15aPkRkbP9LmW+UMRp+Q9MsSNuf95rgqGQSgcBQ7zQbMuQqgSA9iiUs1VEBk8WIbt9LF+AaYhlAFKR8R9P0rCzDbRpO7KXwbT+arBUu+cLPuNNKEilsy8C7d86PDY4Pd91mM7swRf0jOM4GRka+M+UTAiObsCdGqHVdU4TpsyMXfbM6Lkfdom1PuL0IozjUdqJin5CwJVpYmqrl4Wm/ixqZw83BCgxOq0owwENQRhseWUXeMO22IOUXr7pLpT4jIBUMJGVY13m49SdbwZ4CShGJGho0ne1R7VijjfWx9dydT6OJFAw6sCju8CN796pZrNAEvUQMVQChNlMJpf61z9AnT1g6ur+8+097CsjN7Zq9sGqXdKjGDEqQfF1Y6hY= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR0601MB1449; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1449; 31:dVJi1HAi3euktGEsw+l+/xoKgO+2VpncfUlraDYtaxk5uXSSsiNmoBOXUdLSEAfW6E1gmkyjhF0fU9jxOffqtHRwHDrFS9OU7c8GIZjSo/smQtyatcKDmHtuyPtqC7qd6nCZw0g2X4bpgQ+Lgqey+qQDgcih1Vxp1qoCevwZD2et1oOeLTbfrebEIoUAtS5I+qmDrAt3NAb/mW25XGklFw==; 20:ff79SCPgFMuAQppuM82VuSdKHeMvmtC77Bx+Y31zl1zeqKcPboSj8afONhmtNZaEawZsiCyjH9TTu4Z3z/YD73IBdope1u6Y1U89w0o6FK5LVsfMbuBWEARRH3fsMCLhAq/pYhZnrrYLPKc/kfhh6W/G1jz831eNgj2xi06ThxiZzCMqnOJSTx/CHN7o5Ha/E5Ls0Xw0M2cxbFK3ss60wKkAxhgiHPyzMtJjl8Myb/a5DF8+rqFjjT0K40kal4CBTBGVEQ/RZrIjVNjBJF83AsUn1VLmSSwBiI5i6Jz3Rl3Y2eywIzYf443FSPLJsbIEkCOEkgZlt2V7zH+mJ9uDDbZNVYN+GJDHUQRSKErny+hR+WT1CI2c7BG2oHcXekJMcgGkhtM8YKRHB+xj2lmjAsJGTAX3NunDpdqi4yq6uwSiwDGqwVDZ53I8ju4iCAP1UiJdJJlg4j3knJn2UnUxyfh3HNsuANTchYzaeqPdU3LEUeX421CvtQGtF7BgphB8 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)(3002001)(10201501046)(6055026); SRVR:PS1PR0601MB1449; BCL:0; PCL:0; RULEID:; SRVR:PS1PR0601MB1449; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1449; 4:LHJXXs3IyxvbwudleKi4sBpf0r575ot+FCJyVVRyeOwxYqCKyQMVjwroC899NRVapHyt3dKRk4FU5mhUSQvVJB4yV/8hfK29lc2LamUtRU1Z8sqF1LDg1F0UywRdPdbRn+w/f7hVInLCU4ELzNJhW79hvPW7FZj5wSRfq1/z/iE7UDCOqE07XOwzIWQHKbI9sZsIxPQmkSmsgrT3mYgdjrTyhXG3KTKumx6fui4bGif8sGITDATn6lEwB+AZWSLTcyTM5OwFhmuRS12XlLojwdkKU5otlutXgrnwC29n4AtoJE00NcnqoRw1stzzTKL7292KgYCbWqGW3tjcfSCQMDoKdOoLfD28ReCJHHhE8OsU2j85rWav3K5W72fVmzfpkjB/K10yRJ2MNJMk6odddg== X-Forefront-PRVS: 00003DBFE7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(4001350100001)(23726003)(2950100001)(19580395003)(19580405001)(69596002)(97736004)(33646002)(83506001)(50466002)(86362001)(101416001)(92566002)(7736002)(229853001)(2906002)(47776003)(105586002)(42186005)(305945005)(81166006)(6116002)(586003)(46406003)(106356001)(7846002)(53416004)(77096005)(81156014)(3846002)(66066001)(8676002)(4326007)(230783001)(110136002)(76176999)(189998001)(36756003)(68736007)(50986999)(54356999)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0601MB1449; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR0601MB1449; 23:KPd9F5C2RF0qpG4V/o+4VGJcYCd5dPkzIrtF97O?= =?us-ascii?Q?PxiMIze8yFAtmCTce0S+WqDZ+5mN93BfRdnCF/lAOP7XxyJ3rZx38n5gssd7?= =?us-ascii?Q?eVg5ayXMFHprQiBRgJ39ucP79D57PRkyVLTF2VIkJmeWItK62Glt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o074gHy92vXQXahnMv5XkMSk5ry5GdNCo++fLfnJyFYvAUjQDjltERWIuDrO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1449; 20:PeKTgbZcMB5ie/1M30Q3CG3Wsl4OTS0NXUt2cfAxbL3FpswNtq+/0qN/J7vUdU/FgCN8sRbthqeDh6HRJBfhngSMN4v9Feo57Z6L8mJ1HW5zEqbbvv9VlZnryMjsSdn0DPrhWzxfxIxsrTUo2xmxYtEbC/miAYlP0PYANdcOy34= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2016 23:59:16.5999 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1449 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 to get its card name. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change include/sound/simple_card_utils.h | 2 ++ sound/soc/generic/simple-card-utils.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index b88a8dc..86088ae 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -30,5 +30,7 @@ int asoc_simple_card_parse_daifmt(struct device *dev, int asoc_simple_card_set_dailink_name(struct device *dev, struct snd_soc_dai_link *dai_link, const char *fmt, ...); +int asoc_simple_card_parse_card_name(struct snd_soc_card *card, + char *prefix); #endif /* __SIMPLE_CARD_CORE_H */ diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 48c7366..d89a9a1 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -75,3 +75,23 @@ int asoc_simple_card_set_dailink_name(struct device *dev, return ret; } EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name); + +int asoc_simple_card_parse_card_name(struct snd_soc_card *card, + char *prefix) +{ + char prop[128]; + int ret; + + snprintf(prop, sizeof(prop), "%sname", prefix); + + /* Parse the card name from DT */ + ret = snd_soc_of_parse_card_name(card, prop); + if (ret < 0) + return ret; + + if (!card->name && card->dai_link) + card->name = card->dai_link->name; + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);