diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-03-18 04:02:04 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-14 12:22:43 -0400 |
commit | ea53bf77d147e7e560ac007fdaa30fb98c37c712 (patch) | |
tree | fb5917764aa5b2c0f4122708097446c3110541a0 /sound/soc/codecs/max9768.c | |
parent | c9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff) |
ASoC: Add snd_soc_kcontrol_codec() helper function
For CODEC controls snd_kcontrol_chip() currently returns a pointer to the
CODEC that registered the control. With the upcoming consolidation of
platform and CODEC controls this will change. Prepare for this by introducing
the snd_soc_kcontrol_codec() helper function that will hide the implementation
details of how the CODEC for a control can be obtained. This will allow us to
change this easily in the future.
The patch also updates all CODEC drivers to use the new helper function.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/max9768.c')
-rw-r--r-- | sound/soc/codecs/max9768.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/max9768.c b/sound/soc/codecs/max9768.c index ec481fc428c7..e1c196a41930 100644 --- a/sound/soc/codecs/max9768.c +++ b/sound/soc/codecs/max9768.c | |||
@@ -43,7 +43,7 @@ static struct reg_default max9768_default_regs[] = { | |||
43 | static int max9768_get_gpio(struct snd_kcontrol *kcontrol, | 43 | static int max9768_get_gpio(struct snd_kcontrol *kcontrol, |
44 | struct snd_ctl_elem_value *ucontrol) | 44 | struct snd_ctl_elem_value *ucontrol) |
45 | { | 45 | { |
46 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 46 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
47 | struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec); | 47 | struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec); |
48 | int val = gpio_get_value_cansleep(max9768->mute_gpio); | 48 | int val = gpio_get_value_cansleep(max9768->mute_gpio); |
49 | 49 | ||
@@ -55,7 +55,7 @@ static int max9768_get_gpio(struct snd_kcontrol *kcontrol, | |||
55 | static int max9768_set_gpio(struct snd_kcontrol *kcontrol, | 55 | static int max9768_set_gpio(struct snd_kcontrol *kcontrol, |
56 | struct snd_ctl_elem_value *ucontrol) | 56 | struct snd_ctl_elem_value *ucontrol) |
57 | { | 57 | { |
58 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 58 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
59 | struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec); | 59 | struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec); |
60 | 60 | ||
61 | gpio_set_value_cansleep(max9768->mute_gpio, !ucontrol->value.integer.value[0]); | 61 | gpio_set_value_cansleep(max9768->mute_gpio, !ucontrol->value.integer.value[0]); |