Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758787AbcJQIeH (ORCPT ); Mon, 17 Oct 2016 04:34:07 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:52926 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758295AbcJQIds (ORCPT ); Mon, 17 Oct 2016 04:33:48 -0400 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="223078628" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <87k2d74c43.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 06/23] ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_routing User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Rob Herring , Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , Laurent , Guennadi , Grant Likely , Frank Rowand , Linux-DT , Linux-Kernel 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") Content-Type: text/plain; charset="US-ASCII" Date: Mon, 17 Oct 2016 08:33:43 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0045.jpnprd01.prod.outlook.com (10.165.48.155) To HK2PR0601MB1441.apcprd06.prod.outlook.com (10.165.182.147) X-MS-Office365-Filtering-Correlation-Id: a3b8cfeb-8dee-4e37-51f4-08d3f6684e4d X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;2:NTaP96LtpvLKf5j9DRWtGIcH+/pVS22Lr9LhvqPwT/okOo+W+sna/XfKCAC2vux5kgWsJ2WelI0qa8qqOjs8hN4Irc20MIv0tH8DwN0nVy7eYqkWI4ZIJWtg74yTWuQLzGixRb4ws4e9GoC/sBSshXEWy+WLWv7wsz4nWqgGR3Rzp1qyR4Jzlp0J2i0ckzcIUgXkYPCM8uUDf0oE5DT8pg==;3:+DVpmE4dW4vSnSMU6hMImtFA7uRUhNJWVF3C8q+3agHCUt303CXtN5TY4DPdIK7cMKTsb2m7un5PoqIQtGpW0maxcGoUyApf6dgwWd+wn16JBSNwUM6GqCuQxL15ZnV3hbwaTrkKd7AmMhbPKuz9Iw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR0601MB1441; X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;25:wS3SALpOOcmiDK3axGAQ+/dcf+wQQGWcB+iM6eR+cu4e8VpU0QN2ubMaHkXC3p667f2fm6SokC5addMlNupcl8Pm13+hj1XfstMJA4fivZBsmIIGM4lZfR8XdilsXFrjVQt0kPwVFwmfx0gpGvI/x2J55eUCpYxxiU0ZE2FGAcHkfGGFhOrjrAgTguZeWqhWSDHrxFsiN3P5nQ6C8loX09s4oblsF6YFu64ANTrHYUD1blcLz2G9GhrvdOOV9CDKzbhr8b9y1XEc41kjXkne1yp7VQregEiJFQw3sjux308iqSMmDedylwb3HjHPROJas8dH3mxEkBMP1IRyshQiKMJNVT7yuSQ7vzkXPn/KNRFMb+KuO4hfNEbA2F8RHrMAGL78ttaOBi5VLyEktJOWi5UNE5lEnW/MaK1D7nfyS8DzoE1zbsAu1k/OfndAMa3QiyPrNuiqVyA5PgYbjtXKJEvpAFXAFmxBdCOPnfOSmufvu7kauxKbFsvdX7xQsu9kAj66iN06EKLWEvdypyqr56Q2HPmLdRPEfWGIfx5QcHaMI0tK5eRlygATYCCDwKyqo+BWHXfoLQuDMHu+vAEWzwPxDlIdjEwA6YvhZiQLzJh2wOCHNFftcxogIfZ2qcBE91NBjHQztnkG2viSEdiYaRGpbH8yEsQyj48cKly7YhwKISrj6cb80E8uSAlL1NUhqU1bwQgrmz1Uw04K/vcEkQ== X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;31:AA606XfX0dBBZsUHUm6X7SqHy/R6gIeXo1WeE8FMfBCxsSh+y0ZJ33fSi57ZcUDC86k8WIUKzIan4fjYDunUU/wC3Sf/cT2loag++QT8mj3GsZmhq0U0IANU71aMHRTcEpKyR4Q7I9DurcE9z0rw/YT+rPE3PrT8FNrWcrSG7/hpMnemlnm8uwPuHC82QVs4dcQfBYSkLO6Mcj1F1rj/tPfZSYv/ZSJMBQixbKuEccIbSRPwV4YBFGk3qhjEV2CR8/MCJC+5x0YClPapjG+8Rg==;20:Jx+2x1fXPv1fX71ayqit0AE2dqaT0G+Zrz3z44PFqOe/xze8fX+Dj/O97+RGxIDjncP9ONKM/XO1nKVQQQxn+Y8Xw5RcAsUp09ipgnGuPOLWCU6MWvomE/NBBO0qTv4vvEjsgdtX3GSypD5x+GgE0yzk/r7wp9ewN/cHYVMMCDZdSnhMlei3idBZfT+I4FeWwYFUGxvnI2eRaNCVQwql8HF3n4dl0oaSlbougJqdgzsJglIHzpPDKU+UB/09wq2ej7MqWAn7k8MAcHq0btfUcLJYXWr9eLXP/Zx1il88GZy337jgHkgb2L6OuDZHL7pxzuCZUF83kPiS3AyLb1LxrBHu2mOKnChwE7GK/Ok33JkBrYG/UZ3jtRRvyQqucqfdZQd3Nabz6aiYSsdfO0UggdsjjrE1Vq6qriRIxbkgf56EnygiIYlVmdANALHnTMoCOINbYDP1v+loSKle0L9+Z1lvi1cDSDm7lsQr9mZXl7W2xHk20ifX+ndTCzbwxlfK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:HK2PR0601MB1441;BCL:0;PCL:0;RULEID:;SRVR:HK2PR0601MB1441; X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;4:hJsyC0GIZHv7HTfgxAgE2nS3myVjy3Elml6/DCKKfM1ybIqIe/c17AsVwxHn51YzenHPYGT8XFxm292ofZ12d/R/mHAFKwr45NCYzm38OjUeYMZfmtiNvO8H+Ej6trVRBinvRAGwsoA7fEqfYhUicVktrKS7z3yWE+hx+H97EThvRpAEOGfx5VsSf/ehAr+Y9KglmEjTz6BWNm3swl/XR4cWUH+VVNJ4g2KK5v2fbLc4dC1BbQHykQM75ZXKUTqpERK3+/wG77nUUF8ameDZSK/HIJvrEMrEyaLg1D3quoKEgmA1Emq2ERwQy2UlYE6mQ/brS06MGbZqo4758mywADf16W3KAKj9z/OnztWLV9aXL0W5FznfW1acYYR6/KLqCObhEQjec21q7/73zO4CniNDLCXtRNHNFflrsTiTH/4= X-Forefront-PRVS: 0098BA6C6C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(92566002)(97736004)(8666005)(19580395003)(19580405001)(5001770100001)(305945005)(189998001)(2906002)(101416001)(50466002)(105586002)(5660300001)(7736002)(2950100002)(7846002)(6116002)(7416002)(4326007)(54356999)(76176999)(50986999)(229853001)(77096005)(3846002)(42186005)(586003)(68736007)(33646002)(106356001)(8676002)(83506001)(23726003)(53416004)(46406003)(81156014)(81166006)(47776003)(69596002)(86362001)(4001350100001)(66066001)(36756003)(7059030)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:HK2PR0601MB1441;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HK2PR0601MB1441;23:YcSDBm4e/Rx5vK4Xif+dRaEZlHCY4pcvq/jS4Pw?= =?us-ascii?Q?azOqtNu09YubAq0HqTLlzH/daATHYK8XkvFqpawlKcDFTwNV3sK/ydSKIbiZ?= =?us-ascii?Q?+2un6SE5BHutAuPhR8l/7nyVI+WOPmrSMiJY1sv3Icj1owEhb6bwDKqqCWLU?= =?us-ascii?Q?PIpa1sKdJsn609cw0qZnVbJLMO0KOklkurRxhxVsLICrBxaH5kT8hoMOq7rf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KUmDGHLepJrznptT5Yte8XS8SozApfJrTN?= =?us-ascii?Q?OhbA2nKwno8jSsl4/m2wrp/6ylpy/xgDW5njsIotuFUcd/KDsoGvIgzVhFwm?= =?us-ascii?Q?rondpDk+WLE1d8xpxIMmazBxhYGzk6poQZoXNYfM2Uj2w/hyUsmhRWwcFN2I?= =?us-ascii?Q?uCfDY0R0UvhSzEbcvEIA=3D?= X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;6:tNBjs8YY65E/AG/Tb/eSj2FknnxM4t3NI8tsytg3rzYm4zOfLEuGFNpkiie/wWj+XpTPVhUPMg0NVvdVeH/bPxK+LQO82Jf7TLu3KCfOKy4ELicge8kUCb83p8xUFL1Ofm98h34awuw4qa7qZ4LxRwuiV2Z4YKlUCDgwkNQoNrSPOvbg/HiDQyjfQ1QsnLfQCb2g7e6dU7os3qcnf4H/4IpAsEIcoknWEqtUt5kXNG03p4bpuyaMHZutWb53A4yMlAuVPXOTFb/X9JGOX5A7KZ/VNQPbmsBvwTJQvWLNnCvl9l9C518vlWYN1+hGWjEL6dCawjcjS9bTN+j6y6NpsQ==;5:6vRRSbYX5o/M3F5waRAB0u351kRC3+2+XMU8SbA5LjOBCPUlH6FW/2KOMwTx7Ov0Vu1T773OqW2j+yp35VTyPg19h7quJHFyCXp0//OrZbJhUgt+E5Vdx3YhaLRFsEmwlfTvcEplk5BdQHvqvwv0S3t13SOHWLIEagMD7XQUrVQ=;24:ffKXakk+hoNVSjfdQc0lj07twJ3bjrfYpKEA9W1zXhwJ+knNJJ5qL9zfJba4hIe7aH0wfVTPCxtanA/DhTMBnN6GgAHMNapZY9+x0HsZBxs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;7:zNz3fuTanq+AWjb/5fEvJ38upG/B/ortxUNVDUZH3DQICRAycvlg/y6fTohGYE35ghNP3i0R/roEG/hdpOrUwwgS2kyqKd7zKxVxTGwsfHUaOkDdULd4KsQeXizVi4swTKxOw4y3ARbceXDOkXsHJ5xV/zyqfhoLCIKtlyRDt5v9F/o0AUT9C7ppyhf8rcZDiXNhJIX7QGSe+Q0j7WnwabkkGTrG3kjwRRThkD2jWKnPRrxkelnJoZrrWRr8AIIpQSYqSP6ilH08quiMJghlXQQCG73t+6Z2tlSW1SiYqbb2Ej7VzZC4KbAVdPFIjKNIQNnOAhvux+ZMgGkJArDBCJ/Zj3PedDQfZnQLjo04wcQ=;20:SldxcYnA6okTk/KVl2rlBQDr+GZB8wBrzetiYmCB2XuttxqTG6gjv30O8PhVyyaljcJssOjPDPbsCWBZvNXyBPdoju7DBz2RJiro8ePR85L2bb7e7xSs5s9gdZCJeoEf9S6t6edm4xDu1ToVtPSu3Eaa3TbfSPtsVnRbl/tg9zc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2016 08:33:43.1636 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1441 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2343 Lines: 67 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 | 9 +++++++-- sound/soc/soc-core.c | 9 ++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 8130b73..3cb36d8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1662,8 +1662,13 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, struct snd_soc_codec_conf *codec_conf, struct device_node *of_node, const char *propname); -int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, - const char *propname); + +#define snd_soc_of_parse_audio_routing(card, propname) \ + snd_soc_of_parse_audio_routing_from_node(card, NULL, propname) +int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card, + struct device_node *np, + const char *propname); + unsigned int snd_soc_of_parse_daifmt(struct device_node *np, const char *prefix, struct device_node **bitclkmaster, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e56ea42..79a1045 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3619,14 +3619,17 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix); -int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, +int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card, + struct device_node *np, const char *propname) { - struct device_node *np = card->dev->of_node; int num_routes; struct snd_soc_dapm_route *routes; int i, ret; + if (!np) + np = card->dev->of_node; + num_routes = of_property_count_strings(np, propname); if (num_routes < 0 || num_routes & 1) { dev_err(card->dev, @@ -3673,7 +3676,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, return 0; } -EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_routing); +EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_routing_from_node); unsigned int snd_soc_of_parse_daifmt(struct device_node *np, const char *prefix, -- 1.9.1