ASoC: core: add support to card re-bind using component framework

This patch aims at achieving dynamic behaviour of audio card when
the dependent components disappear and reappear.

With this patch the card is removed if any of the dependent component
is removed and card is added back if the dependent component comes back.
All this is done using component framework and matching based on
component name.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Srinivas Kandagatla 2018-07-13 16:36:28 +01:00 committed by Mark Brown
parent 19e023e3be
commit bb4b894add
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
2 changed files with 69 additions and 0 deletions

View file

@ -17,6 +17,7 @@
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/component.h>
#include <linux/regmap.h>
#include <linux/log2.h>
#include <sound/core.h>
@ -1090,6 +1091,12 @@ struct snd_soc_card {
struct work_struct deferred_resume_work;
/* component framework related */
bool components_added;
/* set in machine driver to enable/disable auto re-binding */
bool auto_bind;
struct component_match *match;
/* lists of probed devices belonging to this card */
struct list_head component_dev_list;