]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - sound/soc/soc-core.c
ASoC: Split component registration into two steps
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 16 Jun 2014 16:13:03 +0000 (18:13 +0200)
committerMark Brown <broonie@linaro.org>
Sat, 21 Jun 2014 20:05:13 +0000 (21:05 +0100)
commitbb13109d85ba5f8009f1a26d840e70198537a4e3
tree9728f97f94c4bdc1580de3723cc59c009975adc5
parentf4333203ec933f9272c90c7add01774ec2cf94d3
ASoC: Split component registration into two steps

Split snd_soc_component_register() into snd_soc_component_initialize() and
snd_soc_component_add(). Using a 2-stage registration approach has the advantage
that it is possible to modify the component after it has been initialized, but
before it is made visible to the system. This e.g. allows CODECs or platforms to
overwrite some of the default settings made in snd_soc_component_initialize().

Similar snd_soc_component_unregister() is split into two steps as well,
snd_soc_component_delete(), which removes the component from the system, and
snd_soc_component_cleanup(), which frees all the resources allocated by the
component.

Furthermore this patch makes sure that if a component is visible on two list
(e.g. the component list and the CODEC list) it is added or removed to both
lists atomically.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-core.c