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);
+
/* component IO */
int snd_soc_component_read(struct snd_soc_component *component,
unsigned int reg, unsigned int *val);
#include <linux/module.h>
#include <sound/soc.h>
+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;
+}
+
/**
* snd_soc_component_set_sysclk - configure COMPONENT system or master clock.
* @component: COMPONENT
return ret;
}
-static int snd_soc_component_initialize(struct snd_soc_component *component,
- const struct snd_soc_component_driver *driver, struct device *dev)
-{
- 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 = fmt_single_name(dev, &component->id);
- if (!component->name) {
- dev_err(dev, "ASoC: Failed to allocate name\n");
- return -ENOMEM;
- }
-
- component->dev = dev;
- component->driver = driver;
-
- return 0;
-}
-
#define ENDIANNESS_MAP(name) \
(SNDRV_PCM_FMTBIT_##name##LE | SNDRV_PCM_FMTBIT_##name##BE)
static u64 endianness_format_map[] = {
struct snd_soc_dai_driver *dai_drv,
int num_dai)
{
+ const char *name = fmt_single_name(dev, &component->id);
int ret;
int i;
+ if (!name) {
+ dev_err(dev, "ASoC: Failed to allocate name\n");
+ return -ENOMEM;
+ }
+
mutex_lock(&client_mutex);
- ret = snd_soc_component_initialize(component, component_driver, dev);
+ ret = snd_soc_component_initialize(component, component_driver,
+ dev, name);
if (ret)
goto err_free;