diff options
author | Jarkko Nikula <jhnikula@gmail.com> | 2010-11-25 10:47:38 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-30 09:39:00 -0500 |
commit | 2eea392d0a28a0a07d36a9da544eb40f81bf4cb6 (patch) | |
tree | 6eebdb530c1d73fdf60cb0408f1f1808d47a6b20 /include/sound/soc.h | |
parent | 09c74a9d0b0bedff16d0881db8cc0054a5e34f47 (diff) |
ASoC: Add support for optional auxiliary dailess codecs
This makes possible to register auxiliary dailess codecs in a machine
driver. Term dailess is used here for amplifiers and codecs without DAI or
DAI being unused.
Dailess auxiliary codecs are kept in struct snd_soc_aux_dev and those codecs
are probed after initializing the DAI links. There are no major differences
between DAI link codecs and dailess codecs in ASoC core point of view. DAPM
handles them equally and sysfs and debugfs directories for dailess codecs
are similar except the pmdown_time node is not created.
Only suspend and resume functions are modified to traverse all probed codecs
instead of DAI link codecs.
Example below shows a dailess codec registration.
struct snd_soc_aux_dev foo_aux_dev[] = {
{
.name = "Amp",
.codec_name = "codec.2",
.init = foo_init2,
},
};
static struct snd_soc_card card = {
...
.aux_dev = foo_aux_dev,
.num_aux_devs = ARRAY_SIZE(foo_aux_dev),
};
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 9e593cf1440b..4a9195c5ef2d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -583,6 +583,14 @@ struct snd_soc_prefix_map { | |||
583 | const char *name_prefix; | 583 | const char *name_prefix; |
584 | }; | 584 | }; |
585 | 585 | ||
586 | struct snd_soc_aux_dev { | ||
587 | const char *name; /* Codec name */ | ||
588 | const char *codec_name; /* for multi-codec */ | ||
589 | |||
590 | /* codec/machine specific init - e.g. add machine controls */ | ||
591 | int (*init)(struct snd_soc_dapm_context *dapm); | ||
592 | }; | ||
593 | |||
586 | /* SoC card */ | 594 | /* SoC card */ |
587 | struct snd_soc_card { | 595 | struct snd_soc_card { |
588 | const char *name; | 596 | const char *name; |
@@ -624,6 +632,15 @@ struct snd_soc_card { | |||
624 | struct snd_soc_prefix_map *prefix_map; | 632 | struct snd_soc_prefix_map *prefix_map; |
625 | int num_prefixes; | 633 | int num_prefixes; |
626 | 634 | ||
635 | /* | ||
636 | * optional auxiliary devices such as amplifiers or codecs with DAI | ||
637 | * link unused | ||
638 | */ | ||
639 | struct snd_soc_aux_dev *aux_dev; | ||
640 | int num_aux_devs; | ||
641 | struct snd_soc_pcm_runtime *rtd_aux; | ||
642 | int num_aux_rtd; | ||
643 | |||
627 | struct work_struct deferred_resume_work; | 644 | struct work_struct deferred_resume_work; |
628 | 645 | ||
629 | /* lists of probed devices belonging to this card */ | 646 | /* lists of probed devices belonging to this card */ |