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/wm2000.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/wm2000.c')
-rw-r--r-- | sound/soc/codecs/wm2000.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index 83a2c872925c..a4c352cc3464 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -607,7 +607,7 @@ static int wm2000_anc_set_mode(struct wm2000_priv *wm2000) | |||
607 | static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, | 607 | static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, |
608 | struct snd_ctl_elem_value *ucontrol) | 608 | struct snd_ctl_elem_value *ucontrol) |
609 | { | 609 | { |
610 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 610 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
611 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | 611 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); |
612 | 612 | ||
613 | ucontrol->value.enumerated.item[0] = wm2000->anc_active; | 613 | ucontrol->value.enumerated.item[0] = wm2000->anc_active; |
@@ -618,7 +618,7 @@ static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, | |||
618 | static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, | 618 | static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, |
619 | struct snd_ctl_elem_value *ucontrol) | 619 | struct snd_ctl_elem_value *ucontrol) |
620 | { | 620 | { |
621 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 621 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
622 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | 622 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); |
623 | int anc_active = ucontrol->value.enumerated.item[0]; | 623 | int anc_active = ucontrol->value.enumerated.item[0]; |
624 | int ret; | 624 | int ret; |
@@ -640,7 +640,7 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, | |||
640 | static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, | 640 | static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, |
641 | struct snd_ctl_elem_value *ucontrol) | 641 | struct snd_ctl_elem_value *ucontrol) |
642 | { | 642 | { |
643 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 643 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
644 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | 644 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); |
645 | 645 | ||
646 | ucontrol->value.enumerated.item[0] = wm2000->spk_ena; | 646 | ucontrol->value.enumerated.item[0] = wm2000->spk_ena; |
@@ -651,7 +651,7 @@ static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, | |||
651 | static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, | 651 | static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, |
652 | struct snd_ctl_elem_value *ucontrol) | 652 | struct snd_ctl_elem_value *ucontrol) |
653 | { | 653 | { |
654 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 654 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
655 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | 655 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); |
656 | int val = ucontrol->value.enumerated.item[0]; | 656 | int val = ucontrol->value.enumerated.item[0]; |
657 | int ret; | 657 | int ret; |