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/ab8500-codec.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/ab8500-codec.c')
-rw-r--r-- | sound/soc/codecs/ab8500-codec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index 1ad92cbf0b24..1fb4402bf72d 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c | |||
@@ -1139,7 +1139,7 @@ static void anc_configure(struct snd_soc_codec *codec, | |||
1139 | static int sid_status_control_get(struct snd_kcontrol *kcontrol, | 1139 | static int sid_status_control_get(struct snd_kcontrol *kcontrol, |
1140 | struct snd_ctl_elem_value *ucontrol) | 1140 | struct snd_ctl_elem_value *ucontrol) |
1141 | { | 1141 | { |
1142 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1142 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
1143 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); | 1143 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); |
1144 | 1144 | ||
1145 | mutex_lock(&codec->mutex); | 1145 | mutex_lock(&codec->mutex); |
@@ -1153,7 +1153,7 @@ static int sid_status_control_get(struct snd_kcontrol *kcontrol, | |||
1153 | static int sid_status_control_put(struct snd_kcontrol *kcontrol, | 1153 | static int sid_status_control_put(struct snd_kcontrol *kcontrol, |
1154 | struct snd_ctl_elem_value *ucontrol) | 1154 | struct snd_ctl_elem_value *ucontrol) |
1155 | { | 1155 | { |
1156 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1156 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
1157 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); | 1157 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); |
1158 | unsigned int param, sidconf, val; | 1158 | unsigned int param, sidconf, val; |
1159 | int status = 1; | 1159 | int status = 1; |
@@ -1208,7 +1208,7 @@ out: | |||
1208 | static int anc_status_control_get(struct snd_kcontrol *kcontrol, | 1208 | static int anc_status_control_get(struct snd_kcontrol *kcontrol, |
1209 | struct snd_ctl_elem_value *ucontrol) | 1209 | struct snd_ctl_elem_value *ucontrol) |
1210 | { | 1210 | { |
1211 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1211 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
1212 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); | 1212 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); |
1213 | 1213 | ||
1214 | mutex_lock(&codec->mutex); | 1214 | mutex_lock(&codec->mutex); |
@@ -1221,7 +1221,7 @@ static int anc_status_control_get(struct snd_kcontrol *kcontrol, | |||
1221 | static int anc_status_control_put(struct snd_kcontrol *kcontrol, | 1221 | static int anc_status_control_put(struct snd_kcontrol *kcontrol, |
1222 | struct snd_ctl_elem_value *ucontrol) | 1222 | struct snd_ctl_elem_value *ucontrol) |
1223 | { | 1223 | { |
1224 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1224 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
1225 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); | 1225 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); |
1226 | struct device *dev = codec->dev; | 1226 | struct device *dev = codec->dev; |
1227 | bool apply_fir, apply_iir; | 1227 | bool apply_fir, apply_iir; |
@@ -1306,7 +1306,7 @@ static int filter_control_info(struct snd_kcontrol *kcontrol, | |||
1306 | static int filter_control_get(struct snd_kcontrol *kcontrol, | 1306 | static int filter_control_get(struct snd_kcontrol *kcontrol, |
1307 | struct snd_ctl_elem_value *ucontrol) | 1307 | struct snd_ctl_elem_value *ucontrol) |
1308 | { | 1308 | { |
1309 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1309 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
1310 | struct filter_control *fc = | 1310 | struct filter_control *fc = |
1311 | (struct filter_control *)kcontrol->private_value; | 1311 | (struct filter_control *)kcontrol->private_value; |
1312 | unsigned int i; | 1312 | unsigned int i; |
@@ -1322,7 +1322,7 @@ static int filter_control_get(struct snd_kcontrol *kcontrol, | |||
1322 | static int filter_control_put(struct snd_kcontrol *kcontrol, | 1322 | static int filter_control_put(struct snd_kcontrol *kcontrol, |
1323 | struct snd_ctl_elem_value *ucontrol) | 1323 | struct snd_ctl_elem_value *ucontrol) |
1324 | { | 1324 | { |
1325 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1325 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
1326 | struct filter_control *fc = | 1326 | struct filter_control *fc = |
1327 | (struct filter_control *)kcontrol->private_value; | 1327 | (struct filter_control *)kcontrol->private_value; |
1328 | unsigned int i; | 1328 | unsigned int i; |