Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757783AbcJQIdW (ORCPT ); Mon, 17 Oct 2016 04:33:22 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:36938 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757808AbcJQIdL (ORCPT ); Mon, 17 Oct 2016 04:33:11 -0400 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="223078548" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <87mvi34c51.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 04/23] ASoC: soc-core: adjust for graph on snd_soc_of_parse_card_name 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:05 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0034.jpnprd01.prod.outlook.com (10.164.162.16) To HK2PR0601MB1441.apcprd06.prod.outlook.com (10.165.182.147) X-MS-Office365-Filtering-Correlation-Id: 0dffa459-1275-4f2a-4d42-08d3f6683823 X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;2:OtKNvHgr175ENfokd8jLSYNLluoZKFyfTTktRjJLmSF2oO1tFEgpG5B551dcswrNm8Gpa+wc9aQZBHTaKwucPQ5IGG4v0rBx3Gqs0pJljcxP7ej+sg6bXRx+qd5lEgfXW9ReDUvun9ImpJmYAaerwx5sQJ1wDbrlLqqN0Vkin4OjqxcIvF3ssuH7TBZulq/x1lR1q7PIcWuKCctY2cEYkA==;3:0D4XMjIER1AfDSLDx7JFbXViV3y/TZpjVoXwf1He8LebWLVbqhbtYNuWZeELhFh0OzEv0SCG549mprWhvW9HB/sz3ibkD/T2esattghNJA+LMLu4uRRFm3S7UD3WqcUdG6LInyzJSmzNYFiPNpBoNQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR0601MB1441; X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;25:NGB2GIMg6mieF6TBazzus+7BC0kRn8yM2gnRAzHyN8yVYDJwbDg4qsgZmNq4CKIftMZ78sXk3rhNLHpxszWVdlRhZdVW0yaJ0lR5zmhQd6LgrHhjYvf8aTEOOjKnPTvidzPt5VMwsq59C/GEvtTW/Vx+K2EEwJVdtHcvxoMaxgOCbbDp8ejsJekVh/cATbs0+BU9gR9HbGEvC2hV55VMiTCmby0Aj4aElPFdRftbV4Od6XS3qiyYaCMmKWj40XJaz9VnVLuTQWxLS6+DJQi4T/tgdmm+8lFstr/U6yHr2VwE2wjGtJdo8+CiTdSAxZ5G/+lwYB5rAlgXwNqwz/J6D8YBLZa0JrF1URyvXsmOjMlDvvaG3/6D7A/q6rXH+svd9J1hxEG035hqSNM3GmpyTNlcVrLDuOpwlP29/wUidpU3MZqx+mISxKWgbm7DQbjbR6apQ3aVW1mMea+2pcQK5a2Tn+jjOsyZJO8fyAY8sjMk3QYZ086sjMH0YaDtZG4+UmqpBlc+sczt8qL8vtovTzYY7tJxkXHv1hbb4TSnFEDi1H33iBUf0sDv9lp+ynyv1eNAw4cmSLUa4gQrqnUBQzwDM30uCcRyWt74Nq72iV3M7igXSj0agEzHnkmXvLwQb3ZDK1WVMvGZuWDditvITTSg73RhW+tPMPp953y/lRAsPM3MDe6MYnJLn5Fg/4cnawgQ+fOuAp9MTfpmc6uT7A== X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;31:UjUryVb8w/xRVefjVY51CLoFBSa1BFF47jSHYRUnHow92ZXRLHhmt9G9sxmFofLHgBjcQb67j9xuRh6geXw4Zi1jtvI0Cn6EqoSMj3wgGZz1vvxqh0oNl2x9ixTfM134Xmr/Lag3HQ8zlHJFyvVRO8ZEWsS0GX7YLEJtem/POeQ0/R6wazC1StadsSjY7UXm1l28Tg2/6e6Ub1pUb3L2unaCCeOGEH59868QPRDbKxfIHexLLarzM27NpXr05xfL;20:b4NHThM3kJhrdW16CFlUyvXCspK3f4nYrQj1q9L0pIS7iq74KAzTocqiKzLYYTsi2A80n39dj5Qvo9hJaRKNJqCwkTIRmToEPnmrxizLjAQEG4PLjs4vuih1hkb7476imCzCSkfaSnnKjl8OVayMTYtGsHLESIg2rET8mTki1XEIrx8tv0IS38UWFtv67I7kWKf6dIyNye96sk5AtLemKmr94HSGQhIugJe/BMDmqm1LhizWSov4lL1ZX84367Yx5mTnw2sGau5bIqRurIAyeMJTPFPnawW8zsc093v3x5LaytuUXut5AV5pKwi+4D6ydOwM+01qoerf05SnGdCAujffaueNHdZyB5u5D3Eq1H7WglQCRKduEqDk2XHwd6+xD+O9/PBGgy7P9rk5AOqi9VBms1/EZul31e2tvNV3MjWWw0L0ZWB6emtPqNKipFj0QkCWto9jBevCZ8ISoIpbvD7LmQ5dgvMT2scayYZoG/TCDOIKDQU/P85u+JFoX/1N 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:wQL68oQPzpdTwbe43KWa62traylEL6qVb8U3xqsw+MgAf1EMg9m9nCS7EPwtdCC49NqQWUseNbMTjMxvX/gtqFrgwJIWqeG2+yfXEVTX1e7qHOeUxkUlRkVrWGf5WZZt0dUXlHF8pYYvQkOjFosDbElLesDSxSzsCSV8Gk1WynDD5+Q2gYyifA4rL7N+0WMtjcXjSiiHaEjunA2aodeS6LCSo73TEUssOesw4L+QL4PsV+5yMZwL4juONJ1issVovjKU9seu35VW9075AfthlvhZkSfPICTub8cljoQGd/DtZF/HX0wMy/d6OFC8IMYwmjkBBC6OAUt6aNboqOAm8sbAnHjIvSuZ8X0x8aNrjgd5V2KIo6vOyVztH5oyltVN3+iuwz0n3v01trJl5y96HzrugocUmgZxjqru0ICIHBE= X-Forefront-PRVS: 0098BA6C6C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(92566002)(97736004)(8666005)(575784001)(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:H/bNvH0Xp1kl+9nleA5Q1bciQI6tZ7E1KjOQVcY?= =?us-ascii?Q?tyTEJd/eMndRdxNsbq/kYwunGFO6cjJ7sDXRHq98fppslEwk4/STd3kjhuzl?= =?us-ascii?Q?gz+5l7IgqLVPzaNZzBY+ekXOZn2qUKpLZVBpAduy6Wbi7EkMS50EqmbCiSuq?= =?us-ascii?Q?bxRMyjbUkZHNRYin0srWd471uJv1fivanunsy4pr3G7c7giVd6JyqUF6YNCJ?= =?us-ascii?Q?FRlmyZNHu4PqINB7YEVoUG862to3d1VzO71OVcDS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fbEAPu2tgs7eK6R5rufoDEWGc8sYmkHGri4AnFoUKA6nY270?= =?us-ascii?Q?Ii+8vfQCJqS49XdakbkM7LnQhMLYPvgfnXGK41Kv3RrFZ3B0Mt6yGUIf5qWR?= =?us-ascii?Q?M7hAvk1TCdKT7+KQFB6UIemBftC8R3JvqTfrd5t31?= X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;6:jpKJwsmUpEGpZTD9tZkhRvBP1P23P3vsuT/hkAxFOEruloRZfec+d4rrdUG6UYE6BWsdaGw7R5doPrvDozTj6NCtFUs+zOiGt4lZNhZ6/Uu9yX3Q+Yu/DAmxyMZ40BLWFeQ3EEJV3U7GndGn0SjRCTIRqQMIaOkB9RHSgSPQLGhH5KU+nNxK11ITw42owLfWQvqR2W9koMLXJScPCmLsC3gwWjZQ9hn3SCCqJfHsoXbhKBEsA6sYqfVMF+JydhSzWbDXuMukBs9UVh2op33Lb1R03vq/QPQFkjhC7IhPC+jxi2X0RjIBjPR7zQ5vHlN777wwgOO06rE0rp0NFdiie9X9WFXi7S8EKmVAWjPzzQ4=;5:NVnU1+IJtW2aixBblS5/RSrwx9HMoAyQ2AgOUfCTud13jT5U6S48MZaCtN8dN7qHyIlfGvcZmMCMZZWwOMiDOtsCVxz+OYC7wRqF0OtsAJ53DOxttvTZfS0fwbiBSERuh+dqipE+Kd4RbVvsAzp5t/UIGUXOnb7N6q9gD1rtXBo=;24:61icPbyoU1Xbl5AI7EVMmwG4S94nhMR8rAqrV4GY0h1BrHi1pxw8+qeclquORCziCnQ7faw/PIXIW9b9eANyF1Au+miObX2IuefFEEokJ10= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HK2PR0601MB1441;7:R/FXzofO6FwSRkw3iYorB5kKM7jIi/7co/t6yWzlYoxm2Z7YeXVw0kqdwi6hiUAuJxJtK54vi7UrqIWhM5696GDAHR/36c99DjrhlcbFeIl0uioM0jyuWoMshYQaT54R7phvtKWGaHsO4Iwcyc68JU63cTsBFBqSeIk6UJQMR3kyBsty6iese+LzosEJDNP20zQZ32F6oRBp0QORoQlOGlOIr/0VVChrbIV8WHdk/fwsKzVFN+7/M05C+sOuFps0d3P5Fbg4OE/ynBdbibkIM2PQIuVifqCFBpC0l4vKq1rXwK3RV3sT3z0LXgETt8A9Wpee5qEXWmLr6XxtfRH1j5Hhwg5ZC7CWlAVUSQsl5Pc=;20:w4UfF4EYV5JzZyNzOxeO0R3lQhv+cqmsn/bq6pUl3mq7OvQb9JevU2NT+oJK8e0C1rU4GUif2k/PQVs/Z2nXToykk+JDVD66HmYvdiWKWyw4rU6pGcKNai6hmAejwzB/JRNlu35lX+0G8oPpRB3gnpJRdY5jDIQSyNTTpf5tLFo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2016 08:33:05.8062 (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: 2323 Lines: 69 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 | 7 +++++-- sound/soc/soc-core.c | 11 ++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 4f1c784..d100a33 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1642,8 +1642,11 @@ static inline struct snd_soc_platform *snd_soc_kcontrol_platform( int snd_soc_util_init(void); void snd_soc_util_exit(void); -int snd_soc_of_parse_card_name(struct snd_soc_card *card, - const char *propname); +#define snd_soc_of_parse_card_name(card, propname) \ + snd_soc_of_parse_card_name_from_node(card, NULL, propname) +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); int snd_soc_of_parse_tdm_slot(struct device_node *np, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c0bbcd9..088a158 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3424,10 +3424,10 @@ found: EXPORT_SYMBOL_GPL(snd_soc_unregister_codec); /* Retrieve a card's name from device tree */ -int snd_soc_of_parse_card_name(struct snd_soc_card *card, - const char *propname) +int snd_soc_of_parse_card_name_from_node(struct snd_soc_card *card, + struct device_node *np, + const char *propname) { - struct device_node *np; int ret; if (!card->dev) { @@ -3435,7 +3435,8 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card, return -EINVAL; } - np = card->dev->of_node; + if (!np) + np = card->dev->of_node; ret = of_property_read_string_index(np, propname, 0, &card->name); /* @@ -3452,7 +3453,7 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card, return 0; } -EXPORT_SYMBOL_GPL(snd_soc_of_parse_card_name); +EXPORT_SYMBOL_GPL(snd_soc_of_parse_card_name_from_node); static const struct snd_soc_dapm_widget simple_widgets[] = { SND_SOC_DAPM_MIC("Microphone", NULL), -- 1.9.1