diff options
author | Mengdong Lin <mengdong.lin@linux.intel.com> | 2016-01-06 00:29:31 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-10 07:46:55 -0500 |
commit | f2ed6b07645ed29c1e090ead2e41066385cba3ea (patch) | |
tree | 82c2254e0b1578b29cd99050e9ebc65fe59ecb34 /include/sound | |
parent | 68003e6cf2bbd239a322bd8a28dacfaf8174fdee (diff) |
ASoC: Make aux_dev more like a generic component
aux_dev is mainly used by the machine driver to specify analog devices,
which are registered as codecs. Making it more like a generic component
can help the machine driver to use it to specify any component with
topology info by name.
Details:
- Remove the stub 'rtd_aux' array from the soc card.
- Add a list 'aux_comp_list' to store the components of aux_devs.
And add a list head 'list_aux' to struct snd_soc_component, for adding
such components to the above list.
- Add a 'init' ops to a component for machine specific init.
soc_bind_aux_dev() will set it to be aux_dev's init. And it will be
called when probing the component.
- soc_bind_aux_dev() will also search components by name of an aux_dev,
since it may not be a codec.
- Move probing of aux_devs before checking new DAI links brought by
topology.
- Move removal of aux_devs later than removal of links. Because topology
of aux components may register DAIs and the DAI drivers will go with
removal of the aux components, we want soc_remove_link_dais() to remove
the DAIs at first.
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 9d1383e8d039..5bc5def6af02 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -787,6 +787,7 @@ struct snd_soc_component { | |||
787 | unsigned int registered_as_component:1; | 787 | unsigned int registered_as_component:1; |
788 | 788 | ||
789 | struct list_head list; | 789 | struct list_head list; |
790 | struct list_head list_aux; /* for auxiliary component of the card */ | ||
790 | 791 | ||
791 | struct snd_soc_dai_driver *dai_drv; | 792 | struct snd_soc_dai_driver *dai_drv; |
792 | int num_dai; | 793 | int num_dai; |
@@ -830,6 +831,9 @@ struct snd_soc_component { | |||
830 | int (*probe)(struct snd_soc_component *); | 831 | int (*probe)(struct snd_soc_component *); |
831 | void (*remove)(struct snd_soc_component *); | 832 | void (*remove)(struct snd_soc_component *); |
832 | 833 | ||
834 | /* machine specific init */ | ||
835 | int (*init)(struct snd_soc_component *component); | ||
836 | |||
833 | #ifdef CONFIG_DEBUG_FS | 837 | #ifdef CONFIG_DEBUG_FS |
834 | void (*init_debugfs)(struct snd_soc_component *component); | 838 | void (*init_debugfs)(struct snd_soc_component *component); |
835 | const char *debugfs_prefix; | 839 | const char *debugfs_prefix; |
@@ -1130,8 +1134,7 @@ struct snd_soc_card { | |||
1130 | */ | 1134 | */ |
1131 | struct snd_soc_aux_dev *aux_dev; | 1135 | struct snd_soc_aux_dev *aux_dev; |
1132 | int num_aux_devs; | 1136 | int num_aux_devs; |
1133 | struct snd_soc_pcm_runtime *rtd_aux; | 1137 | struct list_head aux_comp_list; |
1134 | int num_aux_rtd; | ||
1135 | 1138 | ||
1136 | const struct snd_kcontrol_new *controls; | 1139 | const struct snd_kcontrol_new *controls; |
1137 | int num_controls; | 1140 | int num_controls; |
@@ -1537,6 +1540,7 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | |||
1537 | INIT_LIST_HEAD(&card->widgets); | 1540 | INIT_LIST_HEAD(&card->widgets); |
1538 | INIT_LIST_HEAD(&card->paths); | 1541 | INIT_LIST_HEAD(&card->paths); |
1539 | INIT_LIST_HEAD(&card->dapm_list); | 1542 | INIT_LIST_HEAD(&card->dapm_list); |
1543 | INIT_LIST_HEAD(&card->aux_comp_list); | ||
1540 | } | 1544 | } |
1541 | 1545 | ||
1542 | static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) | 1546 | static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) |