Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758813AbcJQIeV (ORCPT ); Mon, 17 Oct 2016 04:34:21 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:46264 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757612AbcJQIeK (ORCPT ); Mon, 17 Oct 2016 04:34:10 -0400 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="223078668" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <87insr4c3i.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/23] ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_prefix 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:34:02 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR01CA0018.jpnprd01.prod.outlook.com (10.168.40.28) To KL1PR0601MB1447.apcprd06.prod.outlook.com (10.169.69.25) X-MS-Office365-Filtering-Correlation-Id: 4cd9c3d9-670b-47f9-57c7-08d3f6685a25 X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1447;2:w1BbH435QhyLQGAZiNREXGA9M5BN7gTQOlOZMxxpITtUAb62B32VdZQMOd9t/G45qZK0LeunJ7KCh7E2S3BmD4sef5t7AczdBZ5DgpxaaLcs8S8KyxurRLE3Apcerk2psvguoOXPpBBfgaCxACMr0oPgFG+fvR3kdvDz5AN40J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tN120r9M9Tnl0445JLfSefq9kut4Ja5Cgv/QaPWBd8UIuw89nTIubHsYbWSiK/QxT9G35Hn8PozBICZER838XAR3E8fvh8v9c7ce9ikYdXLDtKJRGzBnGk46hOrPnIVHAZ6zzTOS3E5Mv5B0FIznLivKS0QSTUHg9V8oG/aKWZggdfgxbkw1Z7EdrKP1/k74z59BwQAire5ON1QGv0KdqoT64LWVk5LnenVxvdbWjZZFMTzoa04DXFOLV84hmoDX4klxr3AmaJHvdZcy5QnDJJAoYCmTuIfL50OViJof22L/0qtkM2biB3KbDaDqgKuyq0EqBL0DfR6WzpXYhtrvm2ByaiAhRKByzXWI9WSFiXEwahwpJ/wqGmVJMYMEgFtuzBHHNDuBMEKjptMifGTdhGXsURVUE8vRQUF6gKB7cFi7lfaGbJNJ4jlEswyENpfoVj7QrirTJpHNehCguhBcN8IO6we 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:KL1PR0601MB1447;BCL:0;PCL:0;RULEID:;SRVR:KL1PR0601MB1447; X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1447;4:KtVpBZmFLXfaznXcrNNuNSYfj7VnH0EFaJXeY/mQzOji3L9LJrybbwuyrF+e3GIeBnZaP8YiBXcnKsrLFWt9odJ1rpGHFo5CJs1BhmbZ3yOPtzLrN6ues98aSBxTBPCAtq4IG+8Cv9R31Qdyv8C8gqxkRy9jEbbeDOr7vcsThqi1Ku4fxMF3vPQ/BsOJdFnoUpEo/zfMvvPbt5rsQ44iSp8O5PJhWdrPlka4qHnxXRCeG6QRa0+aPPeKE7R5BBMtmjiBIMjEU5zMnwVKf+p/qpvt0tq4lME8c/ATqU0V385xNheGgjEvd/MkZYjKKPRKSnj8tvFecgYrNZRiGggGLxJ1Da6fJxSahoN9gs/XUmB6ELadJ1Jv/frRB+ZABA9N4jjjV8eNSZs2b1W5VuZmgyJ9pd01SoLywNp/0gsaO5U= X-Forefront-PRVS: 0098BA6C6C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(97736004)(5001770100001)(47776003)(7846002)(86362001)(106356001)(305945005)(8666005)(101416001)(50986999)(76176999)(54356999)(3846002)(92566002)(4001350100001)(586003)(33646002)(2950100002)(6116002)(7736002)(77096005)(19580405001)(19580395003)(23726003)(42186005)(7416002)(53416004)(5660300001)(4326007)(8676002)(189998001)(68736007)(81156014)(81166006)(2906002)(50466002)(69596002)(36756003)(105586002)(66066001)(229853001)(46406003)(83506001)(7059030)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:KL1PR0601MB1447;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;KL1PR0601MB1447;23:rlhARw+uNA3z+iDllnYYVuN8NLz6SCsDna9ZqXR?= =?us-ascii?Q?ylw60SwFYMwtilvIMvBLtb7Jjj2kfzsFxamBWm6yzJ6pCkdSEViSgpm+G9aH?= =?us-ascii?Q?s+6qvQ/XHmjPYW/atg+rsqYaM5rz37/2gmf0eD4ZfQi9Q8/CTdpLEkwpXbji?= =?us-ascii?Q?JPP5/Cq2RV0NPLadp8aoJ83oIZ/qa0tPugjB99uUTI5m2EpMAXgJ5T0RG1YJ?= =?us-ascii?Q?/FxL/4hYle7NdWU3cGz48dUg7Kwmkmy+Nyj8IyK/SFa9j1YccKw6v9dy6ueS?= =?us-ascii?Q?jgi4z71FYyYA3NkxzqWlwTPlT1iRa5TrIi+EaTl0tQvg11gE1a8XyYG7ZbDR?= =?us-ascii?Q?tBENBs0xP4i73eixRPaLjZvXQVZBLwIrOtGH44xbMZQM1EcSqGKHGGnMR7cD?= =?us-ascii?Q?lGwlJkiSmSCe7SIZ6AkSOOx+LJKp9LQVGbxt7EU70Nlh33ioxanx8EUMedlR?= =?us-ascii?Q?q94dUR1PK8amkJI+ezSe37XdpIdTHSSReUF7pnn8JJ3PZ2tJhwTWtwCQ8f0X?= =?us-ascii?Q?yykZUvXXGmjyy8BthHsiehgjOJDKg/X+QTsc70zCnksq6IzXR+5QOWjMVfmV?= =?us-ascii?Q?xKIaEySHATgneiZBv9BTgOi/aPdjiNNbpuxPTlLwyMle1/ZZ1OCIuA+meY43?= =?us-ascii?Q?HrrEwgEuSNcPVC8MumLIw5Ywb292lGyuCA+UtijMJZ+CW9j/RX+FUr1bBGLZ?= =?us-ascii?Q?IU9XFd2uqq8hqIx+PUPFqxhfwYXpAEjwbOJnzpdGw19fItPUfIrWp5lYJgiY?= =?us-ascii?Q?FG30CGgXFPTG1zia6ewVWwJU4VdQGUPiHpF2irCuUGzGqZJYXi+V8qd83pW+?= =?us-ascii?Q?Xm88pPGmLaLs6i2s8IhONL5GVhxnh/uUzgZTRzWn+gny0bVm29Gi4K04Y1NY?= =?us-ascii?Q?CfLpAKMneFHFmJ8XWamymDdNDH9X9t177tGYSySqGRHfEnJOTcqA7mmh2GJu?= =?us-ascii?Q?OqKHO4RfyIfVW6QzVVzrdoEvR6IEoW95KJ9zMts+uBe3FSDhfXBm1zq1dKfb?= =?us-ascii?Q?3c0WRkD+NsohzllD8JFGximPdk7Kud6Z6pnImMu8IRza1KNezjyA3t/juef3?= =?us-ascii?Q?yh9LI7pvP9A0jdg+r3CquOikslcXRLgFz106q/wexSw/vcx2/iT8dNfctETt?= =?us-ascii?Q?Sii5B2DNwssv4KBn3uzIR+q8wy9toQod0uJlseC2VFlVrVOzt5WsMgdHOg4q?= =?us-ascii?Q?Togkilfb2gfA3CEdKCnhU31FRyilLn529lvgPsB684xxoW0eQLzfHGP9jjTf?= =?us-ascii?Q?8/c/wH79EzUeeUy+bWoo=3D?= X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1447;6:AUUhaHremDTbd7HMkSIIW4kiTo5lH3PTohAZDSvbXb6O7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k0OGgEB9FSQBRIcPWNCyr5/sZAL7rENqDSQypvXqb7JO+bfwDCxKhBZtD/fiDojcppU00UyBnEXuMoavz9nbqS0itMmc1tButQbOJMK/fANq7PxZB6VDgEGv1rE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2016 08:34:02.7049 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1447 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2351 Lines: 65 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 | 6 +++++- sound/soc/soc-core.c | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 3cb36d8..fd63d23 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1658,7 +1658,11 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, unsigned int *rx_mask, unsigned int *slots, unsigned int *slot_width); -void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, +#define snd_soc_of_parse_audio_prefix(card, codec_conf, of_node, propname) \ + snd_soc_of_parse_audio_prefix_from_node(card, NULL, codec_conf, \ + of_node, propname) +void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card, + struct device_node *np, struct snd_soc_codec_conf *codec_conf, struct device_node *of_node, const char *propname); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 79a1045..8371488 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3599,15 +3599,18 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, } EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot); -void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, +void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card, + struct device_node *np, struct snd_soc_codec_conf *codec_conf, struct device_node *of_node, const char *propname) { - struct device_node *np = card->dev->of_node; const char *str; int ret; + if (!np) + np = card->dev->of_node; + ret = of_property_read_string(np, propname, &str); if (ret < 0) { /* no prefix is not error */ @@ -3617,7 +3620,7 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, codec_conf->of_node = of_node; codec_conf->name_prefix = str; } -EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix); +EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix_from_node); int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card, struct device_node *np, -- 1.9.1