summaryrefslogtreecommitdiff
path: root/include/sound/soc.h
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-03-15 10:27:20 +0100
committerMark Brown <broonie@kernel.org>2015-03-16 11:40:24 +0000
commit6b5b042d4c675cb9d3446a1cdcaca98e715ba812 (patch)
tree7ac71e082f82ef4e32b3e4b2e418ede1e6075576 /include/sound/soc.h
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
ASoC: Make snd_soc_dapm_kcontrol_codec() inline
snd_soc_dapm_kcontrol_codec() is a extremely simple function and inlining it typically results in less code than necessary for calling the non-inlined version of the function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0d1ade195628..85a6853a40bb 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1258,6 +1258,19 @@ static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm(
return component->dapm_ptr;
}
+/**
+ * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol
+ * @kcontrol: The kcontrol
+ *
+ * This function must only be used on DAPM contexts that are known to be part of
+ * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined.
+ */
+static inline struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(
+ struct snd_kcontrol *kcontrol)
+{
+ return snd_soc_dapm_to_codec(snd_soc_dapm_kcontrol_dapm(kcontrol));
+}
+
/* codec IO */
unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,