ASoC: Add helper function to check whether a CODEC is active
Instead of directly checking the 'active' field of the CODEC struct add a new
helper function that will return either true or false depending on whether the
CODEC is active. This will make the migration to the component level easier.
The patch also updates all CODEC drivers that check the active attribute to use
the new helper function.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 53d15e0..5c2b4f4 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1172,6 +1172,11 @@
return 1;
}
+static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec)
+{
+ return codec->active != 0;
+}
+
int snd_soc_util_init(void);
void snd_soc_util_exit(void);