Commit 08ff7209 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Mark Brown

ASoC: core: Relocate and expose snd_soc_component_initialize

To allow for two-step component registration, expose
snd_soc_component_initialize function and move it back to soc-core.c.
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200731144146.6678-2-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 14e5ad7d
...@@ -325,9 +325,6 @@ static inline int snd_soc_component_cache_sync( ...@@ -325,9 +325,6 @@ static inline int snd_soc_component_cache_sync(
return regcache_sync(component->regmap); return regcache_sync(component->regmap);
} }
int snd_soc_component_initialize(struct snd_soc_component *component,
const struct snd_soc_component_driver *driver,
struct device *dev, const char *name);
void snd_soc_component_set_aux(struct snd_soc_component *component, void snd_soc_component_set_aux(struct snd_soc_component *component,
struct snd_soc_aux_dev *aux); struct snd_soc_aux_dev *aux);
int snd_soc_component_init(struct snd_soc_component *component); int snd_soc_component_init(struct snd_soc_component *component);
......
...@@ -414,6 +414,9 @@ static inline int snd_soc_resume(struct device *dev) ...@@ -414,6 +414,9 @@ static inline int snd_soc_resume(struct device *dev)
} }
#endif #endif
int snd_soc_poweroff(struct device *dev); int snd_soc_poweroff(struct device *dev);
int snd_soc_component_initialize(struct snd_soc_component *component,
const struct snd_soc_component_driver *driver,
struct device *dev, const char *name);
int snd_soc_add_component(struct device *dev, int snd_soc_add_component(struct device *dev,
struct snd_soc_component *component, struct snd_soc_component *component,
const struct snd_soc_component_driver *component_driver, const struct snd_soc_component_driver *component_driver,
......
...@@ -33,22 +33,6 @@ static inline int _soc_component_ret(struct snd_soc_component *component, ...@@ -33,22 +33,6 @@ static inline int _soc_component_ret(struct snd_soc_component *component,
return ret; return ret;
} }
int snd_soc_component_initialize(struct snd_soc_component *component,
const struct snd_soc_component_driver *driver,
struct device *dev, const char *name)
{
INIT_LIST_HEAD(&component->dai_list);
INIT_LIST_HEAD(&component->dobj_list);
INIT_LIST_HEAD(&component->card_list);
mutex_init(&component->io_mutex);
component->name = name;
component->dev = dev;
component->driver = driver;
return 0;
}
void snd_soc_component_set_aux(struct snd_soc_component *component, void snd_soc_component_set_aux(struct snd_soc_component *component,
struct snd_soc_aux_dev *aux) struct snd_soc_aux_dev *aux)
{ {
......
...@@ -2438,6 +2438,23 @@ static void snd_soc_del_component_unlocked(struct snd_soc_component *component) ...@@ -2438,6 +2438,23 @@ static void snd_soc_del_component_unlocked(struct snd_soc_component *component)
list_del(&component->list); list_del(&component->list);
} }
int snd_soc_component_initialize(struct snd_soc_component *component,
const struct snd_soc_component_driver *driver,
struct device *dev, const char *name)
{
INIT_LIST_HEAD(&component->dai_list);
INIT_LIST_HEAD(&component->dobj_list);
INIT_LIST_HEAD(&component->card_list);
mutex_init(&component->io_mutex);
component->name = name;
component->dev = dev;
component->driver = driver;
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_component_initialize);
int snd_soc_add_component(struct device *dev, int snd_soc_add_component(struct device *dev,
struct snd_soc_component *component, struct snd_soc_component *component,
const struct snd_soc_component_driver *component_driver, const struct snd_soc_component_driver *component_driver,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment