From 0168bf0d130de83cd3532b834237c6228a6158dd Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 7 Jun 2011 16:08:05 +0100 Subject: ASoC: core - Allow components to probe/remove in sequence. Some ASoC components depend on other ASoC components to provide clocks and power resources in order to probe() and vice versa for remove(). Allow components to be ordered so that components can be probed() and removed() in sequences that conform to their dependencies. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- include/sound/soc-dai.h | 4 ++++ include/sound/soc.h | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'include') diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 1bafe95dcf4..5ad5f3a50c6 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -209,6 +209,10 @@ struct snd_soc_dai_driver { struct snd_soc_pcm_stream capture; struct snd_soc_pcm_stream playback; unsigned int symmetric_rates:1; + + /* probe ordering - for components with runtime dependencies */ + int probe_order; + int remove_order; }; /* diff --git a/include/sound/soc.h b/include/sound/soc.h index 74093be6570..d5db87e82c6 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -202,6 +202,16 @@ #define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) +/* + * Component probe and remove ordering levels for components with runtime + * dependencies. + */ +#define SND_SOC_COMP_ORDER_FIRST -2 +#define SND_SOC_COMP_ORDER_EARLY -1 +#define SND_SOC_COMP_ORDER_NORMAL 0 +#define SND_SOC_COMP_ORDER_LATE 1 +#define SND_SOC_COMP_ORDER_LAST 2 + /* * Bias levels * @@ -613,6 +623,10 @@ struct snd_soc_codec_driver { void (*seq_notifier)(struct snd_soc_dapm_context *, enum snd_soc_dapm_type, int); + + /* probe ordering - for components with runtime dependencies */ + int probe_order; + int remove_order; }; /* SoC platform interface */ @@ -636,6 +650,10 @@ struct snd_soc_platform_driver { /* platform stream ops */ struct snd_pcm_ops *ops; + + /* probe ordering - for components with runtime dependencies */ + int probe_order; + int remove_order; }; struct snd_soc_platform { -- cgit v1.2.3