aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-04-27 16:13:22 -0400
committerMark Brown <broonie@kernel.org>2015-04-27 16:34:45 -0400
commit39ed68c8cd3aff417603a95d0594308598b9f469 (patch)
treea3af4936f6a3204051bec4ca20cb38901caf43d5
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
ASoC: Add helper function getting CODEC's DAPM context
The DAPM context in the snd_soc_codec struct is redundant and scheduled to be replaced by the DAPM context in the snd_soc_component struct. This patch introduces a new helper function snd_soc_codec_get_dapm() which should be used for getting the DAPM context for a CODEC rather then directly accessing the dapm field. Once there are no more direct users of the dapm field left it is possible to transparently switch all drivers to the component DAPM context by updating snd_soc_codec_get_dapm() function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index fcb312b3f258..2f742009da4b 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -807,7 +807,7 @@ struct snd_soc_codec {
807 /* component */ 807 /* component */
808 struct snd_soc_component component; 808 struct snd_soc_component component;
809 809
810 /* dapm */ 810 /* Don't access this directly, use snd_soc_codec_get_dapm() */
811 struct snd_soc_dapm_context dapm; 811 struct snd_soc_dapm_context dapm;
812 812
813#ifdef CONFIG_DEBUG_FS 813#ifdef CONFIG_DEBUG_FS
@@ -1270,6 +1270,18 @@ static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm(
1270} 1270}
1271 1271
1272/** 1272/**
1273 * snd_soc_codec_get_dapm() - Returns the DAPM context for the CODEC
1274 * @codec: The CODEC for which to get the DAPM context
1275 *
1276 * Note: Use this function instead of directly accessing the CODEC's dapm field
1277 */
1278static inline struct snd_soc_dapm_context *snd_soc_codec_get_dapm(
1279 struct snd_soc_codec *codec)
1280{
1281 return &codec->dapm;
1282}
1283
1284/**
1273 * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol 1285 * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol
1274 * @kcontrol: The kcontrol 1286 * @kcontrol: The kcontrol
1275 * 1287 *