aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2017-11-06 01:49:06 +0000
committerSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2018-09-06 13:08:17 +0100
commit1efcf8f8e6848d853a643fa8de87ca303dbfaa4b (patch)
tree27b0960871f89c4c67da876e0f83e60cb8c71fc9
parent5bd7580540eef09094396164ba6ce3b49441744f (diff)
ASoC: add snd_soc_dapm_kcontrol_component()
snd_soc_dapm_kcontrol_codec() (= for Codec) will be removed soon. This patch Component version of it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-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 3382da575a504..c33ffb66980ea 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1460,6 +1460,19 @@ static inline struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(
return snd_soc_dapm_to_codec(snd_soc_dapm_kcontrol_dapm(kcontrol));
}
+/**
+ * snd_soc_dapm_kcontrol_component() - Returns the component associated to a kcontrol
+ * @kcontrol: The kcontrol
+ *
+ * This function must only be used on DAPM contexts that are known to be part of
+ * a COMPONENT (e.g. in a COMPONENT driver). Otherwise the behavior is undefined.
+ */
+static inline struct snd_soc_component *snd_soc_dapm_kcontrol_component(
+ struct snd_kcontrol *kcontrol)
+{
+ return snd_soc_dapm_to_component(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,