aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/sound/soc.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-04-12 19:48:31 +0100
committerMark Brown <broonie@kernel.org>2015-04-12 19:48:31 +0100
commit77b62fa5d23988155132cf7fee44f2c209e3dc4c (patch)
tree41cafd1b209f115a3c97939e1a566c69d4c58a01 /include/sound/soc.h
parentMerge remote-tracking branch 'asoc/topic/core' into asoc-next (diff)
parentASoC: Make snd_soc_dapm_kcontrol_codec() inline (diff)
downloadwireguard-linux-77b62fa5d23988155132cf7fee44f2c209e3dc4c.tar.xz
wireguard-linux-77b62fa5d23988155132cf7fee44f2c209e3dc4c.zip
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
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 bc6cfabc0e35..92b92ac120bb 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1268,6 +1268,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,