]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/sound/soc.h
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
[karo-tx-linux.git] / include / sound / soc.h
index bc6cfabc0e357cc129b20007364dc30a174bfbc3..92b92ac120bbfdba50aaabc6820b4fa2477d2ba6 100644 (file)
@@ -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,