From patchwork Fri May 20 09:46:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129417 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 DAFE460762 for ; Fri, 20 May 2016 12:44:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCD8827BF1 for ; Fri, 20 May 2016 12:44:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C199520120; Fri, 20 May 2016 12:44:51 +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 694D227BF1 for ; Fri, 20 May 2016 12:44:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 24F8226667E; Fri, 20 May 2016 14:44:49 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8D7DD2675FD; Fri, 20 May 2016 12:20:11 +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 D2A152675FD; Fri, 20 May 2016 12:20:09 +0200 (CEST) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 991A8266968 for ; Fri, 20 May 2016 11:46:08 +0200 (CEST) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 20 May 2016 18:46:07 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 3E24252A83; Fri, 20 May 2016 18:46:07 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 2601C480A4; Fri, 20 May 2016 18:46:07 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 20248480A3; Fri, 20 May 2016 18:46:07 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id UBF03001; Fri, 20 May 2016 18:46:07 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211713657" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:46:06 +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=fZhVlp8caJ2mzRIi0cbFTk/mEW1owSCvBCenPtqNQ88=; b=AYkNOAQwpfhUZ6Gk/9vkFQAuYuJWef3XoNFoTs5F+Zh1CKA3GqgtRoVAHrbUM4jQusiJOtDWTce7tVp8AVIc5iMx+k1yHz5vMFOQz4vtJXNDh2vg4ytFXydil3FR0fQd5Fo9ze+e/pGhfShBWmMNERnNGOvI3IhGzjrgw5g4lLc= 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 HK2PR06MB1699.apcprd06.prod.outlook.com (10.167.73.13) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:46:04 +0000 Message-ID: <8760u9rrtl.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:46:04 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0029.jpnprd01.prod.outlook.com (10.164.161.139) To HK2PR06MB1699.apcprd06.prod.outlook.com (10.167.73.13) X-MS-Office365-Filtering-Correlation-Id: e41c918e-3eee-4a9b-2d08-08d380938fa7 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 2:XI4hvAyaGJpz9hO0DP97MLDXzhEx1FeeNfrAULlI0ggESlI12XTL+6DNFpRDg3pjJWFiwi+9NOLlPmjn9WshGrTbHdNz48Evord0QJqr9nQcgTIpjdfDMTJ8/qCyCox86egCIZFtPg/yf3k5b7/zvKHD0eV4SeLDqOrGlFx1AzgwwRwBH1l5H2tg2tiCiECV; 3:TkXdD0iqXz0b9lhH+zVAsrGSLCj2gzm9qQNJ+Ouz3Tyr2249sO4vgwLxwK6nSh9rLhXI/XQ0ux1lQ4M1urrhwDiJM36AY4sy8MCGUDKajYo8R6mDtOLWN9YZpryTVCgi; 25:6wNMO953rO//7LtWyosKu7oru+NP8ysQlasvOT7MCDgAGjZj3ZJDVYjdIXTL+HPsKufJ5rIH4vlojawz81cST6tbNFvC7DVhQTkLxSHdALU0Q/qJPGtdvUm+mh5DlYzbb/Nl7cUynDdOsLEkl+LWyrG3Sd2oz8YIzPBUJhpRNdwjiV/zbwoo1Ypf/TdSjdy5FJphVIPx3XWGr6WlG4Wg4Ydx/hiHstCi+DrzMwkPydFaSeDy0Px6xf8xsg3LWjBvqTdc0nVyEKbYRsxmT+JRIl7Eksq/0W7QWdQDTqeEZNOEON6MGexX7qMJPmp0JWdeUaMiXV+tnWh+MIYafs/prCFaHQ5epWdM+fmuPvwg+R48Q8VKuVM60qdhhmAt0jL3/FAr4TtsoQ1i1e0+ccUfxjq3S7MnwJj62fxGBj21hPI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1699; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 20:jsCPjCUfLrGp7x2MWyftqeso6tFJVFnAkQhsQ3ZSJBkVQhz/rd1KShsikO2mC59G+uPewIZKvSEC4zJ882s479u52WCX1V5gMmLDBzZsfVepez/gUj/icG0qEQvjJgntEsztOkktPimZy/QhSKpD2gPIrX4K4kkSwJFDNjcNfKNJaApFyU9ANmiLIN908nR9FhfDynDOn1ULxAUGZjFbDs0k8012dAHGuX7u5x4gs0GWmNT24Hd3MfOP4PYY5spyqPUpY07hGk17edZUWvnVieco6i9HnXjzi5nUSX5ZKg+aLlZ1/261c3WVLx4jAPUrKHVp1qL2+LK3klhzh+SqrJ/8ios5mt9L8vwLDA05B2g0hxsyqOsZkumQktaTMsTZUZRUu2APT2EuDsrSziGHumlQrPyctax7fMjc4f+RnUp0WL6651OsMclT3VhRp6yamyp4AQZjLGhRMe091nmAXzL9dWxU37/yxxdNo0tBJEVmbi70ZQqdNQmkNNHPSb+B; 4:AbVJmVNJYZFBXKtjk/i5UPgXiwYNT638gtgi8YWD9S0E+iHt8eFS/XR0HycTrhl2S7nalN74Eigr40KaGKwSxIxlxZnXwIOstq24nNpT4qSD4vIH9KI0WSypbUGCpZnvMBkfF6+QQQkxWdHVtjalL5CT34hUliaHhgiIj3TjfsDr5rhY99tTRdzkcE+o+izcAjcNenRwjLrFhHOnZZWCwx+fRBoHTBBBruKzTNjQ7f0Rw8k5lNdQul9JfS/i2yomNKPFcShv34QMmbiqCRaFUJXpDNSfFW2VcSsDVa+FkIs3xgtZ6EdjH8hqCwBXzc2Pyg9BdWte0oPZQpCnux+QESkjfblonF+H4HNCa8zK8wbcrp6W2I2yTG6VbsXCm+1jqiq3oKXFHAtCNUu6YdEY0Q== 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:HK2PR06MB1699; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1699; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(77096005)(23726003)(50986999)(54356999)(3846002)(76176999)(230783001)(50466002)(2950100001)(189998001)(586003)(33646002)(5008740100001)(6116002)(110136002)(229853001)(5004730100002)(47776003)(66066001)(53416004)(4326007)(8676002)(86362001)(19580405001)(92566002)(83506001)(46406003)(19580395003)(2906002)(36756003)(42186005)(81166006)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1699; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 23:YY6O4xYZt5WN3gXHf0++t589WYPGb7pVBGlupdkBprcGCEBSb92fKHIf2W+UisAy/fHkEUsDYuQNJeWHLdwFyCSunptgq7FN/JcUOZE9+Yn+RxZjWP5IVSlqb8lBub+Oj5SQ5NS0a1TYkVtfdr9/NHyy24NlAVlmkjQ7G3dvw14DoLBNfiKsPBExB5L2PlX9k372kb5QMxDRJIfsTjpsm4/NLia2Ovikqq1D0Cix7O+uDJWECTf2S9HF5yCwhacJiugXZt7JYIGmUwZ2yWuEkr3sONMEcLsUEId+RK+GlRIuy8eC2z4Xa81r2jCG8tclNxbogPBWKdIdhnJDKvMBT+VCXYrajDFfjGgns+gF9Sela9h8lgrsixOwGKt1tLUITHx8309F6OL05GHLBgiSjOE2u1fFOvY5pgS1FrNmto1NVXIcooOp6dqa9Sg8G3ncRX5Zew9gzXZ/UUCg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VdV/fQ5EKAKsvUnjzYR9kvm6tVDrXvcvW6x1eWNfxLk+pw6/OPkaIAWq7ZgXPNXSYSkPnmQRa6rKJUu3ozJENwc4scMc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:46:04.2705 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1699 Cc: linux-renesas-soc@vger.kernel.org, Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 11/49] ASoC: simple-card-core: add asoc_simple_card_parse_card_widgets() 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 simple-card is supporting widgets. 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 | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index d66b536..41a66e8 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.h @@ -39,5 +39,7 @@ int asoc_simple_card_parse_card_prefix(struct snd_soc_card *card, char *prefix); int asoc_simple_card_parse_card_route(struct snd_soc_card *card, char *prefix); +int asoc_simple_card_parse_card_widgets(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 bfe3bf4..baabb50 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.c @@ -158,3 +158,19 @@ int asoc_simple_card_parse_card_route(struct snd_soc_card *card, return ret; } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_route); + +int asoc_simple_card_parse_card_widgets(struct snd_soc_card *card, + char *prefix) +{ + struct device_node *np = card->dev->of_node; + char prop[128]; + int ret = 0; + + snprintf(prop, sizeof(prop), "%swidgets", prefix); + + if (of_property_read_bool(np, prop)) + ret = snd_soc_of_parse_audio_simple_widgets(card, prop); + + return ret; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_widgets);