From patchwork Fri May 20 09:45:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129413 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 8707160762 for ; Fri, 20 May 2016 12:40:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77F811FFC9 for ; Fri, 20 May 2016 12:40:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B69427BF4; Fri, 20 May 2016 12:40:01 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A0D31FFC9 for ; Fri, 20 May 2016 12:40:00 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E1E152655A6; Fri, 20 May 2016 14:39:58 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EF54E2655A6; Fri, 20 May 2016 12:15:33 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2345F2675AF; Fri, 20 May 2016 12:15:31 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 2704F266922 for ; Fri, 20 May 2016 11:45:16 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 20 May 2016 18:45:15 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id DC6AF43ED3; Fri, 20 May 2016 18:45:15 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id C6EF28002F; Fri, 20 May 2016 18:45:15 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id C28148002D; Fri, 20 May 2016 18:45:15 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id UAG09504; Fri, 20 May 2016 18:45:15 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211713603" Received: from mail-pu1apc01lp0024.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.24]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:45:14 +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=xmJe9w7vgSZufmFuy1IiA1jA53JytwEd5hff30PYEz0=; b=jLXhHKambM2i8AmFIhuHL/mAEwRBHzlNAHLYyautO6z7aP8dFqPt9Y07EMUfE3VvTdd+MXrUTBMSSV3QaFrCsbWiZiBU1f6tPHtGIgKGxtASCFWUTiU9RzPnvGrj8KwHmixfJwdo3XcegzFLpsawiZeVOK9DTAwMhVbT7BAGyqc= 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 SG2PR06MB1711.apcprd06.prod.outlook.com (10.167.82.141) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:45:12 +0000 Message-ID: <878tz5rrux.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown 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:45:12 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0017.jpnprd01.prod.outlook.com (10.161.24.27) To SG2PR06MB1711.apcprd06.prod.outlook.com (10.167.82.141) X-MS-Office365-Filtering-Correlation-Id: afad4406-08af-4d18-4260-08d3809370fe X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1711; 2:n5wg1Noxajv03h7sJKt0b79DvAoagHd6Yael3uD7dP7BW9U1Ppy8TREOSEph/DeRv8DRaTYWYY41mkXi3W+O0GP+D7Q0kqHnGETHaUGrKaGom07DFFr8CL/t/gLw5Hbxv+P5lBiNdbKYipZxCZHTR+eOId8y1aI8y8vhh6ca+gqIH6X73tPYLRGTS6MDOeuq; 3:931NAl7yv7GtZOdMl7UekRJvdHGKS2eT/qehqw9GhaTpLRxThqo2whAqs5JRr+Rpgk/jsTU6V2hIe9SrvApyYW7oIcwe9cru0O6IK2tqNUJlW73ZspJi2OqDqgrGim9H X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB1711; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1711; 25:zhQ/JJ4s19IvV9JKvu1SFLElIlkO/BHdxIGb2uF06xhGJmZtvs79in9f/N2YJBJQrVNBiJn9OCmO/tGa1WXCElKXRh9Qk1m3+u+Ka+1Ynd5f4j3W5zEjDxmB4gmpPIMqvnP0HVMnSbGG8ni2t7pPAAGA2PM+y/8GJgCYAL8sHu/L/T8JpjiFVlRyVkWY0xDkSpVh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247q4bFPStbfSZuoPrrylbTq9c6sNVUX4ujXeoLxbZeX8Xwnmnuso70zEZpQw8p89TM6QiAn+o8zZvaE3b8sD/KgPXTDEmV4IAGJ7HnLwVjuz4RR3e8NZgZR9eHTv8YH/AxZoBxEuje3jJnwbofAaCtLaTgJIQJfK1NigxdLGinyiF85DIfyMAxuPd5kU0vcHDiF0hGyvvF/i2kXrnsTUNncWxolkJ3+q4AoZndfjWIjsth2iuXHewabveBtAr2ky4dL0LEp5qUFKm9a+g7/bCeMvZXXFmHpdUKRudkSUegz+NO1LSOimQ/sl4CA9KX+9Cfxvqjf0CKfhtH2xyuMspUHaKAaeegmvzG5i3dH+nXFa5Fs6P3UXiJfR5xA== 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:SG2PR06MB1711; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1711; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(19580405001)(19580395003)(110136002)(33646002)(36756003)(46406003)(77096005)(5008740100001)(5004730100002)(53416004)(2950100001)(86362001)(66066001)(42186005)(47776003)(230783001)(50986999)(586003)(54356999)(50466002)(83506001)(76176999)(3846002)(23726003)(4326007)(81166006)(189998001)(229853001)(2906002)(92566002)(8676002)(6116002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1711; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1711; 23:8O5Dncj94uwHjgqw4FSH5qjx5Qfq0hlNiu5iR1Dq8+9DyE20BnWRbZYut9UVTGy/vwiD7+qshVAiYwW3V8cZQXxMGc0fDEsJl5qNd0GCiTVLkA3acAEJuC4IcRPyt8aKyjfNmQkrEs4v96erNBLUaj4+FysE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mPcaQ4u5sY=; 7:43YIYJYwkE2rbQRYQ9CxOFXjOY4WwuOvbLroW95gDBMFegebFvPYcQ5SkrqTMoezPf9D3HpuxYLxsgXGsseiK42SzZC9LDDOQdYTLmneZXkcy9j5/KaKRS0M9KZj5GnrOw1WVTIB7hE72MQqPxRNnAhSSa+3nLo+A7JFSdgwxCK67aenqSsXzL2HG4zpNp1t; 20:TnoalRFiLYn6K9zp6h/dNmD8n4P+LdAjsIRslAHUWJvyuv+xPWZZodLlVFAWQySATWIFT8ucWiRNIWKCK581EfbLKcO1btjWZ/xQcMxGUbpKbtrQcKknuWpqA5taACtIqmmb55AkrF30awlU0iJwr7cOftuNJvAbQZVUQ36+4I8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:45:12.8005 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1711 Cc: linux-renesas-soc@vger.kernel.org, Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 09/49] ASoC: simple-card-core: add asoc_simple_card_parse_card_prefix() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto DPCM might need audio prefix for route matching. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_core.h | 4 ++++ sound/soc/generic/simple-card-core.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index 2f991da..89172aa 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.h @@ -33,5 +33,9 @@ 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); +int asoc_simple_card_parse_card_prefix(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_link, + struct snd_soc_codec_conf *codec_conf, + 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 3b8cd33..bc1f2a9 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.c @@ -125,3 +125,20 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); + +int asoc_simple_card_parse_card_prefix(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_link, + struct snd_soc_codec_conf *codec_conf, + char *prefix) +{ + char prop[128]; + + snprintf(prop, sizeof(prop), "%sprefix", prefix); + + snd_soc_of_parse_audio_prefix(card, codec_conf, + dai_link->codec_of_node, + prop); + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_prefix);