From patchwork Tue May 31 09:01:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143851 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 3A36760757 for ; Tue, 31 May 2016 09:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F11F27BF1 for ; Tue, 31 May 2016 09:01:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 236E027E72; Tue, 31 May 2016 09:01:43 +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 9B4F728185 for ; Tue, 31 May 2016 09:01:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756637AbcEaJBj (ORCPT ); Tue, 31 May 2016 05:01:39 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:33324 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756452AbcEaJBi (ORCPT ); Tue, 31 May 2016 05:01:38 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 31 May 2016 18:01:36 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 640C84927F; Tue, 31 May 2016 18:01:36 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 4883D1806F; Tue, 31 May 2016 18:01:36 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 2231F18071; Tue, 31 May 2016 18:01:36 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id UAZ08378; Tue, 31 May 2016 18:01:36 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211980366" Received: from mail-pu1apc01lp0020.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.20]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:01:35 +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=gBd+E9Ggtc1T3das3M3j+9+WYWIgUkEioZphcOLp/QE=; b=E3sYm8AxXGfSWwkIS6aayYBMbMuQfuiYY/4uBkBQe/JGjxh2ZrENlhup1JlFoHX0R9cuUZa2Beq4ZKV1QmcL1K89sHNWQwsBNRnz4YdhUScJ+SmNGz3Ia7QMZeWzmR8yifqq61WfwFKQsdv0aI8IzCM3Q25D7RgR/Y4+wYKuRSY= 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.506.9; Tue, 31 May 2016 09:01:34 +0000 Message-ID: <8760tusj2q.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/39 v2] 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: <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:01:34 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR0101CA0023.jpnprd01.prod.outlook.com (10.168.40.161) To PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) X-MS-Office365-Filtering-Correlation-Id: f2249919-c77d-41f9-420b-08d389322ab8 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 2:DG17Yo3A89nfmXFVbzOXrMdZtKCehQok00iZmFdNuikmFMWPoy7k0vM9aGanZKahK7Vwt4+GmBrzVo5gaHiNJwi01oKTsdGUrNnn9m4bcv7UcF5GZ2b1Aa3XbXZvbGRhZneVORltsI21QHwnMFpnRBlic8EPCFjF5r4TJGsuD6nkR04C2OewRhsCOphXw/dt; 3:5xhA4Byf1sWuESyp9s0S6jvRmzkyJhkOX2A/Z3KLvyWIgfGcyKMN8GVPC3zhI4XLZ+1BA904mN5z5EzCBRHp7EinXcKHkWV8trwxy6aKVG/kNAGJbZ4ZLUYCFryB4JEC; 25:1U9opjfpH2dA+xYLyzPk6CXqEWfNdabEJZqFzpfr3nCMDnM/lJf+0F6UA94n3u3lBE44PTyUrPq6NY0zmgg9felB9M8IiAnwRhfdl9UUWYmctSs6NZwMRpuCQjRp2FjY/kcOo4VwaK0wf4givMMaXRSS3OZNDknsSOrlqL4sYrb/zYFWTxaRj19LUpdUs/1WmZzc+wFQB5x+B9RMx9ZqAChl2oVJl1fspE/e5Vzp4FZkFIA8qbbA2jfzwpjlWZObA5Bk6nxEVeOVB0u6Yvm72pc3LluI9T/lRGA21Z9AxyeLehuPbknngHxTsBW0OGclV5vC6O00l+ox60SSk41BUfQdqRmcnCJiIu1aZ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1snZd9H2QNMABcAvTTxP8bqsJ7AEPkA== 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)(3002001)(10201501046)(6055026); SRVR:PS1PR06MB1705; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1705; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(81166006)(46406003)(5008740100001)(19580395003)(4326007)(19580405001)(50466002)(36756003)(230783001)(586003)(5004730100002)(6116002)(23726003)(50986999)(54356999)(76176999)(3846002)(77096005)(83506001)(110136002)(4001350100001)(2950100001)(189998001)(33646002)(86362001)(53416004)(2906002)(8676002)(42186005)(47776003)(66066001)(229853001)(92566002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1705; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1705; 23:QFpKZB0PDDhGEDo15VlrJUBiKvYdSTNPHGWQ6dHI4?= =?us-ascii?Q?vTGSmIGLUq4fBx8PbkVBzxmnEtRcZHDZbC7xV395C8b6oMd0YhabTe0qpoA0?= =?us-ascii?Q?P7iBvQ65XZ7BkTHlDZC/YhSSScOMdX9vLTS0PgeEYVeJDodtKiHrcu6KvjKo?= =?us-ascii?Q?FJ8/DmwpOzLZ+7FVF5+Vwpx1e/WR2ojsY5l5DrdvMnou5lYx8b5xV6gF1+cO?= =?us-ascii?Q?VAdiMX603pVpk0dVCz/MRsfnA+1GkykKQXhi8u95kbdO/R1KkFx1WOS0F2Jb?= =?us-ascii?Q?PZ0VOZjoZUzdCFvvD6c2LC3InKUfiIanpKm/2s+xvjd73I2HkO9dBnZy9qu+?= =?us-ascii?Q?SmEporw0hB7oHOuOpEgzFGtUUTgseH0jAPUFqFwLAQjmhjEi6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HtWtwBAYRkUC7VefyBte+5ZjlKHXJUI67sWnKkehTRE7/b8ucKutTPI1WmJd0JTzlp86/fyOabb4FUmuInfRPNcykAK0NiE5sXs9X/aas/+lMgP27IXVtMH7bPY7Rsm8SJr1sM3TKyydlPXyUtDWY0OQlOci/cplyOK4t/56goK5iY2/2yo5C6zh3; 20:aITFsZBIlCfXdibS0sZGry87RjNes8K+P70DxwautFXQJ9vmcvgI0a6pWoxbw18TDnfMnmbCXtjhoOgYf7sp4xwbk1i3/QzXsTwGJeblLT60dbdSeCn0mAbYJBse3UTscklEsrOFt8MEtqhh43TaZ2aSKaTxFBJ00tppAlUO4jA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:01:34.3554 (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 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);