mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: soc-component: move snd_soc_lookup_component() to soc-component.c
struct snd_soc_component will be capsuled soon, its member will not be able to access from non soc-component.c. Move snd_soc_lookup_component() to soc-component.c It renames function name snd_soc_lookup_component_nolocked() -> snd_soc_component_lookup_nolock() snd_soc_lookup_component() -> snd_soc_component_lookup() snd_soc_lookup_component_by_name() -> snd_soc_component_lookup_by_name() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/878q41yokz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8c186bc6b7
commit
1fec554d55
|
|
@ -289,6 +289,11 @@ void snd_soc_component_set_aux(struct snd_soc_component *component,
|
|||
int snd_soc_component_init(struct snd_soc_component *component);
|
||||
int snd_soc_component_is_dummy(struct snd_soc_component *component);
|
||||
|
||||
struct snd_soc_component *snd_soc_component_lookup_nolock(struct device *dev,
|
||||
const char *driver_name);
|
||||
struct snd_soc_component *snd_soc_component_lookup(struct device *dev, const char *driver_name);
|
||||
struct snd_soc_component *snd_soc_component_lookup_by_name(const char *component_name);
|
||||
|
||||
/* component IO */
|
||||
unsigned int snd_soc_component_read(struct snd_soc_component *component,
|
||||
unsigned int reg);
|
||||
|
|
@ -441,5 +446,8 @@ void snd_soc_pcm_component_delay(struct snd_pcm_substream *substream,
|
|||
|
||||
/* REMOVE ME */
|
||||
#define snd_soc_component_cache_sync snd_soc_component_regmap_cache_sync
|
||||
#define snd_soc_lookup_component_nolocked snd_soc_component_lookup_nolock
|
||||
#define snd_soc_lookup_component snd_soc_component_lookup
|
||||
#define snd_soc_lookup_component_by_name snd_soc_component_lookup_by_name
|
||||
|
||||
#endif /* __SOC_COMPONENT_H */
|
||||
|
|
|
|||
|
|
@ -457,11 +457,6 @@ int devm_snd_soc_register_component(struct device *dev,
|
|||
#define snd_soc_unregister_component(dev) snd_soc_unregister_component_by_driver(dev, NULL)
|
||||
void snd_soc_unregister_component_by_driver(struct device *dev,
|
||||
const struct snd_soc_component_driver *component_driver);
|
||||
struct snd_soc_component *snd_soc_lookup_component_nolocked(struct device *dev,
|
||||
const char *driver_name);
|
||||
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
|
||||
const char *driver_name);
|
||||
struct snd_soc_component *snd_soc_lookup_component_by_name(const char *component_name);
|
||||
|
||||
int soc_new_pcm(struct snd_soc_pcm_runtime *rtd);
|
||||
#ifdef CONFIG_SND_SOC_COMPRESS
|
||||
|
|
|
|||
|
|
@ -1505,3 +1505,51 @@ int snd_soc_component_probe(struct snd_soc_component *component, struct snd_soc_
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct snd_soc_component
|
||||
*snd_soc_component_lookup_nolock(struct device *dev, const char *driver_name)
|
||||
{
|
||||
struct snd_soc_component *component;
|
||||
|
||||
for_each_component(component) {
|
||||
if (dev != component->dev)
|
||||
continue;
|
||||
|
||||
if (!driver_name)
|
||||
return component;
|
||||
|
||||
if (!component->driver->name)
|
||||
continue;
|
||||
|
||||
if (component->driver->name == driver_name)
|
||||
return component;
|
||||
|
||||
if (strcmp(component->driver->name, driver_name) == 0)
|
||||
return component;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_lookup_nolock);
|
||||
|
||||
struct snd_soc_component *snd_soc_component_lookup(struct device *dev,
|
||||
const char *driver_name)
|
||||
{
|
||||
guard(mutex)(&client_mutex);
|
||||
|
||||
return snd_soc_component_lookup_nolock(dev, driver_name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_lookup);
|
||||
|
||||
struct snd_soc_component *snd_soc_component_lookup_by_name(const char *component_name)
|
||||
{
|
||||
struct snd_soc_component *component;
|
||||
|
||||
guard(mutex)(&client_mutex);
|
||||
for_each_component(component)
|
||||
if (strstr(component->name, component_name))
|
||||
return component;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_lookup_by_name);
|
||||
|
|
|
|||
|
|
@ -261,54 +261,6 @@ struct snd_soc_component *snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_rtdcom_lookup);
|
||||
|
||||
struct snd_soc_component
|
||||
*snd_soc_lookup_component_nolocked(struct device *dev, const char *driver_name)
|
||||
{
|
||||
struct snd_soc_component *component;
|
||||
|
||||
for_each_component(component) {
|
||||
if (dev != component->dev)
|
||||
continue;
|
||||
|
||||
if (!driver_name)
|
||||
return component;
|
||||
|
||||
if (!component->driver->name)
|
||||
continue;
|
||||
|
||||
if (component->driver->name == driver_name)
|
||||
return component;
|
||||
|
||||
if (strcmp(component->driver->name, driver_name) == 0)
|
||||
return component;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_lookup_component_nolocked);
|
||||
|
||||
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
|
||||
const char *driver_name)
|
||||
{
|
||||
guard(mutex)(&client_mutex);
|
||||
|
||||
return snd_soc_lookup_component_nolocked(dev, driver_name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
|
||||
|
||||
struct snd_soc_component *snd_soc_lookup_component_by_name(const char *component_name)
|
||||
{
|
||||
struct snd_soc_component *component;
|
||||
|
||||
guard(mutex)(&client_mutex);
|
||||
for_each_component(component)
|
||||
if (strstr(component->name, component_name))
|
||||
return component;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_lookup_component_by_name);
|
||||
|
||||
struct snd_soc_pcm_runtime
|
||||
*snd_soc_get_pcm_runtime(struct snd_soc_card *card,
|
||||
struct snd_soc_dai_link *dai_link)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user