aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-04-14 12:42:28 -0400
committerMark Brown <broonie@linaro.org>2014-04-14 12:42:28 -0400
commitaa0258adf6078a41a3db06f4e498253aff64d151 (patch)
tree26d293e3cd249d2946c6def872fa4bd88ed65669
parent1a39019e939f620f39a1b914231ab6ba9013b208 (diff)
parentb37f1d123c69c0d7730704d65b83eaac780c0e3b (diff)
Merge branch 'topic/component' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core
Conflicts: sound/soc/soc-core.c
-rw-r--r--include/sound/soc.h59
-rw-r--r--sound/soc/codecs/88pm860x-codec.c8
-rw-r--r--sound/soc/codecs/ab8500-codec.c12
-rw-r--r--sound/soc/codecs/adav80x.c4
-rw-r--r--sound/soc/codecs/ak4641.c4
-rw-r--r--sound/soc/codecs/cs4270.c2
-rw-r--r--sound/soc/codecs/cs4271.c4
-rw-r--r--sound/soc/codecs/cs42l51.c4
-rw-r--r--sound/soc/codecs/da7210.c4
-rw-r--r--sound/soc/codecs/da7213.c4
-rw-r--r--sound/soc/codecs/da732x.c4
-rw-r--r--sound/soc/codecs/da9055.c2
-rw-r--r--sound/soc/codecs/lm4857.c4
-rw-r--r--sound/soc/codecs/max9768.c4
-rw-r--r--sound/soc/codecs/max98088.c12
-rw-r--r--sound/soc/codecs/max98090.c4
-rw-r--r--sound/soc/codecs/max98095.c16
-rw-r--r--sound/soc/codecs/pcm1681.c4
-rw-r--r--sound/soc/codecs/rt5631.c4
-rw-r--r--sound/soc/codecs/sgtl5000.c4
-rw-r--r--sound/soc/codecs/sta32x.c4
-rw-r--r--sound/soc/codecs/tas5086.c4
-rw-r--r--sound/soc/codecs/tlv320aic23.c4
-rw-r--r--sound/soc/codecs/tlv320dac33.c4
-rw-r--r--sound/soc/codecs/twl4030.c10
-rw-r--r--sound/soc/codecs/twl6040.c8
-rw-r--r--sound/soc/codecs/wl1273.c12
-rw-r--r--sound/soc/codecs/wm2000.c8
-rw-r--r--sound/soc/codecs/wm8350.c4
-rw-r--r--sound/soc/codecs/wm8400.c2
-rw-r--r--sound/soc/codecs/wm8580.c2
-rw-r--r--sound/soc/codecs/wm8731.c4
-rw-r--r--sound/soc/codecs/wm8753.c4
-rw-r--r--sound/soc/codecs/wm8804.c4
-rw-r--r--sound/soc/codecs/wm8903.c4
-rw-r--r--sound/soc/codecs/wm8904.c14
-rw-r--r--sound/soc/codecs/wm8955.c4
-rw-r--r--sound/soc/codecs/wm8958-dsp2.c32
-rw-r--r--sound/soc/codecs/wm8960.c4
-rw-r--r--sound/soc/codecs/wm8962.c8
-rw-r--r--sound/soc/codecs/wm8983.c4
-rw-r--r--sound/soc/codecs/wm8985.c4
-rw-r--r--sound/soc/codecs/wm8990.c2
-rw-r--r--sound/soc/codecs/wm8991.c2
-rw-r--r--sound/soc/codecs/wm8994.c10
-rw-r--r--sound/soc/codecs/wm8996.c4
-rw-r--r--sound/soc/codecs/wm9081.c4
-rw-r--r--sound/soc/codecs/wm_adsp.c4
-rw-r--r--sound/soc/codecs/wm_hubs.c2
-rw-r--r--sound/soc/intel/sst-haswell-pcm.c8
-rw-r--r--sound/soc/soc-cache.c2
-rw-r--r--sound/soc/soc-core.c246
-rw-r--r--sound/soc/soc-io.c144
53 files changed, 360 insertions, 379 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 4ed706bf11d1..81bc331c520f 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -393,12 +393,6 @@ int devm_snd_soc_register_component(struct device *dev,
393 const struct snd_soc_component_driver *cmpnt_drv, 393 const struct snd_soc_component_driver *cmpnt_drv,
394 struct snd_soc_dai_driver *dai_drv, int num_dai); 394 struct snd_soc_dai_driver *dai_drv, int num_dai);
395void snd_soc_unregister_component(struct device *dev); 395void snd_soc_unregister_component(struct device *dev);
396int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
397 unsigned int reg);
398int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
399 unsigned int reg);
400int snd_soc_codec_writable_register(struct snd_soc_codec *codec,
401 unsigned int reg);
402int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 396int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
403 struct regmap *regmap); 397 struct regmap *regmap);
404int snd_soc_cache_sync(struct snd_soc_codec *codec); 398int snd_soc_cache_sync(struct snd_soc_codec *codec);
@@ -668,6 +662,7 @@ struct snd_soc_component {
668 unsigned int active; 662 unsigned int active;
669 663
670 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ 664 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
665 unsigned int registered_as_component:1;
671 666
672 struct list_head list; 667 struct list_head list;
673 668
@@ -692,9 +687,6 @@ struct snd_soc_codec {
692 struct list_head list; 687 struct list_head list;
693 struct list_head card_list; 688 struct list_head card_list;
694 int num_dai; 689 int num_dai;
695 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
696 int (*readable_register)(struct snd_soc_codec *, unsigned int);
697 int (*writable_register)(struct snd_soc_codec *, unsigned int);
698 690
699 /* runtime */ 691 /* runtime */
700 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 692 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
@@ -756,11 +748,6 @@ struct snd_soc_codec_driver {
756 /* codec IO */ 748 /* codec IO */
757 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 749 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
758 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); 750 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
759 int (*display_register)(struct snd_soc_codec *, char *,
760 size_t, unsigned int);
761 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
762 int (*readable_register)(struct snd_soc_codec *, unsigned int);
763 int (*writable_register)(struct snd_soc_codec *, unsigned int);
764 unsigned int reg_cache_size; 751 unsigned int reg_cache_size;
765 short reg_cache_step; 752 short reg_cache_step;
766 short reg_word_size; 753 short reg_word_size;
@@ -791,6 +778,7 @@ struct snd_soc_platform_driver {
791 int (*remove)(struct snd_soc_platform *); 778 int (*remove)(struct snd_soc_platform *);
792 int (*suspend)(struct snd_soc_dai *dai); 779 int (*suspend)(struct snd_soc_dai *dai);
793 int (*resume)(struct snd_soc_dai *dai); 780 int (*resume)(struct snd_soc_dai *dai);
781 struct snd_soc_component_driver component_driver;
794 782
795 /* pcm creation and destruction */ 783 /* pcm creation and destruction */
796 int (*pcm_new)(struct snd_soc_pcm_runtime *); 784 int (*pcm_new)(struct snd_soc_pcm_runtime *);
@@ -844,6 +832,8 @@ struct snd_soc_platform {
844 struct list_head list; 832 struct list_head list;
845 struct list_head card_list; 833 struct list_head card_list;
846 834
835 struct snd_soc_component component;
836
847 struct snd_soc_dapm_context dapm; 837 struct snd_soc_dapm_context dapm;
848 838
849#ifdef CONFIG_DEBUG_FS 839#ifdef CONFIG_DEBUG_FS
@@ -1120,6 +1110,19 @@ static inline struct snd_soc_codec *snd_soc_component_to_codec(
1120 return container_of(component, struct snd_soc_codec, component); 1110 return container_of(component, struct snd_soc_codec, component);
1121} 1111}
1122 1112
1113/**
1114 * snd_soc_component_to_platform() - Casts a component to the platform it is embedded in
1115 * @component: The component to cast to a platform
1116 *
1117 * This function must only be used on components that are known to be platforms.
1118 * Otherwise the behavior is undefined.
1119 */
1120static inline struct snd_soc_platform *snd_soc_component_to_platform(
1121 struct snd_soc_component *component)
1122{
1123 return container_of(component, struct snd_soc_platform, component);
1124}
1125
1123/* codec IO */ 1126/* codec IO */
1124unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); 1127unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
1125unsigned int snd_soc_write(struct snd_soc_codec *codec, 1128unsigned int snd_soc_write(struct snd_soc_codec *codec,
@@ -1228,6 +1231,34 @@ static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec)
1228 return snd_soc_component_is_active(&codec->component); 1231 return snd_soc_component_is_active(&codec->component);
1229} 1232}
1230 1233
1234/**
1235 * snd_soc_kcontrol_codec() - Returns the CODEC that registered the control
1236 * @kcontrol: The control for which to get the CODEC
1237 *
1238 * Note: This function will only work correctly if the control has been
1239 * registered with snd_soc_add_codec_controls() or via table based setup of
1240 * snd_soc_codec_driver. Otherwise the behavior is undefined.
1241 */
1242static inline struct snd_soc_codec *snd_soc_kcontrol_codec(
1243 struct snd_kcontrol *kcontrol)
1244{
1245 return snd_kcontrol_chip(kcontrol);
1246}
1247
1248/**
1249 * snd_soc_kcontrol_platform() - Returns the platform that registerd the control
1250 * @kcontrol: The control for which to get the platform
1251 *
1252 * Note: This function will only work correctly if the control has been
1253 * registered with snd_soc_add_platform_controls() or via table based setup of
1254 * a snd_soc_platform_driver. Otherwise the behavior is undefined.
1255 */
1256static inline struct snd_soc_codec *snd_soc_kcontrol_platform(
1257 struct snd_kcontrol *kcontrol)
1258{
1259 return snd_kcontrol_chip(kcontrol);
1260}
1261
1231int snd_soc_util_init(void); 1262int snd_soc_util_init(void);
1232void snd_soc_util_exit(void); 1263void snd_soc_util_exit(void);
1233 1264
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index b07e17160f94..b18cafa5a858 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -276,7 +276,7 @@ static int snd_soc_get_volsw_2r_st(struct snd_kcontrol *kcontrol,
276{ 276{
277 struct soc_mixer_control *mc = 277 struct soc_mixer_control *mc =
278 (struct soc_mixer_control *)kcontrol->private_value; 278 (struct soc_mixer_control *)kcontrol->private_value;
279 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 279 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
280 unsigned int reg = mc->reg; 280 unsigned int reg = mc->reg;
281 unsigned int reg2 = mc->rreg; 281 unsigned int reg2 = mc->rreg;
282 int val[2], val2[2], i; 282 int val[2], val2[2], i;
@@ -300,7 +300,7 @@ static int snd_soc_put_volsw_2r_st(struct snd_kcontrol *kcontrol,
300{ 300{
301 struct soc_mixer_control *mc = 301 struct soc_mixer_control *mc =
302 (struct soc_mixer_control *)kcontrol->private_value; 302 (struct soc_mixer_control *)kcontrol->private_value;
303 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 303 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
304 unsigned int reg = mc->reg; 304 unsigned int reg = mc->reg;
305 unsigned int reg2 = mc->rreg; 305 unsigned int reg2 = mc->rreg;
306 int err; 306 int err;
@@ -333,7 +333,7 @@ static int snd_soc_get_volsw_2r_out(struct snd_kcontrol *kcontrol,
333{ 333{
334 struct soc_mixer_control *mc = 334 struct soc_mixer_control *mc =
335 (struct soc_mixer_control *)kcontrol->private_value; 335 (struct soc_mixer_control *)kcontrol->private_value;
336 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 336 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
337 unsigned int reg = mc->reg; 337 unsigned int reg = mc->reg;
338 unsigned int reg2 = mc->rreg; 338 unsigned int reg2 = mc->rreg;
339 unsigned int shift = mc->shift; 339 unsigned int shift = mc->shift;
@@ -353,7 +353,7 @@ static int snd_soc_put_volsw_2r_out(struct snd_kcontrol *kcontrol,
353{ 353{
354 struct soc_mixer_control *mc = 354 struct soc_mixer_control *mc =
355 (struct soc_mixer_control *)kcontrol->private_value; 355 (struct soc_mixer_control *)kcontrol->private_value;
356 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 356 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
357 unsigned int reg = mc->reg; 357 unsigned int reg = mc->reg;
358 unsigned int reg2 = mc->rreg; 358 unsigned int reg2 = mc->rreg;
359 unsigned int shift = mc->shift; 359 unsigned int shift = mc->shift;
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,
1139static int sid_status_control_get(struct snd_kcontrol *kcontrol, 1139static 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,
1153static int sid_status_control_put(struct snd_kcontrol *kcontrol, 1153static 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:
1208static int anc_status_control_get(struct snd_kcontrol *kcontrol, 1208static 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,
1221static int anc_status_control_put(struct snd_kcontrol *kcontrol, 1221static 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,
1306static int filter_control_get(struct snd_kcontrol *kcontrol, 1306static 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,
1322static int filter_control_put(struct snd_kcontrol *kcontrol, 1322static 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;
diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c
index 5062e34ee8dc..cf170b5ef426 100644
--- a/sound/soc/codecs/adav80x.c
+++ b/sound/soc/codecs/adav80x.c
@@ -315,7 +315,7 @@ static int adav80x_set_deemph(struct snd_soc_codec *codec)
315static int adav80x_put_deemph(struct snd_kcontrol *kcontrol, 315static int adav80x_put_deemph(struct snd_kcontrol *kcontrol,
316 struct snd_ctl_elem_value *ucontrol) 316 struct snd_ctl_elem_value *ucontrol)
317{ 317{
318 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 318 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
319 struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); 319 struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
320 unsigned int deemph = ucontrol->value.enumerated.item[0]; 320 unsigned int deemph = ucontrol->value.enumerated.item[0];
321 321
@@ -330,7 +330,7 @@ static int adav80x_put_deemph(struct snd_kcontrol *kcontrol,
330static int adav80x_get_deemph(struct snd_kcontrol *kcontrol, 330static int adav80x_get_deemph(struct snd_kcontrol *kcontrol,
331 struct snd_ctl_elem_value *ucontrol) 331 struct snd_ctl_elem_value *ucontrol)
332{ 332{
333 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 333 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
334 struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); 334 struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
335 335
336 ucontrol->value.enumerated.item[0] = adav80x->deemph; 336 ucontrol->value.enumerated.item[0] = adav80x->deemph;
diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c
index 868c0e2da1ec..7afe8f482088 100644
--- a/sound/soc/codecs/ak4641.c
+++ b/sound/soc/codecs/ak4641.c
@@ -74,7 +74,7 @@ static int ak4641_set_deemph(struct snd_soc_codec *codec)
74static int ak4641_put_deemph(struct snd_kcontrol *kcontrol, 74static int ak4641_put_deemph(struct snd_kcontrol *kcontrol,
75 struct snd_ctl_elem_value *ucontrol) 75 struct snd_ctl_elem_value *ucontrol)
76{ 76{
77 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 77 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
78 struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec); 78 struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
79 int deemph = ucontrol->value.enumerated.item[0]; 79 int deemph = ucontrol->value.enumerated.item[0];
80 80
@@ -89,7 +89,7 @@ static int ak4641_put_deemph(struct snd_kcontrol *kcontrol,
89static int ak4641_get_deemph(struct snd_kcontrol *kcontrol, 89static int ak4641_get_deemph(struct snd_kcontrol *kcontrol,
90 struct snd_ctl_elem_value *ucontrol) 90 struct snd_ctl_elem_value *ucontrol)
91{ 91{
92 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 92 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
93 struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec); 93 struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
94 94
95 ucontrol->value.enumerated.item[0] = ak4641->deemph; 95 ucontrol->value.enumerated.item[0] = ak4641->deemph;
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 3920e6264948..9947a9583679 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -438,7 +438,7 @@ static int cs4270_dai_mute(struct snd_soc_dai *dai, int mute)
438static int cs4270_soc_put_mute(struct snd_kcontrol *kcontrol, 438static int cs4270_soc_put_mute(struct snd_kcontrol *kcontrol,
439 struct snd_ctl_elem_value *ucontrol) 439 struct snd_ctl_elem_value *ucontrol)
440{ 440{
441 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 441 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
442 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); 442 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
443 int left = !ucontrol->value.integer.value[0]; 443 int left = !ucontrol->value.integer.value[0];
444 int right = !ucontrol->value.integer.value[1]; 444 int right = !ucontrol->value.integer.value[1];
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index aef4965750c7..93cec52f4733 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -284,7 +284,7 @@ static int cs4271_set_deemph(struct snd_soc_codec *codec)
284static int cs4271_get_deemph(struct snd_kcontrol *kcontrol, 284static int cs4271_get_deemph(struct snd_kcontrol *kcontrol,
285 struct snd_ctl_elem_value *ucontrol) 285 struct snd_ctl_elem_value *ucontrol)
286{ 286{
287 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 287 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
288 struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec); 288 struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
289 289
290 ucontrol->value.enumerated.item[0] = cs4271->deemph; 290 ucontrol->value.enumerated.item[0] = cs4271->deemph;
@@ -294,7 +294,7 @@ static int cs4271_get_deemph(struct snd_kcontrol *kcontrol,
294static int cs4271_put_deemph(struct snd_kcontrol *kcontrol, 294static int cs4271_put_deemph(struct snd_kcontrol *kcontrol,
295 struct snd_ctl_elem_value *ucontrol) 295 struct snd_ctl_elem_value *ucontrol)
296{ 296{
297 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 297 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
298 struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec); 298 struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
299 299
300 cs4271->deemph = ucontrol->value.enumerated.item[0]; 300 cs4271->deemph = ucontrol->value.enumerated.item[0];
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
index 6c0da2baa154..23acaa0263dc 100644
--- a/sound/soc/codecs/cs42l51.c
+++ b/sound/soc/codecs/cs42l51.c
@@ -55,7 +55,7 @@ struct cs42l51_private {
55static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol, 55static int cs42l51_get_chan_mix(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 unsigned long value = snd_soc_read(codec, CS42L51_PCM_MIXER)&3; 59 unsigned long value = snd_soc_read(codec, CS42L51_PCM_MIXER)&3;
60 60
61 switch (value) { 61 switch (value) {
@@ -83,7 +83,7 @@ static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol,
83static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol, 83static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol,
84 struct snd_ctl_elem_value *ucontrol) 84 struct snd_ctl_elem_value *ucontrol)
85{ 85{
86 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 86 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
87 unsigned char val; 87 unsigned char val;
88 88
89 switch (ucontrol->value.integer.value[0]) { 89 switch (ucontrol->value.integer.value[0]) {
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c
index 137e8ebc092c..21810e5f3321 100644
--- a/sound/soc/codecs/da7210.c
+++ b/sound/soc/codecs/da7210.c
@@ -335,7 +335,7 @@ static SOC_ENUM_SINGLE_DECL(da7210_hp_mode_sel,
335static int da7210_put_alc_sw(struct snd_kcontrol *kcontrol, 335static int da7210_put_alc_sw(struct snd_kcontrol *kcontrol,
336 struct snd_ctl_elem_value *ucontrol) 336 struct snd_ctl_elem_value *ucontrol)
337{ 337{
338 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 338 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
339 339
340 if (ucontrol->value.integer.value[0]) { 340 if (ucontrol->value.integer.value[0]) {
341 /* Check if noise suppression is enabled */ 341 /* Check if noise suppression is enabled */
@@ -358,7 +358,7 @@ static int da7210_put_alc_sw(struct snd_kcontrol *kcontrol,
358static int da7210_put_noise_sup_sw(struct snd_kcontrol *kcontrol, 358static int da7210_put_noise_sup_sw(struct snd_kcontrol *kcontrol,
359 struct snd_ctl_elem_value *ucontrol) 359 struct snd_ctl_elem_value *ucontrol)
360{ 360{
361 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 361 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
362 u8 val; 362 u8 val;
363 363
364 if (ucontrol->value.integer.value[0]) { 364 if (ucontrol->value.integer.value[0]) {
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c
index 738fa18a50d2..9ec577f0edb4 100644
--- a/sound/soc/codecs/da7213.c
+++ b/sound/soc/codecs/da7213.c
@@ -345,7 +345,7 @@ static void da7213_alc_calib(struct snd_soc_codec *codec)
345static int da7213_put_mixin_gain(struct snd_kcontrol *kcontrol, 345static int da7213_put_mixin_gain(struct snd_kcontrol *kcontrol,
346 struct snd_ctl_elem_value *ucontrol) 346 struct snd_ctl_elem_value *ucontrol)
347{ 347{
348 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 348 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
349 struct da7213_priv *da7213 = snd_soc_codec_get_drvdata(codec); 349 struct da7213_priv *da7213 = snd_soc_codec_get_drvdata(codec);
350 int ret; 350 int ret;
351 351
@@ -361,7 +361,7 @@ static int da7213_put_mixin_gain(struct snd_kcontrol *kcontrol,
361static int da7213_put_alc_sw(struct snd_kcontrol *kcontrol, 361static int da7213_put_alc_sw(struct snd_kcontrol *kcontrol,
362 struct snd_ctl_elem_value *ucontrol) 362 struct snd_ctl_elem_value *ucontrol)
363{ 363{
364 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 364 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
365 struct da7213_priv *da7213 = snd_soc_codec_get_drvdata(codec); 365 struct da7213_priv *da7213 = snd_soc_codec_get_drvdata(codec);
366 366
367 /* Force ALC offset calibration if enabling ALC */ 367 /* Force ALC offset calibration if enabling ALC */
diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
index 48f3fef68484..2fae31cb0067 100644
--- a/sound/soc/codecs/da732x.c
+++ b/sound/soc/codecs/da732x.c
@@ -332,7 +332,7 @@ static SOC_ENUM_SINGLE_DECL(da732x_adc2_voice_filter_enum,
332static int da732x_hpf_set(struct snd_kcontrol *kcontrol, 332static int da732x_hpf_set(struct snd_kcontrol *kcontrol,
333 struct snd_ctl_elem_value *ucontrol) 333 struct snd_ctl_elem_value *ucontrol)
334{ 334{
335 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 335 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
336 struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value; 336 struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value;
337 unsigned int reg = enum_ctrl->reg; 337 unsigned int reg = enum_ctrl->reg;
338 unsigned int sel = ucontrol->value.integer.value[0]; 338 unsigned int sel = ucontrol->value.integer.value[0];
@@ -360,7 +360,7 @@ static int da732x_hpf_set(struct snd_kcontrol *kcontrol,
360static int da732x_hpf_get(struct snd_kcontrol *kcontrol, 360static int da732x_hpf_get(struct snd_kcontrol *kcontrol,
361 struct snd_ctl_elem_value *ucontrol) 361 struct snd_ctl_elem_value *ucontrol)
362{ 362{
363 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 363 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
364 struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value; 364 struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value;
365 unsigned int reg = enum_ctrl->reg; 365 unsigned int reg = enum_ctrl->reg;
366 int val; 366 int val;
diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c
index 4ff06b50fbba..ad19cc56702b 100644
--- a/sound/soc/codecs/da9055.c
+++ b/sound/soc/codecs/da9055.c
@@ -484,7 +484,7 @@ static int da9055_get_alc_data(struct snd_soc_codec *codec, u8 reg_val)
484static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol, 484static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
485 struct snd_ctl_elem_value *ucontrol) 485 struct snd_ctl_elem_value *ucontrol)
486{ 486{
487 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 487 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
488 u8 reg_val, adc_left, adc_right, mic_left, mic_right; 488 u8 reg_val, adc_left, adc_right, mic_left, mic_right;
489 int avg_left_data, avg_right_data, offset_l, offset_r; 489 int avg_left_data, avg_right_data, offset_l, offset_r;
490 490
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c
index 4f048db9f55f..a924bb9d7886 100644
--- a/sound/soc/codecs/lm4857.c
+++ b/sound/soc/codecs/lm4857.c
@@ -49,7 +49,7 @@ static const struct reg_default lm4857_default_regs[] = {
49static int lm4857_get_mode(struct snd_kcontrol *kcontrol, 49static int lm4857_get_mode(struct snd_kcontrol *kcontrol,
50 struct snd_ctl_elem_value *ucontrol) 50 struct snd_ctl_elem_value *ucontrol)
51{ 51{
52 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 52 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
53 struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec); 53 struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec);
54 54
55 ucontrol->value.integer.value[0] = lm4857->mode; 55 ucontrol->value.integer.value[0] = lm4857->mode;
@@ -60,7 +60,7 @@ static int lm4857_get_mode(struct snd_kcontrol *kcontrol,
60static int lm4857_set_mode(struct snd_kcontrol *kcontrol, 60static int lm4857_set_mode(struct snd_kcontrol *kcontrol,
61 struct snd_ctl_elem_value *ucontrol) 61 struct snd_ctl_elem_value *ucontrol)
62{ 62{
63 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 63 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
64 struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec); 64 struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec);
65 uint8_t value = ucontrol->value.integer.value[0]; 65 uint8_t value = ucontrol->value.integer.value[0];
66 66
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[] = {
43static int max9768_get_gpio(struct snd_kcontrol *kcontrol, 43static 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,
55static int max9768_set_gpio(struct snd_kcontrol *kcontrol, 55static 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]);
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index ef7cf89f5623..9134982807b5 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -635,7 +635,7 @@ static SOC_ENUM_SINGLE_DECL(max98088_dai1_adc_filter_enum,
635static int max98088_mic1pre_set(struct snd_kcontrol *kcontrol, 635static int max98088_mic1pre_set(struct snd_kcontrol *kcontrol,
636 struct snd_ctl_elem_value *ucontrol) 636 struct snd_ctl_elem_value *ucontrol)
637{ 637{
638 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 638 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
639 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 639 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
640 unsigned int sel = ucontrol->value.integer.value[0]; 640 unsigned int sel = ucontrol->value.integer.value[0];
641 641
@@ -649,7 +649,7 @@ static int max98088_mic1pre_set(struct snd_kcontrol *kcontrol,
649static int max98088_mic1pre_get(struct snd_kcontrol *kcontrol, 649static int max98088_mic1pre_get(struct snd_kcontrol *kcontrol,
650 struct snd_ctl_elem_value *ucontrol) 650 struct snd_ctl_elem_value *ucontrol)
651{ 651{
652 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 652 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
653 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 653 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
654 654
655 ucontrol->value.integer.value[0] = max98088->mic1pre; 655 ucontrol->value.integer.value[0] = max98088->mic1pre;
@@ -659,7 +659,7 @@ static int max98088_mic1pre_get(struct snd_kcontrol *kcontrol,
659static int max98088_mic2pre_set(struct snd_kcontrol *kcontrol, 659static int max98088_mic2pre_set(struct snd_kcontrol *kcontrol,
660 struct snd_ctl_elem_value *ucontrol) 660 struct snd_ctl_elem_value *ucontrol)
661{ 661{
662 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 662 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
663 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 663 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
664 unsigned int sel = ucontrol->value.integer.value[0]; 664 unsigned int sel = ucontrol->value.integer.value[0];
665 665
@@ -673,7 +673,7 @@ static int max98088_mic2pre_set(struct snd_kcontrol *kcontrol,
673static int max98088_mic2pre_get(struct snd_kcontrol *kcontrol, 673static int max98088_mic2pre_get(struct snd_kcontrol *kcontrol,
674 struct snd_ctl_elem_value *ucontrol) 674 struct snd_ctl_elem_value *ucontrol)
675{ 675{
676 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 676 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
677 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 677 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
678 678
679 ucontrol->value.integer.value[0] = max98088->mic2pre; 679 ucontrol->value.integer.value[0] = max98088->mic2pre;
@@ -1750,7 +1750,7 @@ static void max98088_setup_eq2(struct snd_soc_codec *codec)
1750static int max98088_put_eq_enum(struct snd_kcontrol *kcontrol, 1750static int max98088_put_eq_enum(struct snd_kcontrol *kcontrol,
1751 struct snd_ctl_elem_value *ucontrol) 1751 struct snd_ctl_elem_value *ucontrol)
1752{ 1752{
1753 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1753 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1754 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 1754 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
1755 struct max98088_pdata *pdata = max98088->pdata; 1755 struct max98088_pdata *pdata = max98088->pdata;
1756 int channel = max98088_get_channel(codec, kcontrol->id.name); 1756 int channel = max98088_get_channel(codec, kcontrol->id.name);
@@ -1782,7 +1782,7 @@ static int max98088_put_eq_enum(struct snd_kcontrol *kcontrol,
1782static int max98088_get_eq_enum(struct snd_kcontrol *kcontrol, 1782static int max98088_get_eq_enum(struct snd_kcontrol *kcontrol,
1783 struct snd_ctl_elem_value *ucontrol) 1783 struct snd_ctl_elem_value *ucontrol)
1784{ 1784{
1785 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1785 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1786 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 1786 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
1787 int channel = max98088_get_channel(codec, kcontrol->id.name); 1787 int channel = max98088_get_channel(codec, kcontrol->id.name);
1788 struct max98088_cdata *cdata; 1788 struct max98088_cdata *cdata;
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index f7b0b37aa858..49d12387ac2f 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -426,7 +426,7 @@ static const unsigned int max98090_rcv_lout_tlv[] = {
426static int max98090_get_enab_tlv(struct snd_kcontrol *kcontrol, 426static int max98090_get_enab_tlv(struct snd_kcontrol *kcontrol,
427 struct snd_ctl_elem_value *ucontrol) 427 struct snd_ctl_elem_value *ucontrol)
428{ 428{
429 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 429 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
430 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); 430 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
431 struct soc_mixer_control *mc = 431 struct soc_mixer_control *mc =
432 (struct soc_mixer_control *)kcontrol->private_value; 432 (struct soc_mixer_control *)kcontrol->private_value;
@@ -466,7 +466,7 @@ static int max98090_get_enab_tlv(struct snd_kcontrol *kcontrol,
466static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, 466static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
467 struct snd_ctl_elem_value *ucontrol) 467 struct snd_ctl_elem_value *ucontrol)
468{ 468{
469 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 469 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
470 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); 470 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
471 struct soc_mixer_control *mc = 471 struct soc_mixer_control *mc =
472 (struct soc_mixer_control *)kcontrol->private_value; 472 (struct soc_mixer_control *)kcontrol->private_value;
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 03f0536e6f61..5d4c621dbf99 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -612,7 +612,7 @@ static SOC_ENUM_SINGLE_DECL(max98095_dai3_dac_filter_enum,
612static int max98095_mic1pre_set(struct snd_kcontrol *kcontrol, 612static int max98095_mic1pre_set(struct snd_kcontrol *kcontrol,
613 struct snd_ctl_elem_value *ucontrol) 613 struct snd_ctl_elem_value *ucontrol)
614{ 614{
615 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 615 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
616 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 616 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
617 unsigned int sel = ucontrol->value.integer.value[0]; 617 unsigned int sel = ucontrol->value.integer.value[0];
618 618
@@ -626,7 +626,7 @@ static int max98095_mic1pre_set(struct snd_kcontrol *kcontrol,
626static int max98095_mic1pre_get(struct snd_kcontrol *kcontrol, 626static int max98095_mic1pre_get(struct snd_kcontrol *kcontrol,
627 struct snd_ctl_elem_value *ucontrol) 627 struct snd_ctl_elem_value *ucontrol)
628{ 628{
629 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 629 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
630 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 630 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
631 631
632 ucontrol->value.integer.value[0] = max98095->mic1pre; 632 ucontrol->value.integer.value[0] = max98095->mic1pre;
@@ -636,7 +636,7 @@ static int max98095_mic1pre_get(struct snd_kcontrol *kcontrol,
636static int max98095_mic2pre_set(struct snd_kcontrol *kcontrol, 636static int max98095_mic2pre_set(struct snd_kcontrol *kcontrol,
637 struct snd_ctl_elem_value *ucontrol) 637 struct snd_ctl_elem_value *ucontrol)
638{ 638{
639 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 639 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
640 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 640 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
641 unsigned int sel = ucontrol->value.integer.value[0]; 641 unsigned int sel = ucontrol->value.integer.value[0];
642 642
@@ -650,7 +650,7 @@ static int max98095_mic2pre_set(struct snd_kcontrol *kcontrol,
650static int max98095_mic2pre_get(struct snd_kcontrol *kcontrol, 650static int max98095_mic2pre_get(struct snd_kcontrol *kcontrol,
651 struct snd_ctl_elem_value *ucontrol) 651 struct snd_ctl_elem_value *ucontrol)
652{ 652{
653 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 653 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
654 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 654 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
655 655
656 ucontrol->value.integer.value[0] = max98095->mic2pre; 656 ucontrol->value.integer.value[0] = max98095->mic2pre;
@@ -1737,7 +1737,7 @@ static int max98095_get_eq_channel(const char *name)
1737static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol, 1737static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol,
1738 struct snd_ctl_elem_value *ucontrol) 1738 struct snd_ctl_elem_value *ucontrol)
1739{ 1739{
1740 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1740 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1741 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 1741 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
1742 struct max98095_pdata *pdata = max98095->pdata; 1742 struct max98095_pdata *pdata = max98095->pdata;
1743 int channel = max98095_get_eq_channel(kcontrol->id.name); 1743 int channel = max98095_get_eq_channel(kcontrol->id.name);
@@ -1801,7 +1801,7 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol,
1801static int max98095_get_eq_enum(struct snd_kcontrol *kcontrol, 1801static int max98095_get_eq_enum(struct snd_kcontrol *kcontrol,
1802 struct snd_ctl_elem_value *ucontrol) 1802 struct snd_ctl_elem_value *ucontrol)
1803{ 1803{
1804 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1804 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1805 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 1805 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
1806 int channel = max98095_get_eq_channel(kcontrol->id.name); 1806 int channel = max98095_get_eq_channel(kcontrol->id.name);
1807 struct max98095_cdata *cdata; 1807 struct max98095_cdata *cdata;
@@ -1891,7 +1891,7 @@ static int max98095_get_bq_channel(struct snd_soc_codec *codec,
1891static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol, 1891static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol,
1892 struct snd_ctl_elem_value *ucontrol) 1892 struct snd_ctl_elem_value *ucontrol)
1893{ 1893{
1894 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1894 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1895 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 1895 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
1896 struct max98095_pdata *pdata = max98095->pdata; 1896 struct max98095_pdata *pdata = max98095->pdata;
1897 int channel = max98095_get_bq_channel(codec, kcontrol->id.name); 1897 int channel = max98095_get_bq_channel(codec, kcontrol->id.name);
@@ -1952,7 +1952,7 @@ static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol,
1952static int max98095_get_bq_enum(struct snd_kcontrol *kcontrol, 1952static int max98095_get_bq_enum(struct snd_kcontrol *kcontrol,
1953 struct snd_ctl_elem_value *ucontrol) 1953 struct snd_ctl_elem_value *ucontrol)
1954{ 1954{
1955 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1955 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1956 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 1956 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
1957 int channel = max98095_get_bq_channel(codec, kcontrol->id.name); 1957 int channel = max98095_get_bq_channel(codec, kcontrol->id.name);
1958 struct max98095_cdata *cdata; 1958 struct max98095_cdata *cdata;
diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
index e427544183d7..a722a023c262 100644
--- a/sound/soc/codecs/pcm1681.c
+++ b/sound/soc/codecs/pcm1681.c
@@ -115,7 +115,7 @@ static int pcm1681_set_deemph(struct snd_soc_codec *codec)
115static int pcm1681_get_deemph(struct snd_kcontrol *kcontrol, 115static int pcm1681_get_deemph(struct snd_kcontrol *kcontrol,
116 struct snd_ctl_elem_value *ucontrol) 116 struct snd_ctl_elem_value *ucontrol)
117{ 117{
118 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 118 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
119 struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec); 119 struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
120 120
121 ucontrol->value.enumerated.item[0] = priv->deemph; 121 ucontrol->value.enumerated.item[0] = priv->deemph;
@@ -126,7 +126,7 @@ static int pcm1681_get_deemph(struct snd_kcontrol *kcontrol,
126static int pcm1681_put_deemph(struct snd_kcontrol *kcontrol, 126static int pcm1681_put_deemph(struct snd_kcontrol *kcontrol,
127 struct snd_ctl_elem_value *ucontrol) 127 struct snd_ctl_elem_value *ucontrol)
128{ 128{
129 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 129 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
130 struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec); 130 struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
131 131
132 priv->deemph = ucontrol->value.enumerated.item[0]; 132 priv->deemph = ucontrol->value.enumerated.item[0];
diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
index d4c229f0233f..30e234708579 100644
--- a/sound/soc/codecs/rt5631.c
+++ b/sound/soc/codecs/rt5631.c
@@ -188,7 +188,7 @@ static unsigned int mic_bst_tlv[] = {
188static int rt5631_dmic_get(struct snd_kcontrol *kcontrol, 188static int rt5631_dmic_get(struct snd_kcontrol *kcontrol,
189 struct snd_ctl_elem_value *ucontrol) 189 struct snd_ctl_elem_value *ucontrol)
190{ 190{
191 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 191 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
192 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec); 192 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
193 193
194 ucontrol->value.integer.value[0] = rt5631->dmic_used_flag; 194 ucontrol->value.integer.value[0] = rt5631->dmic_used_flag;
@@ -199,7 +199,7 @@ static int rt5631_dmic_get(struct snd_kcontrol *kcontrol,
199static int rt5631_dmic_put(struct snd_kcontrol *kcontrol, 199static int rt5631_dmic_put(struct snd_kcontrol *kcontrol,
200 struct snd_ctl_elem_value *ucontrol) 200 struct snd_ctl_elem_value *ucontrol)
201{ 201{
202 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 202 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
203 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec); 203 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
204 204
205 rt5631->dmic_used_flag = ucontrol->value.integer.value[0]; 205 rt5631->dmic_used_flag = ucontrol->value.integer.value[0];
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index d3ed1be5a186..b56caefcf664 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -296,7 +296,7 @@ static int dac_info_volsw(struct snd_kcontrol *kcontrol,
296static int dac_get_volsw(struct snd_kcontrol *kcontrol, 296static int dac_get_volsw(struct snd_kcontrol *kcontrol,
297 struct snd_ctl_elem_value *ucontrol) 297 struct snd_ctl_elem_value *ucontrol)
298{ 298{
299 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 299 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
300 int reg; 300 int reg;
301 int l; 301 int l;
302 int r; 302 int r;
@@ -349,7 +349,7 @@ static int dac_get_volsw(struct snd_kcontrol *kcontrol,
349static int dac_put_volsw(struct snd_kcontrol *kcontrol, 349static int dac_put_volsw(struct snd_kcontrol *kcontrol,
350 struct snd_ctl_elem_value *ucontrol) 350 struct snd_ctl_elem_value *ucontrol)
351{ 351{
352 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 352 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
353 int reg; 353 int reg;
354 int l; 354 int l;
355 int r; 355 int r;
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 12577749b17b..0579d187135b 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -243,7 +243,7 @@ static int sta32x_coefficient_info(struct snd_kcontrol *kcontrol,
243static int sta32x_coefficient_get(struct snd_kcontrol *kcontrol, 243static int sta32x_coefficient_get(struct snd_kcontrol *kcontrol,
244 struct snd_ctl_elem_value *ucontrol) 244 struct snd_ctl_elem_value *ucontrol)
245{ 245{
246 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 246 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
247 int numcoef = kcontrol->private_value >> 16; 247 int numcoef = kcontrol->private_value >> 16;
248 int index = kcontrol->private_value & 0xffff; 248 int index = kcontrol->private_value & 0xffff;
249 unsigned int cfud; 249 unsigned int cfud;
@@ -272,7 +272,7 @@ static int sta32x_coefficient_get(struct snd_kcontrol *kcontrol,
272static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, 272static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol,
273 struct snd_ctl_elem_value *ucontrol) 273 struct snd_ctl_elem_value *ucontrol)
274{ 274{
275 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 275 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
276 struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); 276 struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec);
277 int numcoef = kcontrol->private_value >> 16; 277 int numcoef = kcontrol->private_value >> 16;
278 int index = kcontrol->private_value & 0xffff; 278 int index = kcontrol->private_value & 0xffff;
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index a895a5e4bdf2..d48491a4a19d 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -272,7 +272,7 @@ static int tas5086_set_deemph(struct snd_soc_codec *codec)
272static int tas5086_get_deemph(struct snd_kcontrol *kcontrol, 272static int tas5086_get_deemph(struct snd_kcontrol *kcontrol,
273 struct snd_ctl_elem_value *ucontrol) 273 struct snd_ctl_elem_value *ucontrol)
274{ 274{
275 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 275 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
276 struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec); 276 struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
277 277
278 ucontrol->value.enumerated.item[0] = priv->deemph; 278 ucontrol->value.enumerated.item[0] = priv->deemph;
@@ -283,7 +283,7 @@ static int tas5086_get_deemph(struct snd_kcontrol *kcontrol,
283static int tas5086_put_deemph(struct snd_kcontrol *kcontrol, 283static int tas5086_put_deemph(struct snd_kcontrol *kcontrol,
284 struct snd_ctl_elem_value *ucontrol) 284 struct snd_ctl_elem_value *ucontrol)
285{ 285{
286 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 286 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
287 struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec); 287 struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
288 288
289 priv->deemph = ucontrol->value.enumerated.item[0]; 289 priv->deemph = ucontrol->value.enumerated.item[0];
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index 20864ee8793b..686b8b85b956 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -82,7 +82,7 @@ static const DECLARE_TLV_DB_SCALE(sidetone_vol_tlv, -1800, 300, 0);
82static int snd_soc_tlv320aic23_put_volsw(struct snd_kcontrol *kcontrol, 82static int snd_soc_tlv320aic23_put_volsw(struct snd_kcontrol *kcontrol,
83 struct snd_ctl_elem_value *ucontrol) 83 struct snd_ctl_elem_value *ucontrol)
84{ 84{
85 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 85 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
86 u16 val, reg; 86 u16 val, reg;
87 87
88 val = (ucontrol->value.integer.value[0] & 0x07); 88 val = (ucontrol->value.integer.value[0] & 0x07);
@@ -105,7 +105,7 @@ static int snd_soc_tlv320aic23_put_volsw(struct snd_kcontrol *kcontrol,
105static int snd_soc_tlv320aic23_get_volsw(struct snd_kcontrol *kcontrol, 105static int snd_soc_tlv320aic23_get_volsw(struct snd_kcontrol *kcontrol,
106 struct snd_ctl_elem_value *ucontrol) 106 struct snd_ctl_elem_value *ucontrol)
107{ 107{
108 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 108 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
109 u16 val; 109 u16 val;
110 110
111 val = snd_soc_read(codec, TLV320AIC23_ANLG) & (0x1C0); 111 val = snd_soc_read(codec, TLV320AIC23_ANLG) & (0x1C0);
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 6bfc8a17331b..517055ab65ef 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -442,7 +442,7 @@ static int dac33_playback_event(struct snd_soc_dapm_widget *w,
442static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol, 442static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol,
443 struct snd_ctl_elem_value *ucontrol) 443 struct snd_ctl_elem_value *ucontrol)
444{ 444{
445 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 445 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
446 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 446 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
447 447
448 ucontrol->value.integer.value[0] = dac33->fifo_mode; 448 ucontrol->value.integer.value[0] = dac33->fifo_mode;
@@ -453,7 +453,7 @@ static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol,
453static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol, 453static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,
454 struct snd_ctl_elem_value *ucontrol) 454 struct snd_ctl_elem_value *ucontrol)
455{ 455{
456 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 456 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
457 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 457 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
458 int ret = 0; 458 int ret = 0;
459 459
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 975e0f760ac1..69e12a311ba2 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -830,7 +830,7 @@ static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol,
830{ 830{
831 struct soc_mixer_control *mc = 831 struct soc_mixer_control *mc =
832 (struct soc_mixer_control *)kcontrol->private_value; 832 (struct soc_mixer_control *)kcontrol->private_value;
833 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 833 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
834 unsigned int reg = mc->reg; 834 unsigned int reg = mc->reg;
835 unsigned int shift = mc->shift; 835 unsigned int shift = mc->shift;
836 unsigned int rshift = mc->rshift; 836 unsigned int rshift = mc->rshift;
@@ -859,7 +859,7 @@ static int snd_soc_put_volsw_twl4030(struct snd_kcontrol *kcontrol,
859{ 859{
860 struct soc_mixer_control *mc = 860 struct soc_mixer_control *mc =
861 (struct soc_mixer_control *)kcontrol->private_value; 861 (struct soc_mixer_control *)kcontrol->private_value;
862 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 862 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
863 unsigned int reg = mc->reg; 863 unsigned int reg = mc->reg;
864 unsigned int shift = mc->shift; 864 unsigned int shift = mc->shift;
865 unsigned int rshift = mc->rshift; 865 unsigned int rshift = mc->rshift;
@@ -888,7 +888,7 @@ static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
888{ 888{
889 struct soc_mixer_control *mc = 889 struct soc_mixer_control *mc =
890 (struct soc_mixer_control *)kcontrol->private_value; 890 (struct soc_mixer_control *)kcontrol->private_value;
891 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 891 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
892 unsigned int reg = mc->reg; 892 unsigned int reg = mc->reg;
893 unsigned int reg2 = mc->rreg; 893 unsigned int reg2 = mc->rreg;
894 unsigned int shift = mc->shift; 894 unsigned int shift = mc->shift;
@@ -915,7 +915,7 @@ static int snd_soc_put_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
915{ 915{
916 struct soc_mixer_control *mc = 916 struct soc_mixer_control *mc =
917 (struct soc_mixer_control *)kcontrol->private_value; 917 (struct soc_mixer_control *)kcontrol->private_value;
918 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 918 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
919 unsigned int reg = mc->reg; 919 unsigned int reg = mc->reg;
920 unsigned int reg2 = mc->rreg; 920 unsigned int reg2 = mc->rreg;
921 unsigned int shift = mc->shift; 921 unsigned int shift = mc->shift;
@@ -956,7 +956,7 @@ static SOC_ENUM_SINGLE_DECL(twl4030_op_modes_enum,
956static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol, 956static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol,
957 struct snd_ctl_elem_value *ucontrol) 957 struct snd_ctl_elem_value *ucontrol)
958{ 958{
959 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 959 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
960 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 960 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
961 961
962 if (twl4030->configured) { 962 if (twl4030->configured) {
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index bd3a20647fdf..0f6067f04e29 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -484,7 +484,7 @@ static SOC_ENUM_SINGLE_EXT_DECL(twl6040_power_mode_enum,
484static int twl6040_headset_power_get_enum(struct snd_kcontrol *kcontrol, 484static int twl6040_headset_power_get_enum(struct snd_kcontrol *kcontrol,
485 struct snd_ctl_elem_value *ucontrol) 485 struct snd_ctl_elem_value *ucontrol)
486{ 486{
487 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 487 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
488 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 488 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
489 489
490 ucontrol->value.enumerated.item[0] = priv->hs_power_mode; 490 ucontrol->value.enumerated.item[0] = priv->hs_power_mode;
@@ -495,7 +495,7 @@ static int twl6040_headset_power_get_enum(struct snd_kcontrol *kcontrol,
495static int twl6040_headset_power_put_enum(struct snd_kcontrol *kcontrol, 495static int twl6040_headset_power_put_enum(struct snd_kcontrol *kcontrol,
496 struct snd_ctl_elem_value *ucontrol) 496 struct snd_ctl_elem_value *ucontrol)
497{ 497{
498 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 498 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
499 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 499 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
500 int high_perf = ucontrol->value.enumerated.item[0]; 500 int high_perf = ucontrol->value.enumerated.item[0];
501 int ret = 0; 501 int ret = 0;
@@ -512,7 +512,7 @@ static int twl6040_headset_power_put_enum(struct snd_kcontrol *kcontrol,
512static int twl6040_pll_get_enum(struct snd_kcontrol *kcontrol, 512static int twl6040_pll_get_enum(struct snd_kcontrol *kcontrol,
513 struct snd_ctl_elem_value *ucontrol) 513 struct snd_ctl_elem_value *ucontrol)
514{ 514{
515 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 515 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
516 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 516 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
517 517
518 ucontrol->value.enumerated.item[0] = priv->pll_power_mode; 518 ucontrol->value.enumerated.item[0] = priv->pll_power_mode;
@@ -523,7 +523,7 @@ static int twl6040_pll_get_enum(struct snd_kcontrol *kcontrol,
523static int twl6040_pll_put_enum(struct snd_kcontrol *kcontrol, 523static int twl6040_pll_put_enum(struct snd_kcontrol *kcontrol,
524 struct snd_ctl_elem_value *ucontrol) 524 struct snd_ctl_elem_value *ucontrol)
525{ 525{
526 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 526 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
527 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 527 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
528 528
529 priv->pll_power_mode = ucontrol->value.enumerated.item[0]; 529 priv->pll_power_mode = ucontrol->value.enumerated.item[0];
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index 6be5f80b65f1..4ead0dc02b87 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -172,7 +172,7 @@ out:
172static int snd_wl1273_get_audio_route(struct snd_kcontrol *kcontrol, 172static int snd_wl1273_get_audio_route(struct snd_kcontrol *kcontrol,
173 struct snd_ctl_elem_value *ucontrol) 173 struct snd_ctl_elem_value *ucontrol)
174{ 174{
175 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 175 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
176 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 176 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
177 177
178 ucontrol->value.integer.value[0] = wl1273->mode; 178 ucontrol->value.integer.value[0] = wl1273->mode;
@@ -190,7 +190,7 @@ static const char * const wl1273_audio_route[] = { "Bt", "FmRx", "FmTx" };
190static int snd_wl1273_set_audio_route(struct snd_kcontrol *kcontrol, 190static int snd_wl1273_set_audio_route(struct snd_kcontrol *kcontrol,
191 struct snd_ctl_elem_value *ucontrol) 191 struct snd_ctl_elem_value *ucontrol)
192{ 192{
193 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 193 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
194 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 194 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
195 195
196 if (wl1273->mode == ucontrol->value.integer.value[0]) 196 if (wl1273->mode == ucontrol->value.integer.value[0])
@@ -214,7 +214,7 @@ static SOC_ENUM_SINGLE_EXT_DECL(wl1273_enum, wl1273_audio_route);
214static int snd_wl1273_fm_audio_get(struct snd_kcontrol *kcontrol, 214static int snd_wl1273_fm_audio_get(struct snd_kcontrol *kcontrol,
215 struct snd_ctl_elem_value *ucontrol) 215 struct snd_ctl_elem_value *ucontrol)
216{ 216{
217 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 217 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
218 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 218 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
219 219
220 dev_dbg(codec->dev, "%s: enter.\n", __func__); 220 dev_dbg(codec->dev, "%s: enter.\n", __func__);
@@ -227,7 +227,7 @@ static int snd_wl1273_fm_audio_get(struct snd_kcontrol *kcontrol,
227static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol, 227static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol,
228 struct snd_ctl_elem_value *ucontrol) 228 struct snd_ctl_elem_value *ucontrol)
229{ 229{
230 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 230 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
231 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 231 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
232 int val, r = 0; 232 int val, r = 0;
233 233
@@ -251,7 +251,7 @@ static SOC_ENUM_SINGLE_EXT_DECL(wl1273_audio_enum, wl1273_audio_strings);
251static int snd_wl1273_fm_volume_get(struct snd_kcontrol *kcontrol, 251static int snd_wl1273_fm_volume_get(struct snd_kcontrol *kcontrol,
252 struct snd_ctl_elem_value *ucontrol) 252 struct snd_ctl_elem_value *ucontrol)
253{ 253{
254 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 254 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
255 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 255 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
256 256
257 dev_dbg(codec->dev, "%s: enter.\n", __func__); 257 dev_dbg(codec->dev, "%s: enter.\n", __func__);
@@ -264,7 +264,7 @@ static int snd_wl1273_fm_volume_get(struct snd_kcontrol *kcontrol,
264static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol, 264static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol,
265 struct snd_ctl_elem_value *ucontrol) 265 struct snd_ctl_elem_value *ucontrol)
266{ 266{
267 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 267 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
268 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 268 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
269 int r; 269 int r;
270 270
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)
607static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, 607static 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,
618static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, 618static 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,
640static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, 640static 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,
651static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, 651static 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;
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index 757256bf7672..42a72b2404d5 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -302,7 +302,7 @@ static int pga_event(struct snd_soc_dapm_widget *w,
302static int wm8350_put_volsw_2r_vu(struct snd_kcontrol *kcontrol, 302static int wm8350_put_volsw_2r_vu(struct snd_kcontrol *kcontrol,
303 struct snd_ctl_elem_value *ucontrol) 303 struct snd_ctl_elem_value *ucontrol)
304{ 304{
305 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 305 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
306 struct wm8350_data *wm8350_priv = snd_soc_codec_get_drvdata(codec); 306 struct wm8350_data *wm8350_priv = snd_soc_codec_get_drvdata(codec);
307 struct wm8350_output *out = NULL; 307 struct wm8350_output *out = NULL;
308 struct soc_mixer_control *mc = 308 struct soc_mixer_control *mc =
@@ -345,7 +345,7 @@ static int wm8350_put_volsw_2r_vu(struct snd_kcontrol *kcontrol,
345static int wm8350_get_volsw_2r(struct snd_kcontrol *kcontrol, 345static int wm8350_get_volsw_2r(struct snd_kcontrol *kcontrol,
346 struct snd_ctl_elem_value *ucontrol) 346 struct snd_ctl_elem_value *ucontrol)
347{ 347{
348 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 348 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
349 struct wm8350_data *wm8350_priv = snd_soc_codec_get_drvdata(codec); 349 struct wm8350_data *wm8350_priv = snd_soc_codec_get_drvdata(codec);
350 struct wm8350_output *out1 = &wm8350_priv->out1; 350 struct wm8350_output *out1 = &wm8350_priv->out1;
351 struct wm8350_output *out2 = &wm8350_priv->out2; 351 struct wm8350_output *out2 = &wm8350_priv->out2;
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 146564feaea0..edfdbcd9d316 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -93,7 +93,7 @@ static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
93static int wm8400_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol, 93static int wm8400_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
94 struct snd_ctl_elem_value *ucontrol) 94 struct snd_ctl_elem_value *ucontrol)
95{ 95{
96 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 96 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
97 struct soc_mixer_control *mc = 97 struct soc_mixer_control *mc =
98 (struct soc_mixer_control *)kcontrol->private_value; 98 (struct soc_mixer_control *)kcontrol->private_value;
99 int reg = mc->reg; 99 int reg = mc->reg;
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index af7ed8b5d4e1..7665ff6aea6d 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -252,7 +252,7 @@ static int wm8580_out_vu(struct snd_kcontrol *kcontrol,
252{ 252{
253 struct soc_mixer_control *mc = 253 struct soc_mixer_control *mc =
254 (struct soc_mixer_control *)kcontrol->private_value; 254 (struct soc_mixer_control *)kcontrol->private_value;
255 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 255 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
256 struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); 256 struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
257 unsigned int reg = mc->reg; 257 unsigned int reg = mc->reg;
258 unsigned int reg2 = mc->rreg; 258 unsigned int reg2 = mc->rreg;
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index d74f43975b90..763b265d9528 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -119,7 +119,7 @@ static int wm8731_set_deemph(struct snd_soc_codec *codec)
119static int wm8731_get_deemph(struct snd_kcontrol *kcontrol, 119static int wm8731_get_deemph(struct snd_kcontrol *kcontrol,
120 struct snd_ctl_elem_value *ucontrol) 120 struct snd_ctl_elem_value *ucontrol)
121{ 121{
122 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 122 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
123 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); 123 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
124 124
125 ucontrol->value.enumerated.item[0] = wm8731->deemph; 125 ucontrol->value.enumerated.item[0] = wm8731->deemph;
@@ -130,7 +130,7 @@ static int wm8731_get_deemph(struct snd_kcontrol *kcontrol,
130static int wm8731_put_deemph(struct snd_kcontrol *kcontrol, 130static int wm8731_put_deemph(struct snd_kcontrol *kcontrol,
131 struct snd_ctl_elem_value *ucontrol) 131 struct snd_ctl_elem_value *ucontrol)
132{ 132{
133 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 133 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
134 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); 134 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
135 int deemph = ucontrol->value.enumerated.item[0]; 135 int deemph = ucontrol->value.enumerated.item[0];
136 int ret = 0; 136 int ret = 0;
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index cbb8d55052a4..53e57b4049a8 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -234,7 +234,7 @@ SOC_ENUM_SINGLE(WM8753_OUTCTL, 2, 2, wm8753_rout2_phase),
234static int wm8753_get_dai(struct snd_kcontrol *kcontrol, 234static int wm8753_get_dai(struct snd_kcontrol *kcontrol,
235 struct snd_ctl_elem_value *ucontrol) 235 struct snd_ctl_elem_value *ucontrol)
236{ 236{
237 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 237 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
238 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); 238 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
239 239
240 ucontrol->value.integer.value[0] = wm8753->dai_func; 240 ucontrol->value.integer.value[0] = wm8753->dai_func;
@@ -244,7 +244,7 @@ static int wm8753_get_dai(struct snd_kcontrol *kcontrol,
244static int wm8753_set_dai(struct snd_kcontrol *kcontrol, 244static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
245 struct snd_ctl_elem_value *ucontrol) 245 struct snd_ctl_elem_value *ucontrol)
246{ 246{
247 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 247 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
248 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); 248 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
249 u16 ioctl; 249 u16 ioctl;
250 250
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c
index ee76f0fb4299..589455c3bfcd 100644
--- a/sound/soc/codecs/wm8804.c
+++ b/sound/soc/codecs/wm8804.c
@@ -106,7 +106,7 @@ static int txsrc_get(struct snd_kcontrol *kcontrol,
106 struct snd_soc_codec *codec; 106 struct snd_soc_codec *codec;
107 unsigned int src; 107 unsigned int src;
108 108
109 codec = snd_kcontrol_chip(kcontrol); 109 codec = snd_soc_kcontrol_codec(kcontrol);
110 src = snd_soc_read(codec, WM8804_SPDTX4); 110 src = snd_soc_read(codec, WM8804_SPDTX4);
111 if (src & 0x40) 111 if (src & 0x40)
112 ucontrol->value.integer.value[0] = 1; 112 ucontrol->value.integer.value[0] = 1;
@@ -122,7 +122,7 @@ static int txsrc_put(struct snd_kcontrol *kcontrol,
122 struct snd_soc_codec *codec; 122 struct snd_soc_codec *codec;
123 unsigned int src, txpwr; 123 unsigned int src, txpwr;
124 124
125 codec = snd_kcontrol_chip(kcontrol); 125 codec = snd_soc_kcontrol_codec(kcontrol);
126 126
127 if (ucontrol->value.integer.value[0] != 0 127 if (ucontrol->value.integer.value[0] != 0
128 && ucontrol->value.integer.value[0] != 1) 128 && ucontrol->value.integer.value[0] != 1)
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index b0084a127d18..b84940c359a1 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -439,7 +439,7 @@ static int wm8903_set_deemph(struct snd_soc_codec *codec)
439static int wm8903_get_deemph(struct snd_kcontrol *kcontrol, 439static int wm8903_get_deemph(struct snd_kcontrol *kcontrol,
440 struct snd_ctl_elem_value *ucontrol) 440 struct snd_ctl_elem_value *ucontrol)
441{ 441{
442 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 442 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
443 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); 443 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
444 444
445 ucontrol->value.enumerated.item[0] = wm8903->deemph; 445 ucontrol->value.enumerated.item[0] = wm8903->deemph;
@@ -450,7 +450,7 @@ static int wm8903_get_deemph(struct snd_kcontrol *kcontrol,
450static int wm8903_put_deemph(struct snd_kcontrol *kcontrol, 450static int wm8903_put_deemph(struct snd_kcontrol *kcontrol,
451 struct snd_ctl_elem_value *ucontrol) 451 struct snd_ctl_elem_value *ucontrol)
452{ 452{
453 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 453 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
454 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); 454 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
455 int deemph = ucontrol->value.enumerated.item[0]; 455 int deemph = ucontrol->value.enumerated.item[0];
456 int ret = 0; 456 int ret = 0;
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 49c35c36935e..f7c549949c54 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -391,7 +391,7 @@ static void wm8904_set_drc(struct snd_soc_codec *codec)
391static int wm8904_put_drc_enum(struct snd_kcontrol *kcontrol, 391static int wm8904_put_drc_enum(struct snd_kcontrol *kcontrol,
392 struct snd_ctl_elem_value *ucontrol) 392 struct snd_ctl_elem_value *ucontrol)
393{ 393{
394 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 394 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
395 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 395 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
396 struct wm8904_pdata *pdata = wm8904->pdata; 396 struct wm8904_pdata *pdata = wm8904->pdata;
397 int value = ucontrol->value.integer.value[0]; 397 int value = ucontrol->value.integer.value[0];
@@ -409,7 +409,7 @@ static int wm8904_put_drc_enum(struct snd_kcontrol *kcontrol,
409static int wm8904_get_drc_enum(struct snd_kcontrol *kcontrol, 409static int wm8904_get_drc_enum(struct snd_kcontrol *kcontrol,
410 struct snd_ctl_elem_value *ucontrol) 410 struct snd_ctl_elem_value *ucontrol)
411{ 411{
412 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 412 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
413 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 413 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
414 414
415 ucontrol->value.enumerated.item[0] = wm8904->drc_cfg; 415 ucontrol->value.enumerated.item[0] = wm8904->drc_cfg;
@@ -462,7 +462,7 @@ static void wm8904_set_retune_mobile(struct snd_soc_codec *codec)
462static int wm8904_put_retune_mobile_enum(struct snd_kcontrol *kcontrol, 462static int wm8904_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
463 struct snd_ctl_elem_value *ucontrol) 463 struct snd_ctl_elem_value *ucontrol)
464{ 464{
465 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 465 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
466 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 466 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
467 struct wm8904_pdata *pdata = wm8904->pdata; 467 struct wm8904_pdata *pdata = wm8904->pdata;
468 int value = ucontrol->value.integer.value[0]; 468 int value = ucontrol->value.integer.value[0];
@@ -480,7 +480,7 @@ static int wm8904_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
480static int wm8904_get_retune_mobile_enum(struct snd_kcontrol *kcontrol, 480static int wm8904_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,
481 struct snd_ctl_elem_value *ucontrol) 481 struct snd_ctl_elem_value *ucontrol)
482{ 482{
483 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 483 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
484 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 484 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
485 485
486 ucontrol->value.enumerated.item[0] = wm8904->retune_mobile_cfg; 486 ucontrol->value.enumerated.item[0] = wm8904->retune_mobile_cfg;
@@ -520,7 +520,7 @@ static int wm8904_set_deemph(struct snd_soc_codec *codec)
520static int wm8904_get_deemph(struct snd_kcontrol *kcontrol, 520static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,
521 struct snd_ctl_elem_value *ucontrol) 521 struct snd_ctl_elem_value *ucontrol)
522{ 522{
523 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 523 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
524 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 524 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
525 525
526 ucontrol->value.enumerated.item[0] = wm8904->deemph; 526 ucontrol->value.enumerated.item[0] = wm8904->deemph;
@@ -530,7 +530,7 @@ static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,
530static int wm8904_put_deemph(struct snd_kcontrol *kcontrol, 530static int wm8904_put_deemph(struct snd_kcontrol *kcontrol,
531 struct snd_ctl_elem_value *ucontrol) 531 struct snd_ctl_elem_value *ucontrol)
532{ 532{
533 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 533 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
534 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 534 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
535 int deemph = ucontrol->value.enumerated.item[0]; 535 int deemph = ucontrol->value.enumerated.item[0];
536 536
@@ -570,7 +570,7 @@ static SOC_ENUM_SINGLE_DECL(hpf_mode, WM8904_ADC_DIGITAL_0, 5,
570static int wm8904_adc_osr_put(struct snd_kcontrol *kcontrol, 570static int wm8904_adc_osr_put(struct snd_kcontrol *kcontrol,
571 struct snd_ctl_elem_value *ucontrol) 571 struct snd_ctl_elem_value *ucontrol)
572{ 572{
573 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 573 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
574 unsigned int val; 574 unsigned int val;
575 int ret; 575 int ret;
576 576
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
index fecd4e4f4c57..7e443c4f6f85 100644
--- a/sound/soc/codecs/wm8955.c
+++ b/sound/soc/codecs/wm8955.c
@@ -390,7 +390,7 @@ static int wm8955_set_deemph(struct snd_soc_codec *codec)
390static int wm8955_get_deemph(struct snd_kcontrol *kcontrol, 390static int wm8955_get_deemph(struct snd_kcontrol *kcontrol,
391 struct snd_ctl_elem_value *ucontrol) 391 struct snd_ctl_elem_value *ucontrol)
392{ 392{
393 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 393 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
394 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); 394 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
395 395
396 ucontrol->value.enumerated.item[0] = wm8955->deemph; 396 ucontrol->value.enumerated.item[0] = wm8955->deemph;
@@ -400,7 +400,7 @@ static int wm8955_get_deemph(struct snd_kcontrol *kcontrol,
400static int wm8955_put_deemph(struct snd_kcontrol *kcontrol, 400static int wm8955_put_deemph(struct snd_kcontrol *kcontrol,
401 struct snd_ctl_elem_value *ucontrol) 401 struct snd_ctl_elem_value *ucontrol)
402{ 402{
403 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 403 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
404 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); 404 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
405 int deemph = ucontrol->value.enumerated.item[0]; 405 int deemph = ucontrol->value.enumerated.item[0];
406 406
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c
index 7ac2e511403c..b2ebb104d879 100644
--- a/sound/soc/codecs/wm8958-dsp2.c
+++ b/sound/soc/codecs/wm8958-dsp2.c
@@ -456,7 +456,7 @@ static int wm8958_dsp2_busy(struct wm8994_priv *wm8994, int aif)
456static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol, 456static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol,
457 struct snd_ctl_elem_value *ucontrol) 457 struct snd_ctl_elem_value *ucontrol)
458{ 458{
459 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 459 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
460 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 460 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
461 struct wm8994 *control = wm8994->wm8994; 461 struct wm8994 *control = wm8994->wm8994;
462 int value = ucontrol->value.integer.value[0]; 462 int value = ucontrol->value.integer.value[0];
@@ -478,7 +478,7 @@ static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol,
478static int wm8958_get_mbc_enum(struct snd_kcontrol *kcontrol, 478static int wm8958_get_mbc_enum(struct snd_kcontrol *kcontrol,
479 struct snd_ctl_elem_value *ucontrol) 479 struct snd_ctl_elem_value *ucontrol)
480{ 480{
481 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 481 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
482 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 482 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
483 483
484 ucontrol->value.enumerated.item[0] = wm8994->mbc_cfg; 484 ucontrol->value.enumerated.item[0] = wm8994->mbc_cfg;
@@ -500,7 +500,7 @@ static int wm8958_mbc_get(struct snd_kcontrol *kcontrol,
500 struct snd_ctl_elem_value *ucontrol) 500 struct snd_ctl_elem_value *ucontrol)
501{ 501{
502 int mbc = kcontrol->private_value; 502 int mbc = kcontrol->private_value;
503 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 503 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
504 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 504 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
505 505
506 ucontrol->value.integer.value[0] = wm8994->mbc_ena[mbc]; 506 ucontrol->value.integer.value[0] = wm8994->mbc_ena[mbc];
@@ -512,7 +512,7 @@ static int wm8958_mbc_put(struct snd_kcontrol *kcontrol,
512 struct snd_ctl_elem_value *ucontrol) 512 struct snd_ctl_elem_value *ucontrol)
513{ 513{
514 int mbc = kcontrol->private_value; 514 int mbc = kcontrol->private_value;
515 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 515 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
516 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 516 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
517 517
518 if (wm8994->mbc_ena[mbc] == ucontrol->value.integer.value[0]) 518 if (wm8994->mbc_ena[mbc] == ucontrol->value.integer.value[0])
@@ -546,7 +546,7 @@ static int wm8958_mbc_put(struct snd_kcontrol *kcontrol,
546static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol, 546static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol,
547 struct snd_ctl_elem_value *ucontrol) 547 struct snd_ctl_elem_value *ucontrol)
548{ 548{
549 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 549 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
550 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 550 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
551 struct wm8994 *control = wm8994->wm8994; 551 struct wm8994 *control = wm8994->wm8994;
552 int value = ucontrol->value.integer.value[0]; 552 int value = ucontrol->value.integer.value[0];
@@ -568,7 +568,7 @@ static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol,
568static int wm8958_get_vss_enum(struct snd_kcontrol *kcontrol, 568static int wm8958_get_vss_enum(struct snd_kcontrol *kcontrol,
569 struct snd_ctl_elem_value *ucontrol) 569 struct snd_ctl_elem_value *ucontrol)
570{ 570{
571 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 571 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
572 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 572 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
573 573
574 ucontrol->value.enumerated.item[0] = wm8994->vss_cfg; 574 ucontrol->value.enumerated.item[0] = wm8994->vss_cfg;
@@ -579,7 +579,7 @@ static int wm8958_get_vss_enum(struct snd_kcontrol *kcontrol,
579static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol, 579static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol,
580 struct snd_ctl_elem_value *ucontrol) 580 struct snd_ctl_elem_value *ucontrol)
581{ 581{
582 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 582 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
583 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 583 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
584 struct wm8994 *control = wm8994->wm8994; 584 struct wm8994 *control = wm8994->wm8994;
585 int value = ucontrol->value.integer.value[0]; 585 int value = ucontrol->value.integer.value[0];
@@ -601,7 +601,7 @@ static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol,
601static int wm8958_get_vss_hpf_enum(struct snd_kcontrol *kcontrol, 601static int wm8958_get_vss_hpf_enum(struct snd_kcontrol *kcontrol,
602 struct snd_ctl_elem_value *ucontrol) 602 struct snd_ctl_elem_value *ucontrol)
603{ 603{
604 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 604 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
605 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 605 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
606 606
607 ucontrol->value.enumerated.item[0] = wm8994->vss_hpf_cfg; 607 ucontrol->value.enumerated.item[0] = wm8994->vss_hpf_cfg;
@@ -623,7 +623,7 @@ static int wm8958_vss_get(struct snd_kcontrol *kcontrol,
623 struct snd_ctl_elem_value *ucontrol) 623 struct snd_ctl_elem_value *ucontrol)
624{ 624{
625 int vss = kcontrol->private_value; 625 int vss = kcontrol->private_value;
626 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 626 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
627 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 627 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
628 628
629 ucontrol->value.integer.value[0] = wm8994->vss_ena[vss]; 629 ucontrol->value.integer.value[0] = wm8994->vss_ena[vss];
@@ -635,7 +635,7 @@ static int wm8958_vss_put(struct snd_kcontrol *kcontrol,
635 struct snd_ctl_elem_value *ucontrol) 635 struct snd_ctl_elem_value *ucontrol)
636{ 636{
637 int vss = kcontrol->private_value; 637 int vss = kcontrol->private_value;
638 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 638 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
639 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 639 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
640 640
641 if (wm8994->vss_ena[vss] == ucontrol->value.integer.value[0]) 641 if (wm8994->vss_ena[vss] == ucontrol->value.integer.value[0])
@@ -684,7 +684,7 @@ static int wm8958_hpf_get(struct snd_kcontrol *kcontrol,
684 struct snd_ctl_elem_value *ucontrol) 684 struct snd_ctl_elem_value *ucontrol)
685{ 685{
686 int hpf = kcontrol->private_value; 686 int hpf = kcontrol->private_value;
687 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 687 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
688 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 688 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
689 689
690 if (hpf < 3) 690 if (hpf < 3)
@@ -699,7 +699,7 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol,
699 struct snd_ctl_elem_value *ucontrol) 699 struct snd_ctl_elem_value *ucontrol)
700{ 700{
701 int hpf = kcontrol->private_value; 701 int hpf = kcontrol->private_value;
702 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 702 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
703 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 703 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
704 704
705 if (hpf < 3) { 705 if (hpf < 3) {
@@ -746,7 +746,7 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol,
746static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol, 746static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol,
747 struct snd_ctl_elem_value *ucontrol) 747 struct snd_ctl_elem_value *ucontrol)
748{ 748{
749 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 749 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
750 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 750 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
751 struct wm8994 *control = wm8994->wm8994; 751 struct wm8994 *control = wm8994->wm8994;
752 int value = ucontrol->value.integer.value[0]; 752 int value = ucontrol->value.integer.value[0];
@@ -768,7 +768,7 @@ static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol,
768static int wm8958_get_enh_eq_enum(struct snd_kcontrol *kcontrol, 768static int wm8958_get_enh_eq_enum(struct snd_kcontrol *kcontrol,
769 struct snd_ctl_elem_value *ucontrol) 769 struct snd_ctl_elem_value *ucontrol)
770{ 770{
771 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 771 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
772 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 772 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
773 773
774 ucontrol->value.enumerated.item[0] = wm8994->enh_eq_cfg; 774 ucontrol->value.enumerated.item[0] = wm8994->enh_eq_cfg;
@@ -790,7 +790,7 @@ static int wm8958_enh_eq_get(struct snd_kcontrol *kcontrol,
790 struct snd_ctl_elem_value *ucontrol) 790 struct snd_ctl_elem_value *ucontrol)
791{ 791{
792 int eq = kcontrol->private_value; 792 int eq = kcontrol->private_value;
793 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 793 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
794 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 794 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
795 795
796 ucontrol->value.integer.value[0] = wm8994->enh_eq_ena[eq]; 796 ucontrol->value.integer.value[0] = wm8994->enh_eq_ena[eq];
@@ -802,7 +802,7 @@ static int wm8958_enh_eq_put(struct snd_kcontrol *kcontrol,
802 struct snd_ctl_elem_value *ucontrol) 802 struct snd_ctl_elem_value *ucontrol)
803{ 803{
804 int eq = kcontrol->private_value; 804 int eq = kcontrol->private_value;
805 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 805 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
806 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 806 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
807 807
808 if (wm8994->enh_eq_ena[eq] == ucontrol->value.integer.value[0]) 808 if (wm8994->enh_eq_ena[eq] == ucontrol->value.integer.value[0])
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index d04e9cad445c..a145d0431b63 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -178,7 +178,7 @@ static int wm8960_set_deemph(struct snd_soc_codec *codec)
178static int wm8960_get_deemph(struct snd_kcontrol *kcontrol, 178static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,
179 struct snd_ctl_elem_value *ucontrol) 179 struct snd_ctl_elem_value *ucontrol)
180{ 180{
181 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 181 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
182 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); 182 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
183 183
184 ucontrol->value.enumerated.item[0] = wm8960->deemph; 184 ucontrol->value.enumerated.item[0] = wm8960->deemph;
@@ -188,7 +188,7 @@ static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,
188static int wm8960_put_deemph(struct snd_kcontrol *kcontrol, 188static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
189 struct snd_ctl_elem_value *ucontrol) 189 struct snd_ctl_elem_value *ucontrol)
190{ 190{
191 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 191 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
192 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); 192 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
193 int deemph = ucontrol->value.enumerated.item[0]; 193 int deemph = ucontrol->value.enumerated.item[0];
194 194
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 5522d2566c67..37986c84cbff 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -1552,7 +1552,7 @@ static int wm8962_dsp2_ena_get(struct snd_kcontrol *kcontrol,
1552 struct snd_ctl_elem_value *ucontrol) 1552 struct snd_ctl_elem_value *ucontrol)
1553{ 1553{
1554 int shift = kcontrol->private_value; 1554 int shift = kcontrol->private_value;
1555 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1555 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1556 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 1556 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
1557 1557
1558 ucontrol->value.integer.value[0] = !!(wm8962->dsp2_ena & 1 << shift); 1558 ucontrol->value.integer.value[0] = !!(wm8962->dsp2_ena & 1 << shift);
@@ -1564,7 +1564,7 @@ static int wm8962_dsp2_ena_put(struct snd_kcontrol *kcontrol,
1564 struct snd_ctl_elem_value *ucontrol) 1564 struct snd_ctl_elem_value *ucontrol)
1565{ 1565{
1566 int shift = kcontrol->private_value; 1566 int shift = kcontrol->private_value;
1567 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1567 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1568 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 1568 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
1569 int old = wm8962->dsp2_ena; 1569 int old = wm8962->dsp2_ena;
1570 int ret = 0; 1570 int ret = 0;
@@ -1602,7 +1602,7 @@ out:
1602static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol, 1602static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol,
1603 struct snd_ctl_elem_value *ucontrol) 1603 struct snd_ctl_elem_value *ucontrol)
1604{ 1604{
1605 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1605 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1606 int ret; 1606 int ret;
1607 1607
1608 /* Apply the update (if any) */ 1608 /* Apply the update (if any) */
@@ -1632,7 +1632,7 @@ static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol,
1632static int wm8962_put_spk_sw(struct snd_kcontrol *kcontrol, 1632static int wm8962_put_spk_sw(struct snd_kcontrol *kcontrol,
1633 struct snd_ctl_elem_value *ucontrol) 1633 struct snd_ctl_elem_value *ucontrol)
1634{ 1634{
1635 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1635 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
1636 int ret; 1636 int ret;
1637 1637
1638 /* Apply the update (if any) */ 1638 /* Apply the update (if any) */
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c
index 2b9bfa53efbf..19d5baa38f5c 100644
--- a/sound/soc/codecs/wm8983.c
+++ b/sound/soc/codecs/wm8983.c
@@ -552,7 +552,7 @@ static const struct snd_soc_dapm_route wm8983_audio_map[] = {
552static int eqmode_get(struct snd_kcontrol *kcontrol, 552static int eqmode_get(struct snd_kcontrol *kcontrol,
553 struct snd_ctl_elem_value *ucontrol) 553 struct snd_ctl_elem_value *ucontrol)
554{ 554{
555 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 555 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
556 unsigned int reg; 556 unsigned int reg;
557 557
558 reg = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF); 558 reg = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF);
@@ -567,7 +567,7 @@ static int eqmode_get(struct snd_kcontrol *kcontrol,
567static int eqmode_put(struct snd_kcontrol *kcontrol, 567static int eqmode_put(struct snd_kcontrol *kcontrol,
568 struct snd_ctl_elem_value *ucontrol) 568 struct snd_ctl_elem_value *ucontrol)
569{ 569{
570 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 570 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
571 unsigned int regpwr2, regpwr3; 571 unsigned int regpwr2, regpwr3;
572 unsigned int reg_eq; 572 unsigned int reg_eq;
573 573
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c
index 5473dc969585..ad23ffb8346c 100644
--- a/sound/soc/codecs/wm8985.c
+++ b/sound/soc/codecs/wm8985.c
@@ -526,7 +526,7 @@ static const struct snd_soc_dapm_route wm8985_dapm_routes[] = {
526static int eqmode_get(struct snd_kcontrol *kcontrol, 526static int eqmode_get(struct snd_kcontrol *kcontrol,
527 struct snd_ctl_elem_value *ucontrol) 527 struct snd_ctl_elem_value *ucontrol)
528{ 528{
529 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 529 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
530 unsigned int reg; 530 unsigned int reg;
531 531
532 reg = snd_soc_read(codec, WM8985_EQ1_LOW_SHELF); 532 reg = snd_soc_read(codec, WM8985_EQ1_LOW_SHELF);
@@ -541,7 +541,7 @@ static int eqmode_get(struct snd_kcontrol *kcontrol,
541static int eqmode_put(struct snd_kcontrol *kcontrol, 541static int eqmode_put(struct snd_kcontrol *kcontrol,
542 struct snd_ctl_elem_value *ucontrol) 542 struct snd_ctl_elem_value *ucontrol)
543{ 543{
544 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 544 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
545 unsigned int regpwr2, regpwr3; 545 unsigned int regpwr2, regpwr3;
546 unsigned int reg_eq; 546 unsigned int reg_eq;
547 547
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index c413c1991453..b5c1f0f07058 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -132,7 +132,7 @@ static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
132static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol, 132static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
133 struct snd_ctl_elem_value *ucontrol) 133 struct snd_ctl_elem_value *ucontrol)
134{ 134{
135 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 135 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
136 struct soc_mixer_control *mc = 136 struct soc_mixer_control *mc =
137 (struct soc_mixer_control *)kcontrol->private_value; 137 (struct soc_mixer_control *)kcontrol->private_value;
138 int reg = mc->reg; 138 int reg = mc->reg;
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 844cc4a60d66..b8fd284fc0c0 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -154,7 +154,7 @@ static const unsigned int out_sidetone_tlv[] = {
154static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol, 154static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
155 struct snd_ctl_elem_value *ucontrol) 155 struct snd_ctl_elem_value *ucontrol)
156{ 156{
157 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 157 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
158 int reg = kcontrol->private_value & 0xff; 158 int reg = kcontrol->private_value & 0xff;
159 int ret; 159 int ret;
160 u16 val; 160 u16 val;
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 6303537f54c6..3eb390be7dee 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -298,7 +298,7 @@ static int wm8994_put_drc_sw(struct snd_kcontrol *kcontrol,
298{ 298{
299 struct soc_mixer_control *mc = 299 struct soc_mixer_control *mc =
300 (struct soc_mixer_control *)kcontrol->private_value; 300 (struct soc_mixer_control *)kcontrol->private_value;
301 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 301 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
302 int mask, ret; 302 int mask, ret;
303 303
304 /* Can't enable both ADC and DAC paths simultaneously */ 304 /* Can't enable both ADC and DAC paths simultaneously */
@@ -355,7 +355,7 @@ static int wm8994_get_drc(const char *name)
355static int wm8994_put_drc_enum(struct snd_kcontrol *kcontrol, 355static int wm8994_put_drc_enum(struct snd_kcontrol *kcontrol,
356 struct snd_ctl_elem_value *ucontrol) 356 struct snd_ctl_elem_value *ucontrol)
357{ 357{
358 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 358 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
359 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 359 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
360 struct wm8994 *control = wm8994->wm8994; 360 struct wm8994 *control = wm8994->wm8994;
361 struct wm8994_pdata *pdata = &control->pdata; 361 struct wm8994_pdata *pdata = &control->pdata;
@@ -378,7 +378,7 @@ static int wm8994_put_drc_enum(struct snd_kcontrol *kcontrol,
378static int wm8994_get_drc_enum(struct snd_kcontrol *kcontrol, 378static int wm8994_get_drc_enum(struct snd_kcontrol *kcontrol,
379 struct snd_ctl_elem_value *ucontrol) 379 struct snd_ctl_elem_value *ucontrol)
380{ 380{
381 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 381 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
382 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 382 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
383 int drc = wm8994_get_drc(kcontrol->id.name); 383 int drc = wm8994_get_drc(kcontrol->id.name);
384 384
@@ -462,7 +462,7 @@ static int wm8994_get_retune_mobile_block(const char *name)
462static int wm8994_put_retune_mobile_enum(struct snd_kcontrol *kcontrol, 462static int wm8994_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
463 struct snd_ctl_elem_value *ucontrol) 463 struct snd_ctl_elem_value *ucontrol)
464{ 464{
465 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 465 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
466 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 466 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
467 struct wm8994 *control = wm8994->wm8994; 467 struct wm8994 *control = wm8994->wm8994;
468 struct wm8994_pdata *pdata = &control->pdata; 468 struct wm8994_pdata *pdata = &control->pdata;
@@ -485,7 +485,7 @@ static int wm8994_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
485static int wm8994_get_retune_mobile_enum(struct snd_kcontrol *kcontrol, 485static int wm8994_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,
486 struct snd_ctl_elem_value *ucontrol) 486 struct snd_ctl_elem_value *ucontrol)
487{ 487{
488 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 488 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
489 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 489 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
490 int block = wm8994_get_retune_mobile_block(kcontrol->id.name); 490 int block = wm8994_get_retune_mobile_block(kcontrol->id.name);
491 491
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index c6cbb3b8ace9..69266332760e 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -412,7 +412,7 @@ static int wm8996_get_retune_mobile_block(const char *name)
412static int wm8996_put_retune_mobile_enum(struct snd_kcontrol *kcontrol, 412static int wm8996_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
413 struct snd_ctl_elem_value *ucontrol) 413 struct snd_ctl_elem_value *ucontrol)
414{ 414{
415 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 415 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
416 struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); 416 struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
417 struct wm8996_pdata *pdata = &wm8996->pdata; 417 struct wm8996_pdata *pdata = &wm8996->pdata;
418 int block = wm8996_get_retune_mobile_block(kcontrol->id.name); 418 int block = wm8996_get_retune_mobile_block(kcontrol->id.name);
@@ -434,7 +434,7 @@ static int wm8996_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
434static int wm8996_get_retune_mobile_enum(struct snd_kcontrol *kcontrol, 434static int wm8996_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,
435 struct snd_ctl_elem_value *ucontrol) 435 struct snd_ctl_elem_value *ucontrol)
436{ 436{
437 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 437 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
438 struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); 438 struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
439 int block = wm8996_get_retune_mobile_block(kcontrol->id.name); 439 int block = wm8996_get_retune_mobile_block(kcontrol->id.name);
440 440
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index d18eff31fbbc..185eb97769e7 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -340,7 +340,7 @@ static SOC_ENUM_SINGLE_DECL(speaker_mode, WM9081_ANALOGUE_SPEAKER_2, 6,
340static int speaker_mode_get(struct snd_kcontrol *kcontrol, 340static int speaker_mode_get(struct snd_kcontrol *kcontrol,
341 struct snd_ctl_elem_value *ucontrol) 341 struct snd_ctl_elem_value *ucontrol)
342{ 342{
343 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 343 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
344 unsigned int reg; 344 unsigned int reg;
345 345
346 reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); 346 reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);
@@ -361,7 +361,7 @@ static int speaker_mode_get(struct snd_kcontrol *kcontrol,
361static int speaker_mode_put(struct snd_kcontrol *kcontrol, 361static int speaker_mode_put(struct snd_kcontrol *kcontrol,
362 struct snd_ctl_elem_value *ucontrol) 362 struct snd_ctl_elem_value *ucontrol)
363{ 363{
364 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 364 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
365 unsigned int reg_pwr = snd_soc_read(codec, WM9081_POWER_MANAGEMENT); 365 unsigned int reg_pwr = snd_soc_read(codec, WM9081_POWER_MANAGEMENT);
366 unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); 366 unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);
367 367
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index bb5f7b4e3ebb..d9686dcd024c 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -242,7 +242,7 @@ struct wm_coeff_ctl {
242static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol, 242static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
243 struct snd_ctl_elem_value *ucontrol) 243 struct snd_ctl_elem_value *ucontrol)
244{ 244{
245 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 245 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
246 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 246 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
247 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec); 247 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec);
248 248
@@ -254,7 +254,7 @@ static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
254static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol, 254static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
255 struct snd_ctl_elem_value *ucontrol) 255 struct snd_ctl_elem_value *ucontrol)
256{ 256{
257 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 257 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
258 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 258 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
259 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec); 259 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec);
260 260
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
index b6209662ab13..916817fe6632 100644
--- a/sound/soc/codecs/wm_hubs.c
+++ b/sound/soc/codecs/wm_hubs.c
@@ -337,7 +337,7 @@ static void enable_dc_servo(struct snd_soc_codec *codec)
337static int wm8993_put_dc_servo(struct snd_kcontrol *kcontrol, 337static int wm8993_put_dc_servo(struct snd_kcontrol *kcontrol,
338 struct snd_ctl_elem_value *ucontrol) 338 struct snd_ctl_elem_value *ucontrol)
339{ 339{
340 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 340 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
341 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); 341 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
342 int ret; 342 int ret;
343 343
diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
index 0a32dd13a23d..67a5eb3c6196 100644
--- a/sound/soc/intel/sst-haswell-pcm.c
+++ b/sound/soc/intel/sst-haswell-pcm.c
@@ -136,7 +136,7 @@ static inline unsigned int hsw_ipc_to_mixer(u32 value)
136static int hsw_stream_volume_put(struct snd_kcontrol *kcontrol, 136static int hsw_stream_volume_put(struct snd_kcontrol *kcontrol,
137 struct snd_ctl_elem_value *ucontrol) 137 struct snd_ctl_elem_value *ucontrol)
138{ 138{
139 struct snd_soc_platform *platform = snd_kcontrol_chip(kcontrol); 139 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
140 struct soc_mixer_control *mc = 140 struct soc_mixer_control *mc =
141 (struct soc_mixer_control *)kcontrol->private_value; 141 (struct soc_mixer_control *)kcontrol->private_value;
142 struct hsw_priv_data *pdata = 142 struct hsw_priv_data *pdata =
@@ -174,7 +174,7 @@ static int hsw_stream_volume_put(struct snd_kcontrol *kcontrol,
174static int hsw_stream_volume_get(struct snd_kcontrol *kcontrol, 174static int hsw_stream_volume_get(struct snd_kcontrol *kcontrol,
175 struct snd_ctl_elem_value *ucontrol) 175 struct snd_ctl_elem_value *ucontrol)
176{ 176{
177 struct snd_soc_platform *platform = snd_kcontrol_chip(kcontrol); 177 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
178 struct soc_mixer_control *mc = 178 struct soc_mixer_control *mc =
179 (struct soc_mixer_control *)kcontrol->private_value; 179 (struct soc_mixer_control *)kcontrol->private_value;
180 struct hsw_priv_data *pdata = 180 struct hsw_priv_data *pdata =
@@ -206,7 +206,7 @@ static int hsw_stream_volume_get(struct snd_kcontrol *kcontrol,
206static int hsw_volume_put(struct snd_kcontrol *kcontrol, 206static int hsw_volume_put(struct snd_kcontrol *kcontrol,
207 struct snd_ctl_elem_value *ucontrol) 207 struct snd_ctl_elem_value *ucontrol)
208{ 208{
209 struct snd_soc_platform *platform = snd_kcontrol_chip(kcontrol); 209 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
210 struct hsw_priv_data *pdata = snd_soc_platform_get_drvdata(platform); 210 struct hsw_priv_data *pdata = snd_soc_platform_get_drvdata(platform);
211 struct sst_hsw *hsw = pdata->hsw; 211 struct sst_hsw *hsw = pdata->hsw;
212 u32 volume; 212 u32 volume;
@@ -231,7 +231,7 @@ static int hsw_volume_put(struct snd_kcontrol *kcontrol,
231static int hsw_volume_get(struct snd_kcontrol *kcontrol, 231static int hsw_volume_get(struct snd_kcontrol *kcontrol,
232 struct snd_ctl_elem_value *ucontrol) 232 struct snd_ctl_elem_value *ucontrol)
233{ 233{
234 struct snd_soc_platform *platform = snd_kcontrol_chip(kcontrol); 234 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
235 struct hsw_priv_data *pdata = snd_soc_platform_get_drvdata(platform); 235 struct hsw_priv_data *pdata = snd_soc_platform_get_drvdata(platform);
236 struct sst_hsw *hsw = pdata->hsw; 236 struct sst_hsw *hsw = pdata->hsw;
237 unsigned int volume = 0; 237 unsigned int volume = 0;
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index bfed3e4c45ff..3fa77d5f9b75 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -162,8 +162,6 @@ static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec)
162 i, codec_drv->reg_word_size) == val) 162 i, codec_drv->reg_word_size) == val)
163 continue; 163 continue;
164 164
165 WARN_ON(!snd_soc_codec_writable_register(codec, i));
166
167 ret = snd_soc_write(codec, i, val); 165 ret = snd_soc_write(codec, i, val);
168 if (ret) 166 if (ret)
169 return ret; 167 return ret;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7f0a9297e420..78f0c51c6c83 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -154,22 +154,15 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf,
154 step = codec->driver->reg_cache_step; 154 step = codec->driver->reg_cache_step;
155 155
156 for (i = 0; i < codec->driver->reg_cache_size; i += step) { 156 for (i = 0; i < codec->driver->reg_cache_size; i += step) {
157 if (!snd_soc_codec_readable_register(codec, i)) 157 /* only support larger than PAGE_SIZE bytes debugfs
158 continue; 158 * entries for the default case */
159 if (codec->driver->display_register) { 159 if (p >= pos) {
160 count += codec->driver->display_register(codec, buf + count, 160 if (total + len >= count - 1)
161 PAGE_SIZE - count, i); 161 break;
162 } else { 162 format_register_str(codec, i, buf + total, len);
163 /* only support larger than PAGE_SIZE bytes debugfs 163 total += len;
164 * entries for the default case */
165 if (p >= pos) {
166 if (total + len >= count - 1)
167 break;
168 format_register_str(codec, i, buf + total, len);
169 total += len;
170 }
171 p += len;
172 } 164 }
165 p += len;
173 } 166 }
174 167
175 total = min(total, count - 1); 168 total = min(total, count - 1);
@@ -1995,92 +1988,6 @@ static struct platform_driver soc_driver = {
1995}; 1988};
1996 1989
1997/** 1990/**
1998 * snd_soc_codec_volatile_register: Report if a register is volatile.
1999 *
2000 * @codec: CODEC to query.
2001 * @reg: Register to query.
2002 *
2003 * Boolean function indiciating if a CODEC register is volatile.
2004 */
2005int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
2006 unsigned int reg)
2007{
2008 if (codec->volatile_register)
2009 return codec->volatile_register(codec, reg);
2010 else
2011 return 0;
2012}
2013EXPORT_SYMBOL_GPL(snd_soc_codec_volatile_register);
2014
2015/**
2016 * snd_soc_codec_readable_register: Report if a register is readable.
2017 *
2018 * @codec: CODEC to query.
2019 * @reg: Register to query.
2020 *
2021 * Boolean function indicating if a CODEC register is readable.
2022 */
2023int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
2024 unsigned int reg)
2025{
2026 if (codec->readable_register)
2027 return codec->readable_register(codec, reg);
2028 else
2029 return 1;
2030}
2031EXPORT_SYMBOL_GPL(snd_soc_codec_readable_register);
2032
2033/**
2034 * snd_soc_codec_writable_register: Report if a register is writable.
2035 *
2036 * @codec: CODEC to query.
2037 * @reg: Register to query.
2038 *
2039 * Boolean function indicating if a CODEC register is writable.
2040 */
2041int snd_soc_codec_writable_register(struct snd_soc_codec *codec,
2042 unsigned int reg)
2043{
2044 if (codec->writable_register)
2045 return codec->writable_register(codec, reg);
2046 else
2047 return 1;
2048}
2049EXPORT_SYMBOL_GPL(snd_soc_codec_writable_register);
2050
2051int snd_soc_platform_read(struct snd_soc_platform *platform,
2052 unsigned int reg)
2053{
2054 unsigned int ret;
2055
2056 if (!platform->driver->read) {
2057 dev_err(platform->dev, "ASoC: platform has no read back\n");
2058 return -1;
2059 }
2060
2061 ret = platform->driver->read(platform, reg);
2062 dev_dbg(platform->dev, "read %x => %x\n", reg, ret);
2063 trace_snd_soc_preg_read(platform, reg, ret);
2064
2065 return ret;
2066}
2067EXPORT_SYMBOL_GPL(snd_soc_platform_read);
2068
2069int snd_soc_platform_write(struct snd_soc_platform *platform,
2070 unsigned int reg, unsigned int val)
2071{
2072 if (!platform->driver->write) {
2073 dev_err(platform->dev, "ASoC: platform has no write back\n");
2074 return -1;
2075 }
2076
2077 dev_dbg(platform->dev, "write %x = %x\n", reg, val);
2078 trace_snd_soc_preg_write(platform, reg, val);
2079 return platform->driver->write(platform, reg, val);
2080}
2081EXPORT_SYMBOL_GPL(snd_soc_platform_write);
2082
2083/**
2084 * snd_soc_new_ac97_codec - initailise AC97 device 1991 * snd_soc_new_ac97_codec - initailise AC97 device
2085 * @codec: audio codec 1992 * @codec: audio codec
2086 * @ops: AC97 bus operations 1993 * @ops: AC97 bus operations
@@ -2298,118 +2205,6 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec)
2298} 2205}
2299EXPORT_SYMBOL_GPL(snd_soc_free_ac97_codec); 2206EXPORT_SYMBOL_GPL(snd_soc_free_ac97_codec);
2300 2207
2301unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg)
2302{
2303 unsigned int ret;
2304
2305 ret = codec->read(codec, reg);
2306 dev_dbg(codec->dev, "read %x => %x\n", reg, ret);
2307 trace_snd_soc_reg_read(codec, reg, ret);
2308
2309 return ret;
2310}
2311EXPORT_SYMBOL_GPL(snd_soc_read);
2312
2313unsigned int snd_soc_write(struct snd_soc_codec *codec,
2314 unsigned int reg, unsigned int val)
2315{
2316 dev_dbg(codec->dev, "write %x = %x\n", reg, val);
2317 trace_snd_soc_reg_write(codec, reg, val);
2318 return codec->write(codec, reg, val);
2319}
2320EXPORT_SYMBOL_GPL(snd_soc_write);
2321
2322/**
2323 * snd_soc_update_bits - update codec register bits
2324 * @codec: audio codec
2325 * @reg: codec register
2326 * @mask: register mask
2327 * @value: new value
2328 *
2329 * Writes new register value.
2330 *
2331 * Returns 1 for change, 0 for no change, or negative error code.
2332 */
2333int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
2334 unsigned int mask, unsigned int value)
2335{
2336 bool change;
2337 unsigned int old, new;
2338 int ret;
2339
2340 if (codec->using_regmap) {
2341 ret = regmap_update_bits_check(codec->control_data, reg,
2342 mask, value, &change);
2343 } else {
2344 ret = snd_soc_read(codec, reg);
2345 if (ret < 0)
2346 return ret;
2347
2348 old = ret;
2349 new = (old & ~mask) | (value & mask);
2350 change = old != new;
2351 if (change)
2352 ret = snd_soc_write(codec, reg, new);
2353 }
2354
2355 if (ret < 0)
2356 return ret;
2357
2358 return change;
2359}
2360EXPORT_SYMBOL_GPL(snd_soc_update_bits);
2361
2362/**
2363 * snd_soc_update_bits_locked - update codec register bits
2364 * @codec: audio codec
2365 * @reg: codec register
2366 * @mask: register mask
2367 * @value: new value
2368 *
2369 * Writes new register value, and takes the codec mutex.
2370 *
2371 * Returns 1 for change else 0.
2372 */
2373int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
2374 unsigned int reg, unsigned int mask,
2375 unsigned int value)
2376{
2377 int change;
2378
2379 mutex_lock(&codec->mutex);
2380 change = snd_soc_update_bits(codec, reg, mask, value);
2381 mutex_unlock(&codec->mutex);
2382
2383 return change;
2384}
2385EXPORT_SYMBOL_GPL(snd_soc_update_bits_locked);
2386
2387/**
2388 * snd_soc_test_bits - test register for change
2389 * @codec: audio codec
2390 * @reg: codec register
2391 * @mask: register mask
2392 * @value: new value
2393 *
2394 * Tests a register with a new value and checks if the new value is
2395 * different from the old value.
2396 *
2397 * Returns 1 for change else 0.
2398 */
2399int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
2400 unsigned int mask, unsigned int value)
2401{
2402 int change;
2403 unsigned int old, new;
2404
2405 old = snd_soc_read(codec, reg);
2406 new = (old & ~mask) | value;
2407 change = old != new;
2408
2409 return change;
2410}
2411EXPORT_SYMBOL_GPL(snd_soc_test_bits);
2412
2413/** 2208/**
2414 * snd_soc_cnew - create new control 2209 * snd_soc_cnew - create new control
2415 * @_template: control template 2210 * @_template: control template
@@ -3358,7 +3153,7 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
3358 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 3153 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
3359 unsigned int regbase = mc->regbase; 3154 unsigned int regbase = mc->regbase;
3360 unsigned int regcount = mc->regcount; 3155 unsigned int regcount = mc->regcount;
3361 unsigned int regwshift = codec->driver->reg_word_size * BITS_PER_BYTE; 3156 unsigned int regwshift = codec->val_bytes * BITS_PER_BYTE;
3362 unsigned int regwmask = (1<<regwshift)-1; 3157 unsigned int regwmask = (1<<regwshift)-1;
3363 unsigned int invert = mc->invert; 3158 unsigned int invert = mc->invert;
3364 unsigned long mask = (1UL<<mc->nbits)-1; 3159 unsigned long mask = (1UL<<mc->nbits)-1;
@@ -3404,7 +3199,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
3404 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 3199 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
3405 unsigned int regbase = mc->regbase; 3200 unsigned int regbase = mc->regbase;
3406 unsigned int regcount = mc->regcount; 3201 unsigned int regcount = mc->regcount;
3407 unsigned int regwshift = codec->driver->reg_word_size * BITS_PER_BYTE; 3202 unsigned int regwshift = codec->val_bytes * BITS_PER_BYTE;
3408 unsigned int regwmask = (1<<regwshift)-1; 3203 unsigned int regwmask = (1<<regwshift)-1;
3409 unsigned int invert = mc->invert; 3204 unsigned int invert = mc->invert;
3410 unsigned long mask = (1UL<<mc->nbits)-1; 3205 unsigned long mask = (1UL<<mc->nbits)-1;
@@ -4099,6 +3894,7 @@ int snd_soc_register_component(struct device *dev,
4099 } 3894 }
4100 3895
4101 cmpnt->ignore_pmdown_time = true; 3896 cmpnt->ignore_pmdown_time = true;
3897 cmpnt->registered_as_component = true;
4102 3898
4103 return __snd_soc_register_component(dev, cmpnt, cmpnt_drv, NULL, 3899 return __snd_soc_register_component(dev, cmpnt, cmpnt_drv, NULL,
4104 dai_drv, num_dai, true); 3900 dai_drv, num_dai, true);
@@ -4114,7 +3910,7 @@ void snd_soc_unregister_component(struct device *dev)
4114 struct snd_soc_component *cmpnt; 3910 struct snd_soc_component *cmpnt;
4115 3911
4116 list_for_each_entry(cmpnt, &component_list, list) { 3912 list_for_each_entry(cmpnt, &component_list, list) {
4117 if (dev == cmpnt->dev) 3913 if (dev == cmpnt->dev && cmpnt->registered_as_component)
4118 goto found; 3914 goto found;
4119 } 3915 }
4120 return; 3916 return;
@@ -4140,6 +3936,8 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_component);
4140int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform, 3936int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform,
4141 const struct snd_soc_platform_driver *platform_drv) 3937 const struct snd_soc_platform_driver *platform_drv)
4142{ 3938{
3939 int ret;
3940
4143 /* create platform component name */ 3941 /* create platform component name */
4144 platform->name = fmt_single_name(dev, &platform->id); 3942 platform->name = fmt_single_name(dev, &platform->id);
4145 if (platform->name == NULL) 3943 if (platform->name == NULL)
@@ -4152,6 +3950,16 @@ int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform,
4152 platform->dapm.stream_event = platform_drv->stream_event; 3950 platform->dapm.stream_event = platform_drv->stream_event;
4153 mutex_init(&platform->mutex); 3951 mutex_init(&platform->mutex);
4154 3952
3953 /* register component */
3954 ret = __snd_soc_register_component(dev, &platform->component,
3955 &platform_drv->component_driver,
3956 NULL, NULL, 0, false);
3957 if (ret < 0) {
3958 dev_err(platform->component.dev,
3959 "ASoC: Failed to register component: %d\n", ret);
3960 return ret;
3961 }
3962
4155 mutex_lock(&client_mutex); 3963 mutex_lock(&client_mutex);
4156 list_add(&platform->list, &platform_list); 3964 list_add(&platform->list, &platform_list);
4157 mutex_unlock(&client_mutex); 3965 mutex_unlock(&client_mutex);
@@ -4193,6 +4001,8 @@ EXPORT_SYMBOL_GPL(snd_soc_register_platform);
4193 */ 4001 */
4194void snd_soc_remove_platform(struct snd_soc_platform *platform) 4002void snd_soc_remove_platform(struct snd_soc_platform *platform)
4195{ 4003{
4004 snd_soc_unregister_component(platform->dev);
4005
4196 mutex_lock(&client_mutex); 4006 mutex_lock(&client_mutex);
4197 list_del(&platform->list); 4007 list_del(&platform->list);
4198 mutex_unlock(&client_mutex); 4008 mutex_unlock(&client_mutex);
@@ -4295,9 +4105,6 @@ int snd_soc_register_codec(struct device *dev,
4295 4105
4296 codec->write = codec_drv->write; 4106 codec->write = codec_drv->write;
4297 codec->read = codec_drv->read; 4107 codec->read = codec_drv->read;
4298 codec->volatile_register = codec_drv->volatile_register;
4299 codec->readable_register = codec_drv->readable_register;
4300 codec->writable_register = codec_drv->writable_register;
4301 codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time; 4108 codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time;
4302 codec->dapm.bias_level = SND_SOC_BIAS_OFF; 4109 codec->dapm.bias_level = SND_SOC_BIAS_OFF;
4303 codec->dapm.dev = dev; 4110 codec->dapm.dev = dev;
@@ -4307,6 +4114,7 @@ int snd_soc_register_codec(struct device *dev,
4307 codec->dev = dev; 4114 codec->dev = dev;
4308 codec->driver = codec_drv; 4115 codec->driver = codec_drv;
4309 codec->num_dai = num_dai; 4116 codec->num_dai = num_dai;
4117 codec->val_bytes = codec_drv->reg_word_size;
4310 mutex_init(&codec->mutex); 4118 mutex_init(&codec->mutex);
4311 4119
4312 for (i = 0; i < num_dai; i++) { 4120 for (i = 0; i < num_dai; i++) {
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 260efc8466fc..31ddd52c72fc 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -19,6 +19,150 @@
19 19
20#include <trace/events/asoc.h> 20#include <trace/events/asoc.h>
21 21
22unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg)
23{
24 unsigned int ret;
25
26 ret = codec->read(codec, reg);
27 dev_dbg(codec->dev, "read %x => %x\n", reg, ret);
28 trace_snd_soc_reg_read(codec, reg, ret);
29
30 return ret;
31}
32EXPORT_SYMBOL_GPL(snd_soc_read);
33
34unsigned int snd_soc_write(struct snd_soc_codec *codec,
35 unsigned int reg, unsigned int val)
36{
37 dev_dbg(codec->dev, "write %x = %x\n", reg, val);
38 trace_snd_soc_reg_write(codec, reg, val);
39 return codec->write(codec, reg, val);
40}
41EXPORT_SYMBOL_GPL(snd_soc_write);
42
43/**
44 * snd_soc_update_bits - update codec register bits
45 * @codec: audio codec
46 * @reg: codec register
47 * @mask: register mask
48 * @value: new value
49 *
50 * Writes new register value.
51 *
52 * Returns 1 for change, 0 for no change, or negative error code.
53 */
54int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
55 unsigned int mask, unsigned int value)
56{
57 bool change;
58 unsigned int old, new;
59 int ret;
60
61 if (codec->using_regmap) {
62 ret = regmap_update_bits_check(codec->control_data, reg,
63 mask, value, &change);
64 } else {
65 ret = snd_soc_read(codec, reg);
66 if (ret < 0)
67 return ret;
68
69 old = ret;
70 new = (old & ~mask) | (value & mask);
71 change = old != new;
72 if (change)
73 ret = snd_soc_write(codec, reg, new);
74 }
75
76 if (ret < 0)
77 return ret;
78
79 return change;
80}
81EXPORT_SYMBOL_GPL(snd_soc_update_bits);
82
83/**
84 * snd_soc_update_bits_locked - update codec register bits
85 * @codec: audio codec
86 * @reg: codec register
87 * @mask: register mask
88 * @value: new value
89 *
90 * Writes new register value, and takes the codec mutex.
91 *
92 * Returns 1 for change else 0.
93 */
94int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
95 unsigned int reg, unsigned int mask,
96 unsigned int value)
97{
98 int change;
99
100 mutex_lock(&codec->mutex);
101 change = snd_soc_update_bits(codec, reg, mask, value);
102 mutex_unlock(&codec->mutex);
103
104 return change;
105}
106EXPORT_SYMBOL_GPL(snd_soc_update_bits_locked);
107
108/**
109 * snd_soc_test_bits - test register for change
110 * @codec: audio codec
111 * @reg: codec register
112 * @mask: register mask
113 * @value: new value
114 *
115 * Tests a register with a new value and checks if the new value is
116 * different from the old value.
117 *
118 * Returns 1 for change else 0.
119 */
120int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
121 unsigned int mask, unsigned int value)
122{
123 int change;
124 unsigned int old, new;
125
126 old = snd_soc_read(codec, reg);
127 new = (old & ~mask) | value;
128 change = old != new;
129
130 return change;
131}
132EXPORT_SYMBOL_GPL(snd_soc_test_bits);
133
134int snd_soc_platform_read(struct snd_soc_platform *platform,
135 unsigned int reg)
136{
137 unsigned int ret;
138
139 if (!platform->driver->read) {
140 dev_err(platform->dev, "ASoC: platform has no read back\n");
141 return -1;
142 }
143
144 ret = platform->driver->read(platform, reg);
145 dev_dbg(platform->dev, "read %x => %x\n", reg, ret);
146 trace_snd_soc_preg_read(platform, reg, ret);
147
148 return ret;
149}
150EXPORT_SYMBOL_GPL(snd_soc_platform_read);
151
152int snd_soc_platform_write(struct snd_soc_platform *platform,
153 unsigned int reg, unsigned int val)
154{
155 if (!platform->driver->write) {
156 dev_err(platform->dev, "ASoC: platform has no write back\n");
157 return -1;
158 }
159
160 dev_dbg(platform->dev, "write %x = %x\n", reg, val);
161 trace_snd_soc_preg_write(platform, reg, val);
162 return platform->driver->write(platform, reg, val);
163}
164EXPORT_SYMBOL_GPL(snd_soc_platform_write);
165
22#ifdef CONFIG_REGMAP 166#ifdef CONFIG_REGMAP
23static int hw_write(struct snd_soc_codec *codec, unsigned int reg, 167static int hw_write(struct snd_soc_codec *codec, unsigned int reg,
24 unsigned int value) 168 unsigned int value)