From patchwork Mon Oct 17 08:33:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9378837 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 F273960487 for ; Mon, 17 Oct 2016 10:08:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8B0F2911A for ; Mon, 17 Oct 2016 10:08:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCFA02911D; Mon, 17 Oct 2016 10:08:45 +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=BAD_ENC_HEADER,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 9038A2911A for ; Mon, 17 Oct 2016 10:08:42 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BCC88266AA1; Mon, 17 Oct 2016 12:08:41 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3E821266A34; Mon, 17 Oct 2016 12:06:25 +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 DDDCF2668F1; Mon, 17 Oct 2016 10:33:36 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 22FCB2668F1 for ; Mon, 17 Oct 2016 10:33:28 +0200 (CEST) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 17 Oct 2016 17:33:27 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id A495560FC1; Mon, 17 Oct 2016 17:33:27 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 95DEC80030; Mon, 17 Oct 2016 17:33:27 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 912AC8002F; Mon, 17 Oct 2016 17:33:27 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAB24546; Mon, 17 Oct 2016 17:33:27 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="222518189" Received: from mail-pu1apc01lp0016.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.16]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 17 Oct 2016 17:33:25 +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=s1PLQPedZ4H6xleKwdLG4U6ozLtnesYznZuGMktq4DU=; b=fueZZMUYJ1MT+8QSAHnuajjgDLiMaMHzxq88MFCVCYeNvgZV8gWTxYYOcQMxhbC/tTpKqah6ZDHOfJns6yo7b0jzgw8rGuI9eW3y1noMuFYTOF04kF899TYkwqOzEYO4xP0u5LbTTA7ykN/0R3WkHOvesGWbG4Ze1zAeTeiAelA= 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 HK2PR0601MB1444.apcprd06.prod.outlook.com (10.165.182.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12; Mon, 17 Oct 2016 08:33:23 +0000 Message-ID: <87lgxn4c4k.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Rob Herring , Mark Brown In-Reply-To: <87shrv4c8x.wl%kuninori.morimoto.gx@renesas.com> References: <87shrv4c8x.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 17 Oct 2016 08:33:23 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR01CA0012.jpnprd01.prod.outlook.com (10.168.40.22) To HK2PR0601MB1444.apcprd06.prod.outlook.com (10.165.182.150) X-MS-Office365-Filtering-Correlation-Id: 1ef2bc02-ff34-418d-ea67-08d3f66842b7 X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1444; 2:xo35L80gc37/sLeWqEjTFFb5uyJxnPikKQv2ybf4w0LQSne/Rn64ZEiB4CjZGqRCI+N+cRZgjEF6CoPlxw54Tel4WhOltGApn0SAx8svsSkGvugo8ptUwRAgb0AfA6WUyQ1c0+dWVoF1OfaeJCLTuXeV3m+8zh/op0LBeww3EE5GtCPUEM8870dvTZeQ7wzsX2zfXjFjDzCDZt2o5V/b+w==; 3:OkhtVPBD/e1IH+kFn2iRsfd0zgoyWF86BIwWAzB5wwK080xThAYa2j11+MnfGhxk6FD0/RYveT3QnMmtV/59Dme1ktepVdFyyVUqb7OdoIXuhmI1WACUtmYFdc9fAvaw6+jj5s6AIYNWXTrGXOMWpw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR0601MB1444; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1444; 25:5LKp7IO6xkNIORigXImqu7Dx7PBnD7IDyAPzFQ8/SEzTDvsEIG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5X6kmxZxQeB7HDvUoRMqsQOde6kIEaIARB/kxoo8v+WB8QcH9Vw3hCTXR0RF8yy0WAt6ltqqwHEAKbxQ5wfIwZacFC8ebHnutGhBXaH2rNrEkmHVCXJYOL+oiwW4mjs4j3nqYmnlTTg2pJV7fJQxs4CmJ7s0ANsewjI5KeGrv6zpKiu8GAP/NH4jOXJWE/cmjB+a7ujrcx5kB16DEBBNInH3UPeI/M1NkyPcNLCxjk5HVVXVd3qjF5fiQL4PYwv0iGrK+UVdMQcEP5B8Acq7F9NOEjY88vgHrJFNGMJhjfbxxz3ylAH3Qrr02qWqNnG/9NyXTFMDIkgqmWZVkX8egOSWDmm5cQBMYAaYFRIBri1W4bk4FC5J1kv5sqEnTyr+lR9H5Cwiw51j5aANe7IxOVEvd+q2xJFIOwjL1ASFnOY6svZURfj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:HK2PR0601MB1444; BCL:0; PCL:0; RULEID:; SRVR:HK2PR0601MB1444; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1444; 4:HlOEIry+q0KzCRIBLmTBfhQe8JsCi/gEJ/QFRyfpOs7FbAMY8dBmz6d9VwbFta5XoaCYSWFn80+VYoe+KhqWNRNLoxVfLmo6VFAqABYqBgUJJVbe0US7rB82IVzaomLQsQuY+RLLP/rE8cZdURP+Jcs/R6z7EFD7Jsc6iIuBn3GdqfeTh3mAjo4WjiUVHVXbRaodHCsBDCMdWz16QaWsPk1PxWlOkXRzy1lIaEwuX/9BBpgWkLiXeqqZzl9QkvuwZCNhdcEB5r0ttGosUPiyAcqEJAZtSwmx/JwstOhGrVFwHqaliGPz8TCy0dkKPQQjDV/gZfZ+JMN5jSdegjWIAG72p3U2KbI6s6ebEcXrXe9zWXY7g6mgm5YcADmtd95YZxQZZGBtecF4f3858UdFcZQ5ATffN5zD80nXML9W5v4= X-Forefront-PRVS: 0098BA6C6C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(23726003)(101416001)(5660300001)(81166006)(86362001)(76176999)(2906002)(50986999)(54356999)(50466002)(106356001)(229853001)(46406003)(8666005)(42186005)(7736002)(4326007)(53416004)(66066001)(33646002)(7416002)(7846002)(81156014)(19580395003)(105586002)(305945005)(36756003)(2950100002)(47776003)(8676002)(189998001)(6116002)(3846002)(68736007)(586003)(92566002)(69596002)(4001350100001)(5001770100001)(19580405001)(97736004)(83506001)(77096005)(7059030)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1444; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR0601MB1444; 23:3HkdhOdzettNCNnVjfNAqmXWa/mszLGObuurxoY?= =?us-ascii?Q?Ny1MZ68eHi8ggxxmhTCteu0Ou+pPGBHI6hhBFzBherES44rFCcY0MIFUGSrx?= =?us-ascii?Q?ecZ8YW+CxPuFuFUh8tu0j3zngcCVjprktWRWVqmWwjzJlZANHOTU6DZsTCwr?= =?us-ascii?Q?bhHR09vIPfv4jwC/wbUQ6kgBb6m37Xlkrxm4um5jxnYdD016YY9gqYI0ThYb?= =?us-ascii?Q?2dCg/PSRMQGw6HZZx64ILlynzFO8jN5rdaVBecQwaAVbLt/PtZjhRxHBQwFG?= =?us-ascii?Q?/BPV90OEZLj5bGsJkWyOnHLX7zov41ual2NFRZOP2Y5tr3v1888U7OwVt/N+?= =?us-ascii?Q?LwS4L3VGEOSYkR8ZduGzOvtlw9h7YMhZIO8DqQ1bg8/WR1LS3KoVJcw35xSj?= =?us-ascii?Q?aLni6owFtX/zYGRbLqCMr15ypcuuu27ihFQDVQJyKe8kGX2BoTnEBQH7Vj1q?= =?us-ascii?Q?71f+FXI1Z08h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jWR8Da7ACABM91d48jJ0MPfoS3OFzpIjb7aYxCDd4UdMqTbWyGnEEM46IWUf1Wh5ATfExjxIq5JLKa8ZzrS68g0kEDuSOPzkI5QwciAIag/GxnIh+8/pAn/2irtNzBq/aFRckaBHCy39fuJCA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2016 08:33:23.8006 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1444 Cc: Linux-DT , Linux-ALSA , Liam Girdwood , Linux-Kernel , Simon , Laurent , Grant Likely , Frank Rowand , Guennadi Subject: [alsa-devel] [PATCH 05/23] ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_simple_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 It is assuming that the card related information is located on "card" node, but graph case doesn't have it. This patch adds node parameter to adjust for graph support Signed-off-by: Kuninori Morimoto --- include/sound/soc.h | 8 ++++++-- sound/soc/soc-core.c | 9 ++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index d100a33..8130b73 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1647,8 +1647,12 @@ void snd_soc_util_exit(void); int snd_soc_of_parse_card_name_from_node(struct snd_soc_card *card, struct device_node *np, const char *propname); -int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, - const char *propname); +#define snd_soc_of_parse_audio_simple_widgets(card, propname)\ + snd_soc_of_parse_audio_simple_widgets_from_node(card, NULL, propname) +int snd_soc_of_parse_audio_simple_widgets_from_node(struct snd_soc_card *card, + struct device_node *np, + const char *propname); + int snd_soc_of_parse_tdm_slot(struct device_node *np, unsigned int *tx_mask, unsigned int *rx_mask, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 088a158..e56ea42 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3462,14 +3462,17 @@ static const struct snd_soc_dapm_widget simple_widgets[] = { SND_SOC_DAPM_SPK("Speaker", NULL), }; -int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, +int snd_soc_of_parse_audio_simple_widgets_from_node(struct snd_soc_card *card, + struct device_node *np, const char *propname) { - struct device_node *np = card->dev->of_node; struct snd_soc_dapm_widget *widgets; const char *template, *wname; int i, j, num_widgets, ret; + if (!np) + np = card->dev->of_node; + num_widgets = of_property_count_strings(np, propname); if (num_widgets < 0) { dev_err(card->dev, @@ -3540,7 +3543,7 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, return 0; } -EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets); +EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets_from_node); static int snd_soc_of_get_slot_mask(struct device_node *np, const char *prop_name,