From e000f4e8d5ffaff5915c84e031536a8bc5a03eed Mon Sep 17 00:00:00 2001 From: Banajit Goswami Date: Thu, 20 Aug 2015 18:52:39 -0700 Subject: [PATCH] ANDROID: GKI: ASoC: soc-core: export function to find components Drivers may need to use the ASoC core function to find out whether a particular component is already registered with ALSA core or not. Export the function so that drivers can use it outside of the file. Bug: 151372815 Test: build Change-Id: I13e4a053de085974b0b53c392a9453e46f1aa66d Signed-off-by: Banajit Goswami (cherry picked from commit fbcf71fe2dadcfbfe6b60f49534dd0312fd3b9d6) Signed-off-by: Hridya Valsaraju --- include/sound/soc.h | 2 ++ sound/soc/soc-core.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index b6a504e07309..81db2139a254 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1354,6 +1354,8 @@ int snd_soc_component_update_bits_async(struct snd_soc_component *component, void snd_soc_component_async_complete(struct snd_soc_component *component); int snd_soc_component_test_bits(struct snd_soc_component *component, unsigned int reg, unsigned int mask, unsigned int value); +struct snd_soc_component *soc_find_component( + const struct device_node *of_node, const char *name); /* component wide operations */ int snd_soc_component_set_sysclk(struct snd_soc_component *component, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 8008dc7098c4..7fdc2f99d7f6 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -718,7 +718,17 @@ EXPORT_SYMBOL_GPL(snd_soc_resume); static const struct snd_soc_dai_ops null_dai_ops = { }; -static struct snd_soc_component *soc_find_component( +/** + * soc_find_component: find a component from component_list in ASoC core + * + * @of_node: of_node of the component to query. + * @name: name of the component to query. + * + * function to find out if a component is already registered with ASoC core. + * + * Returns component handle for success, else NULL error. + */ +struct snd_soc_component *soc_find_component( const struct device_node *of_node, const char *name) { struct snd_soc_component *component; @@ -736,6 +746,7 @@ static struct snd_soc_component *soc_find_component( return NULL; } +EXPORT_SYMBOL(soc_find_component); /** * snd_soc_find_dai - Find a registered DAI