Commit 08ff7209faf21daa01bf66c91c321ce52d4b4bdb
Committed by
Mark Brown
1 parent
14e5ad7d11
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: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20200731144146.6678-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Showing 4 changed files with 20 additions and 19 deletions Side-by-side Diff
include/sound/soc-component.h
... | ... | @@ -325,9 +325,6 @@ |
325 | 325 | return regcache_sync(component->regmap); |
326 | 326 | } |
327 | 327 | |
328 | -int snd_soc_component_initialize(struct snd_soc_component *component, | |
329 | - const struct snd_soc_component_driver *driver, | |
330 | - struct device *dev, const char *name); | |
331 | 328 | void snd_soc_component_set_aux(struct snd_soc_component *component, |
332 | 329 | struct snd_soc_aux_dev *aux); |
333 | 330 | int snd_soc_component_init(struct snd_soc_component *component); |
include/sound/soc.h
... | ... | @@ -414,6 +414,9 @@ |
414 | 414 | } |
415 | 415 | #endif |
416 | 416 | int snd_soc_poweroff(struct device *dev); |
417 | +int snd_soc_component_initialize(struct snd_soc_component *component, | |
418 | + const struct snd_soc_component_driver *driver, | |
419 | + struct device *dev, const char *name); | |
417 | 420 | int snd_soc_add_component(struct device *dev, |
418 | 421 | struct snd_soc_component *component, |
419 | 422 | const struct snd_soc_component_driver *component_driver, |
sound/soc/soc-component.c
... | ... | @@ -33,22 +33,6 @@ |
33 | 33 | return ret; |
34 | 34 | } |
35 | 35 | |
36 | -int snd_soc_component_initialize(struct snd_soc_component *component, | |
37 | - const struct snd_soc_component_driver *driver, | |
38 | - struct device *dev, const char *name) | |
39 | -{ | |
40 | - INIT_LIST_HEAD(&component->dai_list); | |
41 | - INIT_LIST_HEAD(&component->dobj_list); | |
42 | - INIT_LIST_HEAD(&component->card_list); | |
43 | - mutex_init(&component->io_mutex); | |
44 | - | |
45 | - component->name = name; | |
46 | - component->dev = dev; | |
47 | - component->driver = driver; | |
48 | - | |
49 | - return 0; | |
50 | -} | |
51 | - | |
52 | 36 | void snd_soc_component_set_aux(struct snd_soc_component *component, |
53 | 37 | struct snd_soc_aux_dev *aux) |
54 | 38 | { |
sound/soc/soc-core.c
... | ... | @@ -2438,6 +2438,23 @@ |
2438 | 2438 | list_del(&component->list); |
2439 | 2439 | } |
2440 | 2440 | |
2441 | +int snd_soc_component_initialize(struct snd_soc_component *component, | |
2442 | + const struct snd_soc_component_driver *driver, | |
2443 | + struct device *dev, const char *name) | |
2444 | +{ | |
2445 | + INIT_LIST_HEAD(&component->dai_list); | |
2446 | + INIT_LIST_HEAD(&component->dobj_list); | |
2447 | + INIT_LIST_HEAD(&component->card_list); | |
2448 | + mutex_init(&component->io_mutex); | |
2449 | + | |
2450 | + component->name = name; | |
2451 | + component->dev = dev; | |
2452 | + component->driver = driver; | |
2453 | + | |
2454 | + return 0; | |
2455 | +} | |
2456 | +EXPORT_SYMBOL_GPL(snd_soc_component_initialize); | |
2457 | + | |
2441 | 2458 | int snd_soc_add_component(struct device *dev, |
2442 | 2459 | struct snd_soc_component *component, |
2443 | 2460 | const struct snd_soc_component_driver *component_driver, |