From: Kuninori Morimoto Date: Mon, 6 Nov 2017 01:49:06 +0000 (+0000) Subject: ASoC: add snd_soc_dapm_kcontrol_component() X-Git-Tag: v4.15-rc1~118^2~1^2~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e07bd30bb87f6a6ca1f75fa41df71ff5e7bc6a3f;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Mark Brown --- diff --git a/include/sound/soc.h b/include/sound/soc.h index 4961f4455b658..0668cbd9f0b52 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1524,6 +1524,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,