From 0330d1f7362ff909392bb6b8e006dcdbc943b386 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 3 Jun 2011 18:13:02 +0100 Subject: ASoC: core - improve probe/remove ordering Improve probe/remove order by defining ordering levels. Signed-off-by: Liam Girdwood --- include/sound/soc-dai.h | 4 ++-- include/sound/soc.h | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'include/sound') diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 3082c4e..bda171e 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -213,8 +213,8 @@ struct snd_soc_dai_driver { unsigned int symmetric_rates:1; /* probe ordering - for components with runtime dependencies */ - bool late_probe; - bool early_remove; + int probe_order; + int remove_order; }; /* diff --git a/include/sound/soc.h b/include/sound/soc.h index 428ac63..be7a8cd 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -202,6 +202,15 @@ #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 /* DAI Link Host Mode Support */ #define SND_SOC_DAI_LINK_NO_HOST 0x1 @@ -641,8 +650,8 @@ struct snd_soc_codec_driver { enum snd_soc_dapm_type, int); /* probe ordering - for components with runtime dependencies */ - bool late_probe; - bool early_remove; + int probe_order; + int remove_order; /* codec stream completion event */ int (*stream_event)(struct snd_soc_dapm_context *dapm); @@ -671,8 +680,8 @@ struct snd_soc_platform_driver { struct snd_pcm_ops *ops; /* probe ordering - for components with runtime dependencies */ - bool late_probe; - bool early_remove; + int probe_order; + int remove_order; int (*stream_event)(struct snd_soc_dapm_context *dapm); int (*bespoke_trigger)(struct snd_pcm_substream *, int); -- cgit v1.1