From patchwork Fri May 20 09:44:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129039 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 A34E760762 for ; Fri, 20 May 2016 09:44:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95F2A1FF6C for ; Fri, 20 May 2016 09:44:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A9D525D91; Fri, 20 May 2016 09:44:47 +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 D2F7F1FF6C for ; Fri, 20 May 2016 09:44:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754756AbcETJoo (ORCPT ); Fri, 20 May 2016 05:44:44 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:23984 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754665AbcETJon (ORCPT ); Fri, 20 May 2016 05:44:43 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 20 May 2016 18:44:41 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id C121152ACE; Fri, 20 May 2016 18:44:41 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id A7A238002D; Fri, 20 May 2016 18:44:41 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id A4F768002F; Fri, 20 May 2016 18:44:41 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id UCB08871; Fri, 20 May 2016 18:44:41 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211713564" Received: from mail-pu1apc01lp0020.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.20]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:44:40 +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=yiibIGuL+5YxczIc0eJvVDkpbZud0uG0vDL89cGzn7k=; b=Y4lWDE2KMkKbBRCRxP+LpvxiObadfD+tFt+i2p9TR/NdGR9w6tAGR8M5jdhhKbKa8n5e0n8YQEVY0/gqfAw3XnHQtoUtGlcv2S2u5RdVSAlbjc5jrorDw0DA13gb2B2D37qUVl91X9z/z4K/eg8LMEkVluYx0tpWNdYA+MQsEiw= 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 SG2PR06MB1710.apcprd06.prod.outlook.com (10.167.82.140) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:44:37 +0000 Message-ID: <87a8jlrrvy.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 08/49] ASoC: simple-card-core: 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: <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:44:37 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OSXPR01CA0025.jpnprd01.prod.outlook.com (10.167.143.165) To SG2PR06MB1710.apcprd06.prod.outlook.com (10.167.82.140) X-MS-Office365-Filtering-Correlation-Id: 63bfb685-4981-4ad6-fd75-08d380935c3c X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1710; 2:YaKHrpsm/2Xuer09ypEe6SZ5sjIDDk2TpUQTlTSD7t02yhh9bE60a8OQmoPs59gL9lbJxmXwb0Y16e0T8TgVLHoKk3DHw+xt+Fg5kryWA2sfUmhKRxkN5EZey6HFuUwOklQeCG8gKUs4rxQ7qBwjoQVIMAcEsuj4vb+g83/8UV/pwpFH1pwXGiG2IFhTC6JI; 3:dRXXRT36NyPAn1QOpLXx1cWRod33IO8e5782cyyyonumC7dWBjIyeY3KNGXpJfEIMgEflMGeO1TXS0xgnG+twt26PNtaFp+c8jyD+TgxgVATXpBJe2LfT+denG2OwD1s; 25:YvOc3Zsx82NcL4rvRA+rrU+Y5Q6DTaM0LDDrmDtCrqIZQIvqAbacy7J+cpM13gSqCcc2ac6SV4ACc64Y5WDmcV8JdMxowmfWoFbDZ+SNIPr70H0kvNqtN8bmkzGw8RKVhEcde7nZRW5UU4OTEIozizNBvMgG1Af46LcN8eQNjUfF/GpZ8ws1IxcXK10MJdOgHPrglDhCjYp7FO8b1SBP5q2fOQVEUnsZiyCcbNAxhJR0cWs3Oy4q6JIE7gBTtzuaUIUD4ML9/u6OBpY6Bo4NgFzTSunso65kwuLx8tc7yFKrEg67p303hj54BffXybwe1wzBle0zZZF6SgMGZNwHgJFeUekGOrKI5cB50Lx7L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lQ== 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: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(46406003)(189998001)(110136002)(33646002)(8676002)(83506001)(5008740100001)(229853001)(23726003)(77096005)(2950100001)(50466002)(36756003)(42186005)(2906002)(586003)(66066001)(47776003)(81166006)(92566002)(19580395003)(4326007)(53416004)(50986999)(54356999)(76176999)(3846002)(5004730100002)(86362001)(19580405001)(230783001)(6116002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1710; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1710; 23:NPpXuNcTFAv7FcEpV/0sviuI17ugOGED7h3HdQVA3S9OB8gyLAGtG4EFF9QGOeSMwf+tZ9hvYsh5B5Sd5J2aX1/5ze4fLbrMttPtlb9DkSsdl7d2QtWOTiZDecbUrR/28+GyjbR2n4Nx6Cgr0FnS0oC3WtBwjlJlyDyH3yTlmpkF/xGw6oxv4V0YH5VjmaZbbpN1PZuo52FaPy7MIyBVEWdACKRlMQT74kcFQubvG/UYNXdhoE4Py9kMMyC6eKYJmvEa8foDQWY4y03N6NgBztjcnAteNyICofYQf40d7ae6Tj0OUgmy+2EoPq2Yst/lQBqo7ekDJ1eRR7WWFOVNf/cvUrBKW8lRdbiZpfv5RhmuPpyp75TbaKOK+H7wUk/lI/OZPjORxqk4cgWZgdJdeyjk/mlqYOQnGZHQeQyh85ZRg+01kIpEXFNSdaTFypF4rgwSKiFrxIIc2QBuC2nYKwZlDuwXanql/QJVuCnIhMg6dKL0m7rnihrKxu9fbWph1y/xXQEog9oKuVgx7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pamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:44:37.8701 (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_core.h | 2 ++ sound/soc/generic/simple-card-core.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index 41e567b..2f991da 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.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-core.c b/sound/soc/generic/simple-card-core.c index 51ed96e..3b8cd33 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.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);