From patchwork Fri Jun 24 01:16: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: 9196273 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 193656075A for ; Fri, 24 Jun 2016 01:16:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08EE62847D for ; Fri, 24 Jun 2016 01:16:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F070628483; Fri, 24 Jun 2016 01:16:56 +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 652432847D for ; Fri, 24 Jun 2016 01:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750847AbcFXBQ4 (ORCPT ); Thu, 23 Jun 2016 21:16:56 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:31897 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750838AbcFXBQy (ORCPT ); Thu, 23 Jun 2016 21:16:54 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie1.idc.renesas.com with ESMTP; 24 Jun 2016 10:16:53 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 4E588458BD; Fri, 24 Jun 2016 10:16:53 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 4AE082806F; Fri, 24 Jun 2016 10:16:53 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 45B3A2806D; Fri, 24 Jun 2016 10:16:53 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id LAL09159; Fri, 24 Jun 2016 10:16:53 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="213663695" Received: from mail-pu1apc01lp0023.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.23]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 24 Jun 2016 10:16:52 +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=gBd+E9Ggtc1T3das3M3j+9+WYWIgUkEioZphcOLp/QE=; b=DgvFv66k32ytvo48WJtoiVI75NMWMbmtlytvkio1KeCQXCPvu8VfeVU+QBO8Cl2CBvs4dZWgBPsurfHwURIx4xjS9LsYJMCv8Yja2kfHx/W/w6bNnbzvQcKKJS9e0KaQiKjA0VIzyTSBfteJIFOP37pxwax66zeaGXe0e5gdegM= 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 SG2PR06MB1710.apcprd06.prod.outlook.com (10.167.82.140) with Microsoft SMTP Server (TLS) id 15.1.523.12; Fri, 24 Jun 2016 01:16:50 +0000 Message-ID: <87r3bnxuhl.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 04/11] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() 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:16:50 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR0101CA0040.jpnprd01.prod.outlook.com (10.168.40.178) To SG2PR06MB1710.apcprd06.prod.outlook.com (10.167.82.140) X-MS-Office365-Filtering-Correlation-Id: 5a1df9dc-2524-464f-f638-08d39bcd385f X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1710; 2:6e5sqXu1BD3KYOkCApf3fLxR20TXn7RlZ8F2IscLpxsbWzvfdsBNn8kRB4WrMxwvpgXnvK+GME23FKK6HeW3qVsBlo3iXy35W1CfpAUDvXka7ABxTVC8w3eSXCMsrtBwpaEb54mNX7W2v6Xz8dVg9Pf5mSTiOjc9KHUB6q8eHZXKnWxAmrC1rvfB7tzhQtz0; 3:d+Cn5boB9ksM2aEeusIWYPTbIB5QtkCPhuoJi5U1Db/i6zNx4lxyVX7oHkZd1k7Af6a0PKldfzex3sqTd/Q1KQHOuU47ELZodyTo6rKenwmmSqaakamAQpfbROrFCVTq X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB1710; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1710; 25:eUv7loPFTvP6dk2KbzJjjHkcpUq/hkovmK7srYCmAN9P+iWZTHq+CI/F7lnlcfEZlZeyMLT05aRSEMkkle5jHwPRU0xyIv/3v8mmXnqdvk2eXOf92dMO+zibYj7AmIC4GsqnSSjiBjNEgQoXa2M1/eUmHjm/DBG+7cCpDEpwbY6M2dekMXKjS/rzKGRlTAuchdTiVuC3D59v22Xq9hvA63My42raYImsNUCUsYmVKsbwCGFlSZ/5uLtwZ+qfkL+r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s8YgLVf+OBKAS/jkRJTiS8knfvQete0g3tgUP2oX0IPtKHV8o30CRO2eLsqobTGUaK8byjdLNNTnMm3PfJoxmtEKGkZ690ueF0UeBo7/L9w5jp4cfnYm3lNoZIn4OKjwHGNp7LCgEaf86nHt6WkIhwdfGk63jYVN6yLhZ8fVwoEPU6Dfk7pOqewhHQms/p3/lM0rt/XeqltBEBLNsghfuWbIy1SiIw/HTtPVrMN5QbKjCPyAssAMocb3jBp1G2RJdPVG4mD8nbRIWzImBPI+YC3hy/Ot5Ws4jwHsofUCyf1cX5lzAuVrN6L450qJT2iIGwyR84xCm901dTfcOfg== 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:SG2PR06MB1710; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1710; X-Forefront-PRVS: 0983EAD6B2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(3846002)(6116002)(83506001)(8676002)(586003)(23726003)(76176999)(54356999)(50986999)(81156014)(81166006)(53416004)(97736004)(2950100001)(50466002)(33646002)(189998001)(4001350100001)(42186005)(68736007)(110136002)(101416001)(86362001)(230783001)(7846002)(229853001)(36756003)(4326007)(7736002)(2906002)(47776003)(69596002)(19580395003)(305945005)(19580405001)(77096005)(46406003)(106356001)(105586002)(66066001)(92566002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1710; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1710; 23:X0RLA9aVYI2ANpx1A2TTaWbrbnjGip88Iosnwmyxi?= =?us-ascii?Q?Y5I91wnlW3bMBAnyB4i00Zuohwltl0PDTCqjwKaF43T5lQd0gZrWP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NHGkaoTj7nhoteSa9fQLqJDKc0I3ZfyiBHZB66Pmuvh+a21rLovwU6Zk1GWpR3Zg/NpwO3+mqqeiVLzGyfK5SASGA295WdpXMJA8DqbWYAOdnQpzFGmPzZskOKox54U+vHh8kklnFn78H2y7Sko18k07oGBqmo8W6/Ac5baCFIuCNKelQyW+12xLBb6yPWAS09Z8w== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1710; 20:4Omkd286MnMOni7FZGsSbAJdvUs4lY9tgRadsGcJlnBB2gJ9ZIseseFhrGw8tHeVQv0pLSxyxJ3y+57V/HUCjqlGuG95x6HLSkBJCG4UR+FJnzNo0h1KPTOJGbkzunpXhuuJwJihOypr+0VSq5kSlHkt94IrrEH/TINC8h+YVIY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2016 01:16:50.0031 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1710 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 --- 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 41e567b..2f991da 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -31,5 +31,7 @@ int asoc_simple_card_parse_tdm(struct device_node *port_np, struct asoc_simple_dai *simple_dai); int asoc_simple_card_parse_dailink_name(struct device *dev, struct snd_soc_dai_link *dai_link); +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 9b49b5a..c782b3a 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -105,3 +105,23 @@ int asoc_simple_card_parse_dailink_name(struct device *dev, return ret; } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_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->name = card->dai_link->name; + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);