aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc.h6
-rw-r--r--sound/soc/codecs/ad1836.c6
-rw-r--r--sound/soc/codecs/ad1980.c2
-rw-r--r--sound/soc/codecs/adau1373.c4
-rw-r--r--sound/soc/codecs/ak4535.c2
-rw-r--r--sound/soc/codecs/ak4642.c2
-rw-r--r--sound/soc/codecs/ak4671.c2
-rw-r--r--sound/soc/codecs/alc5623.c8
-rw-r--r--sound/soc/codecs/alc5632.c2
-rw-r--r--sound/soc/codecs/cq93vc.c2
-rw-r--r--sound/soc/codecs/cs4270.c2
-rw-r--r--sound/soc/codecs/cs4271.c2
-rw-r--r--sound/soc/codecs/lm4857.c2
-rw-r--r--sound/soc/codecs/max98088.c4
-rw-r--r--sound/soc/codecs/max98095.c6
-rw-r--r--sound/soc/codecs/max9877.c2
-rw-r--r--sound/soc/codecs/sn95031.c2
-rw-r--r--sound/soc/codecs/ssm2602.c2
-rw-r--r--sound/soc/codecs/stac9766.c2
-rw-r--r--sound/soc/codecs/tlv320aic23.c2
-rw-r--r--sound/soc/codecs/tlv320aic26.c2
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c2
-rw-r--r--sound/soc/codecs/tlv320aic3x.c4
-rw-r--r--sound/soc/codecs/tlv320dac33.c2
-rw-r--r--sound/soc/codecs/tpa6130a2.c4
-rw-r--r--sound/soc/codecs/uda134x.c6
-rw-r--r--sound/soc/codecs/wl1273.c2
-rw-r--r--sound/soc/codecs/wm8737.c2
-rw-r--r--sound/soc/codecs/wm8770.c2
-rw-r--r--sound/soc/codecs/wm8904.c16
-rw-r--r--sound/soc/codecs/wm8940.c2
-rw-r--r--sound/soc/codecs/wm8958-dsp2.c14
-rw-r--r--sound/soc/codecs/wm8960.c2
-rw-r--r--sound/soc/codecs/wm8961.c2
-rw-r--r--sound/soc/codecs/wm8962.c6
-rw-r--r--sound/soc/codecs/wm8990.c2
-rw-r--r--sound/soc/codecs/wm8991.c2
-rw-r--r--sound/soc/codecs/wm8993.c4
-rw-r--r--sound/soc/codecs/wm8994.c12
-rw-r--r--sound/soc/codecs/wm8995.c2
-rw-r--r--sound/soc/codecs/wm8996.c4
-rw-r--r--sound/soc/codecs/wm9081.c2
-rw-r--r--sound/soc/codecs/wm9090.c6
-rw-r--r--sound/soc/codecs/wm9705.c2
-rw-r--r--sound/soc/codecs/wm9712.c2
-rw-r--r--sound/soc/codecs/wm9713.c2
-rw-r--r--sound/soc/codecs/wm_hubs.c2
-rw-r--r--sound/soc/mid-x86/mfld_machine.c2
-rw-r--r--sound/soc/omap/ams-delta.c2
-rw-r--r--sound/soc/omap/n810.c15
-rw-r--r--sound/soc/omap/omap-mcbsp.c8
-rw-r--r--sound/soc/omap/omap-mcbsp.h2
-rw-r--r--sound/soc/omap/rx51.c25
-rw-r--r--sound/soc/pxa/corgi.c14
-rw-r--r--sound/soc/pxa/magician.c2
-rw-r--r--sound/soc/pxa/poodle.c14
-rw-r--r--sound/soc/pxa/tosa.c2
-rw-r--r--sound/soc/samsung/neo1973_wm8753.c4
-rw-r--r--sound/soc/samsung/s3c24xx_simtec.c6
-rw-r--r--sound/soc/soc-core.c108
60 files changed, 203 insertions, 173 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2f687edd4fde..9348bed86b1e 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -368,10 +368,14 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
368struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 368struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
369 void *data, char *long_name, 369 void *data, char *long_name,
370 const char *prefix); 370 const char *prefix);
371int snd_soc_add_controls(struct snd_soc_codec *codec, 371int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
372 const struct snd_kcontrol_new *controls, int num_controls); 372 const struct snd_kcontrol_new *controls, int num_controls);
373int snd_soc_add_platform_controls(struct snd_soc_platform *platform, 373int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
374 const struct snd_kcontrol_new *controls, int num_controls); 374 const struct snd_kcontrol_new *controls, int num_controls);
375int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
376 const struct snd_kcontrol_new *controls, int num_controls);
377int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
378 const struct snd_kcontrol_new *controls, int num_controls);
375int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 379int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
376 struct snd_ctl_elem_info *uinfo); 380 struct snd_ctl_elem_info *uinfo);
377int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, 381int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c
index 982d201c2e86..12e3b4118557 100644
--- a/sound/soc/codecs/ad1836.c
+++ b/sound/soc/codecs/ad1836.c
@@ -277,7 +277,7 @@ static int ad1836_probe(struct snd_soc_codec *codec)
277 if (ad1836->type == AD1836) { 277 if (ad1836->type == AD1836) {
278 /* left/right diff:PGA/MUX */ 278 /* left/right diff:PGA/MUX */
279 snd_soc_write(codec, AD1836_ADC_CTRL3, 0x3A); 279 snd_soc_write(codec, AD1836_ADC_CTRL3, 0x3A);
280 ret = snd_soc_add_controls(codec, ad1836_controls, 280 ret = snd_soc_add_codec_controls(codec, ad1836_controls,
281 ARRAY_SIZE(ad1836_controls)); 281 ARRAY_SIZE(ad1836_controls));
282 if (ret) 282 if (ret)
283 return ret; 283 return ret;
@@ -285,11 +285,11 @@ static int ad1836_probe(struct snd_soc_codec *codec)
285 snd_soc_write(codec, AD1836_ADC_CTRL3, 0x00); 285 snd_soc_write(codec, AD1836_ADC_CTRL3, 0x00);
286 } 286 }
287 287
288 ret = snd_soc_add_controls(codec, ad183x_dac_controls, num_dacs * 2); 288 ret = snd_soc_add_codec_controls(codec, ad183x_dac_controls, num_dacs * 2);
289 if (ret) 289 if (ret)
290 return ret; 290 return ret;
291 291
292 ret = snd_soc_add_controls(codec, ad183x_adc_controls, num_adcs); 292 ret = snd_soc_add_codec_controls(codec, ad183x_adc_controls, num_adcs);
293 if (ret) 293 if (ret)
294 return ret; 294 return ret;
295 295
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 9bba7f849464..8c39dddd7d00 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -228,7 +228,7 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
228 ext_status = ac97_read(codec, AC97_EXTENDED_STATUS); 228 ext_status = ac97_read(codec, AC97_EXTENDED_STATUS);
229 ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800); 229 ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);
230 230
231 snd_soc_add_controls(codec, ad1980_snd_ac97_controls, 231 snd_soc_add_codec_controls(codec, ad1980_snd_ac97_controls,
232 ARRAY_SIZE(ad1980_snd_ac97_controls)); 232 ARRAY_SIZE(ad1980_snd_ac97_controls));
233 233
234 return 0; 234 return 0;
diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c
index facda33db1c0..44f59064d8de 100644
--- a/sound/soc/codecs/adau1373.c
+++ b/sound/soc/codecs/adau1373.c
@@ -1257,7 +1257,7 @@ static int adau1373_probe(struct snd_soc_codec *codec)
1257 pdata->drc_setting[i]); 1257 pdata->drc_setting[i]);
1258 } 1258 }
1259 1259
1260 snd_soc_add_controls(codec, adau1373_drc_controls, 1260 snd_soc_add_codec_controls(codec, adau1373_drc_controls,
1261 pdata->num_drc); 1261 pdata->num_drc);
1262 1262
1263 val = 0; 1263 val = 0;
@@ -1282,7 +1282,7 @@ static int adau1373_probe(struct snd_soc_codec *codec)
1282 } 1282 }
1283 1283
1284 if (!lineout_differential) { 1284 if (!lineout_differential) {
1285 snd_soc_add_controls(codec, adau1373_lineout2_controls, 1285 snd_soc_add_codec_controls(codec, adau1373_lineout2_controls,
1286 ARRAY_SIZE(adau1373_lineout2_controls)); 1286 ARRAY_SIZE(adau1373_lineout2_controls));
1287 } 1287 }
1288 1288
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 9e809e05d066..dd15516763ed 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -382,7 +382,7 @@ static int ak4535_probe(struct snd_soc_codec *codec)
382 /* power on device */ 382 /* power on device */
383 ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 383 ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
384 384
385 snd_soc_add_controls(codec, ak4535_snd_controls, 385 snd_soc_add_codec_controls(codec, ak4535_snd_controls,
386 ARRAY_SIZE(ak4535_snd_controls)); 386 ARRAY_SIZE(ak4535_snd_controls));
387 return 0; 387 return 0;
388} 388}
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index 5ef70b5d27e4..16bd1e7d2384 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -476,7 +476,7 @@ static int ak4642_probe(struct snd_soc_codec *codec)
476 return ret; 476 return ret;
477 } 477 }
478 478
479 snd_soc_add_controls(codec, ak4642_snd_controls, 479 snd_soc_add_codec_controls(codec, ak4642_snd_controls,
480 ARRAY_SIZE(ak4642_snd_controls)); 480 ARRAY_SIZE(ak4642_snd_controls));
481 481
482 ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 482 ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c
index a53b152e6a07..5fb7c2a80e6d 100644
--- a/sound/soc/codecs/ak4671.c
+++ b/sound/soc/codecs/ak4671.c
@@ -628,7 +628,7 @@ static int ak4671_probe(struct snd_soc_codec *codec)
628 return ret; 628 return ret;
629 } 629 }
630 630
631 snd_soc_add_controls(codec, ak4671_snd_controls, 631 snd_soc_add_codec_controls(codec, ak4671_snd_controls,
632 ARRAY_SIZE(ak4671_snd_controls)); 632 ARRAY_SIZE(ak4671_snd_controls));
633 633
634 ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 634 ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c
index 08f24198c8da..d47b62ddb210 100644
--- a/sound/soc/codecs/alc5623.c
+++ b/sound/soc/codecs/alc5623.c
@@ -925,22 +925,22 @@ static int alc5623_probe(struct snd_soc_codec *codec)
925 925
926 switch (alc5623->id) { 926 switch (alc5623->id) {
927 case 0x21: 927 case 0x21:
928 snd_soc_add_controls(codec, alc5621_vol_snd_controls, 928 snd_soc_add_codec_controls(codec, alc5621_vol_snd_controls,
929 ARRAY_SIZE(alc5621_vol_snd_controls)); 929 ARRAY_SIZE(alc5621_vol_snd_controls));
930 break; 930 break;
931 case 0x22: 931 case 0x22:
932 snd_soc_add_controls(codec, alc5622_vol_snd_controls, 932 snd_soc_add_codec_controls(codec, alc5622_vol_snd_controls,
933 ARRAY_SIZE(alc5622_vol_snd_controls)); 933 ARRAY_SIZE(alc5622_vol_snd_controls));
934 break; 934 break;
935 case 0x23: 935 case 0x23:
936 snd_soc_add_controls(codec, alc5623_vol_snd_controls, 936 snd_soc_add_codec_controls(codec, alc5623_vol_snd_controls,
937 ARRAY_SIZE(alc5623_vol_snd_controls)); 937 ARRAY_SIZE(alc5623_vol_snd_controls));
938 break; 938 break;
939 default: 939 default:
940 return -EINVAL; 940 return -EINVAL;
941 } 941 }
942 942
943 snd_soc_add_controls(codec, alc5623_snd_controls, 943 snd_soc_add_codec_controls(codec, alc5623_snd_controls,
944 ARRAY_SIZE(alc5623_snd_controls)); 944 ARRAY_SIZE(alc5623_snd_controls));
945 945
946 snd_soc_dapm_new_controls(dapm, alc5623_dapm_widgets, 946 snd_soc_dapm_new_controls(dapm, alc5623_dapm_widgets,
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index af9c27ae02f0..f69fb426ad0a 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -994,7 +994,7 @@ static int alc5632_probe(struct snd_soc_codec *codec)
994 994
995 switch (alc5632->id) { 995 switch (alc5632->id) {
996 case 0x5c: 996 case 0x5c:
997 snd_soc_add_controls(codec, alc5632_vol_snd_controls, 997 snd_soc_add_codec_controls(codec, alc5632_vol_snd_controls,
998 ARRAY_SIZE(alc5632_vol_snd_controls)); 998 ARRAY_SIZE(alc5632_vol_snd_controls));
999 break; 999 break;
1000 default: 1000 default:
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
index 06d2ea18a54c..064cd6a93516 100644
--- a/sound/soc/codecs/cq93vc.c
+++ b/sound/soc/codecs/cq93vc.c
@@ -157,7 +157,7 @@ static int cq93vc_probe(struct snd_soc_codec *codec)
157 codec->control_data = davinci_vc; 157 codec->control_data = davinci_vc;
158 158
159 /* Set controls */ 159 /* Set controls */
160 snd_soc_add_controls(codec, cq93vc_snd_controls, 160 snd_soc_add_codec_controls(codec, cq93vc_snd_controls,
161 ARRAY_SIZE(cq93vc_snd_controls)); 161 ARRAY_SIZE(cq93vc_snd_controls));
162 162
163 /* Off, with power on */ 163 /* Off, with power on */
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 055536645da9..6baccd285df1 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -521,7 +521,7 @@ static int cs4270_probe(struct snd_soc_codec *codec)
521 } 521 }
522 522
523 /* Add the non-DAPM controls */ 523 /* Add the non-DAPM controls */
524 ret = snd_soc_add_controls(codec, cs4270_snd_controls, 524 ret = snd_soc_add_codec_controls(codec, cs4270_snd_controls,
525 ARRAY_SIZE(cs4270_snd_controls)); 525 ARRAY_SIZE(cs4270_snd_controls));
526 if (ret < 0) { 526 if (ret < 0) {
527 dev_err(codec->dev, "failed to add controls\n"); 527 dev_err(codec->dev, "failed to add controls\n");
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index f6fe846b6a6c..bf7141280a74 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -513,7 +513,7 @@ static int cs4271_probe(struct snd_soc_codec *codec)
513 /* Power-up sequence requires 85 uS */ 513 /* Power-up sequence requires 85 uS */
514 udelay(85); 514 udelay(85);
515 515
516 return snd_soc_add_controls(codec, cs4271_snd_controls, 516 return snd_soc_add_codec_controls(codec, cs4271_snd_controls,
517 ARRAY_SIZE(cs4271_snd_controls)); 517 ARRAY_SIZE(cs4271_snd_controls));
518} 518}
519 519
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c
index 319039240e0f..ba4fafb93e56 100644
--- a/sound/soc/codecs/lm4857.c
+++ b/sound/soc/codecs/lm4857.c
@@ -179,7 +179,7 @@ static int lm4857_probe(struct snd_soc_codec *codec)
179 179
180 codec->control_data = lm4857->i2c; 180 codec->control_data = lm4857->i2c;
181 181
182 ret = snd_soc_add_controls(codec, lm4857_controls, 182 ret = snd_soc_add_codec_controls(codec, lm4857_controls,
183 ARRAY_SIZE(lm4857_controls)); 183 ARRAY_SIZE(lm4857_controls));
184 if (ret) 184 if (ret)
185 return ret; 185 return ret;
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index 006efcfe6dda..af7324b79dd0 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -1908,7 +1908,7 @@ static void max98088_handle_eq_pdata(struct snd_soc_codec *codec)
1908 max98088->eq_enum.texts = max98088->eq_texts; 1908 max98088->eq_enum.texts = max98088->eq_texts;
1909 max98088->eq_enum.max = max98088->eq_textcnt; 1909 max98088->eq_enum.max = max98088->eq_textcnt;
1910 1910
1911 ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls)); 1911 ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
1912 if (ret != 0) 1912 if (ret != 0)
1913 dev_err(codec->dev, "Failed to add EQ control: %d\n", ret); 1913 dev_err(codec->dev, "Failed to add EQ control: %d\n", ret);
1914} 1914}
@@ -2030,7 +2030,7 @@ static int max98088_probe(struct snd_soc_codec *codec)
2030 2030
2031 max98088_handle_pdata(codec); 2031 max98088_handle_pdata(codec);
2032 2032
2033 snd_soc_add_controls(codec, max98088_snd_controls, 2033 snd_soc_add_codec_controls(codec, max98088_snd_controls,
2034 ARRAY_SIZE(max98088_snd_controls)); 2034 ARRAY_SIZE(max98088_snd_controls));
2035 2035
2036err_access: 2036err_access:
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index fcfa7497d7b7..0bb511a0388d 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -1284,7 +1284,7 @@ static const struct snd_soc_dapm_route max98095_audio_map[] = {
1284 1284
1285static int max98095_add_widgets(struct snd_soc_codec *codec) 1285static int max98095_add_widgets(struct snd_soc_codec *codec)
1286{ 1286{
1287 snd_soc_add_controls(codec, max98095_snd_controls, 1287 snd_soc_add_codec_controls(codec, max98095_snd_controls,
1288 ARRAY_SIZE(max98095_snd_controls)); 1288 ARRAY_SIZE(max98095_snd_controls));
1289 1289
1290 return 0; 1290 return 0;
@@ -1984,7 +1984,7 @@ static void max98095_handle_eq_pdata(struct snd_soc_codec *codec)
1984 max98095->eq_enum.texts = max98095->eq_texts; 1984 max98095->eq_enum.texts = max98095->eq_texts;
1985 max98095->eq_enum.max = max98095->eq_textcnt; 1985 max98095->eq_enum.max = max98095->eq_textcnt;
1986 1986
1987 ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls)); 1987 ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
1988 if (ret != 0) 1988 if (ret != 0)
1989 dev_err(codec->dev, "Failed to add EQ control: %d\n", ret); 1989 dev_err(codec->dev, "Failed to add EQ control: %d\n", ret);
1990} 1990}
@@ -2139,7 +2139,7 @@ static void max98095_handle_bq_pdata(struct snd_soc_codec *codec)
2139 max98095->bq_enum.texts = max98095->bq_texts; 2139 max98095->bq_enum.texts = max98095->bq_texts;
2140 max98095->bq_enum.max = max98095->bq_textcnt; 2140 max98095->bq_enum.max = max98095->bq_textcnt;
2141 2141
2142 ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls)); 2142 ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
2143 if (ret != 0) 2143 if (ret != 0)
2144 dev_err(codec->dev, "Failed to add Biquad control: %d\n", ret); 2144 dev_err(codec->dev, "Failed to add Biquad control: %d\n", ret);
2145} 2145}
diff --git a/sound/soc/codecs/max9877.c b/sound/soc/codecs/max9877.c
index dcf6f2a1600a..3a2ba3d8fd6d 100644
--- a/sound/soc/codecs/max9877.c
+++ b/sound/soc/codecs/max9877.c
@@ -253,7 +253,7 @@ static const struct snd_kcontrol_new max9877_controls[] = {
253/* This function is called from ASoC machine driver */ 253/* This function is called from ASoC machine driver */
254int max9877_add_controls(struct snd_soc_codec *codec) 254int max9877_add_controls(struct snd_soc_codec *codec)
255{ 255{
256 return snd_soc_add_controls(codec, max9877_controls, 256 return snd_soc_add_codec_controls(codec, max9877_controls,
257 ARRAY_SIZE(max9877_controls)); 257 ARRAY_SIZE(max9877_controls));
258} 258}
259EXPORT_SYMBOL_GPL(max9877_add_controls); 259EXPORT_SYMBOL_GPL(max9877_add_controls);
diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c
index aa0392360da9..50dbdb9357ea 100644
--- a/sound/soc/codecs/sn95031.c
+++ b/sound/soc/codecs/sn95031.c
@@ -869,7 +869,7 @@ static int sn95031_codec_probe(struct snd_soc_codec *codec)
869 snd_soc_write(codec, SN95031_SSR2, 0x10); 869 snd_soc_write(codec, SN95031_SSR2, 0x10);
870 snd_soc_write(codec, SN95031_SSR3, 0x40); 870 snd_soc_write(codec, SN95031_SSR3, 0x40);
871 871
872 snd_soc_add_controls(codec, sn95031_snd_controls, 872 snd_soc_add_codec_controls(codec, sn95031_snd_controls,
873 ARRAY_SIZE(sn95031_snd_controls)); 873 ARRAY_SIZE(sn95031_snd_controls));
874 874
875 return 0; 875 return 0;
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index 333dd98af39c..de2b20544ceb 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -548,7 +548,7 @@ static int ssm2602_probe(struct snd_soc_codec *codec)
548 snd_soc_update_bits(codec, SSM2602_ROUT1V, 548 snd_soc_update_bits(codec, SSM2602_ROUT1V,
549 ROUT1V_RLHP_BOTH, ROUT1V_RLHP_BOTH); 549 ROUT1V_RLHP_BOTH, ROUT1V_RLHP_BOTH);
550 550
551 ret = snd_soc_add_controls(codec, ssm2602_snd_controls, 551 ret = snd_soc_add_codec_controls(codec, ssm2602_snd_controls,
552 ARRAY_SIZE(ssm2602_snd_controls)); 552 ARRAY_SIZE(ssm2602_snd_controls));
553 if (ret) 553 if (ret)
554 return ret; 554 return ret;
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
index cc0566c22ec1..982e437799a8 100644
--- a/sound/soc/codecs/stac9766.c
+++ b/sound/soc/codecs/stac9766.c
@@ -355,7 +355,7 @@ static int stac9766_codec_probe(struct snd_soc_codec *codec)
355 355
356 stac9766_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 356 stac9766_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
357 357
358 snd_soc_add_controls(codec, stac9766_snd_ac97_controls, 358 snd_soc_add_codec_controls(codec, stac9766_snd_ac97_controls,
359 ARRAY_SIZE(stac9766_snd_ac97_controls)); 359 ARRAY_SIZE(stac9766_snd_ac97_controls));
360 360
361 return 0; 361 return 0;
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index dfa41a96599b..16d55f91a653 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -593,7 +593,7 @@ static int tlv320aic23_probe(struct snd_soc_codec *codec)
593 593
594 snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x1); 594 snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x1);
595 595
596 snd_soc_add_controls(codec, tlv320aic23_snd_controls, 596 snd_soc_add_codec_controls(codec, tlv320aic23_snd_controls,
597 ARRAY_SIZE(tlv320aic23_snd_controls)); 597 ARRAY_SIZE(tlv320aic23_snd_controls));
598 598
599 return 0; 599 return 0;
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c
index a038daec682b..802064b5030d 100644
--- a/sound/soc/codecs/tlv320aic26.c
+++ b/sound/soc/codecs/tlv320aic26.c
@@ -389,7 +389,7 @@ static int aic26_probe(struct snd_soc_codec *codec)
389 389
390 /* register controls */ 390 /* register controls */
391 dev_dbg(codec->dev, "Registering controls\n"); 391 dev_dbg(codec->dev, "Registering controls\n");
392 err = snd_soc_add_controls(codec, aic26_snd_controls, 392 err = snd_soc_add_codec_controls(codec, aic26_snd_controls,
393 ARRAY_SIZE(aic26_snd_controls)); 393 ARRAY_SIZE(aic26_snd_controls));
394 WARN_ON(err < 0); 394 WARN_ON(err < 0);
395 395
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 372b0b83bd9f..b0a73d37ed52 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -671,7 +671,7 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
671 } 671 }
672 672
673 aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 673 aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
674 snd_soc_add_controls(codec, aic32x4_snd_controls, 674 snd_soc_add_codec_controls(codec, aic32x4_snd_controls,
675 ARRAY_SIZE(aic32x4_snd_controls)); 675 ARRAY_SIZE(aic32x4_snd_controls));
676 aic32x4_add_widgets(codec); 676 aic32x4_add_widgets(codec);
677 677
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 285b7a22dc10..0bb7cb8815c8 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1425,10 +1425,10 @@ static int aic3x_probe(struct snd_soc_codec *codec)
1425 (aic3x->setup->gpio_func[1] & 0xf) << 4); 1425 (aic3x->setup->gpio_func[1] & 0xf) << 4);
1426 } 1426 }
1427 1427
1428 snd_soc_add_controls(codec, aic3x_snd_controls, 1428 snd_soc_add_codec_controls(codec, aic3x_snd_controls,
1429 ARRAY_SIZE(aic3x_snd_controls)); 1429 ARRAY_SIZE(aic3x_snd_controls));
1430 if (aic3x->model == AIC3X_MODEL_3007) 1430 if (aic3x->model == AIC3X_MODEL_3007)
1431 snd_soc_add_controls(codec, &aic3x_classd_amp_gain_ctrl, 1); 1431 snd_soc_add_codec_controls(codec, &aic3x_classd_amp_gain_ctrl, 1);
1432 1432
1433 aic3x_add_widgets(codec); 1433 aic3x_add_widgets(codec);
1434 list_add(&aic3x->list, &reset_list); 1434 list_add(&aic3x->list, &reset_list);
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 2c957c845709..4587ddd0fbf8 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -1437,7 +1437,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
1437 1437
1438 /* Only add the FIFO controls, if we have valid IRQ number */ 1438 /* Only add the FIFO controls, if we have valid IRQ number */
1439 if (dac33->irq >= 0) 1439 if (dac33->irq >= 0)
1440 snd_soc_add_controls(codec, dac33_mode_snd_controls, 1440 snd_soc_add_codec_controls(codec, dac33_mode_snd_controls,
1441 ARRAY_SIZE(dac33_mode_snd_controls)); 1441 ARRAY_SIZE(dac33_mode_snd_controls));
1442 1442
1443err_power: 1443err_power:
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 363b99dad8e9..6fe4aa3ac544 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -351,10 +351,10 @@ int tpa6130a2_add_controls(struct snd_soc_codec *codec)
351 data = i2c_get_clientdata(tpa6130a2_client); 351 data = i2c_get_clientdata(tpa6130a2_client);
352 352
353 if (data->id == TPA6140A2) 353 if (data->id == TPA6140A2)
354 return snd_soc_add_controls(codec, tpa6140a2_controls, 354 return snd_soc_add_codec_controls(codec, tpa6140a2_controls,
355 ARRAY_SIZE(tpa6140a2_controls)); 355 ARRAY_SIZE(tpa6140a2_controls));
356 else 356 else
357 return snd_soc_add_controls(codec, tpa6130a2_controls, 357 return snd_soc_add_codec_controls(codec, tpa6130a2_controls,
358 ARRAY_SIZE(tpa6130a2_controls)); 358 ARRAY_SIZE(tpa6130a2_controls));
359} 359}
360EXPORT_SYMBOL_GPL(tpa6130a2_add_controls); 360EXPORT_SYMBOL_GPL(tpa6130a2_add_controls);
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c
index 8f4f469d6411..797b0dde2c68 100644
--- a/sound/soc/codecs/uda134x.c
+++ b/sound/soc/codecs/uda134x.c
@@ -531,15 +531,15 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec)
531 switch (pd->model) { 531 switch (pd->model) {
532 case UDA134X_UDA1340: 532 case UDA134X_UDA1340:
533 case UDA134X_UDA1344: 533 case UDA134X_UDA1344:
534 ret = snd_soc_add_controls(codec, uda1340_snd_controls, 534 ret = snd_soc_add_codec_controls(codec, uda1340_snd_controls,
535 ARRAY_SIZE(uda1340_snd_controls)); 535 ARRAY_SIZE(uda1340_snd_controls));
536 break; 536 break;
537 case UDA134X_UDA1341: 537 case UDA134X_UDA1341:
538 ret = snd_soc_add_controls(codec, uda1341_snd_controls, 538 ret = snd_soc_add_codec_controls(codec, uda1341_snd_controls,
539 ARRAY_SIZE(uda1341_snd_controls)); 539 ARRAY_SIZE(uda1341_snd_controls));
540 break; 540 break;
541 case UDA134X_UDA1345: 541 case UDA134X_UDA1345:
542 ret = snd_soc_add_controls(codec, uda1345_snd_controls, 542 ret = snd_soc_add_codec_controls(codec, uda1345_snd_controls,
543 ARRAY_SIZE(uda1345_snd_controls)); 543 ARRAY_SIZE(uda1345_snd_controls));
544 break; 544 break;
545 default: 545 default:
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index 44aacf927ba9..3d868dc40092 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -464,7 +464,7 @@ static int wl1273_probe(struct snd_soc_codec *codec)
464 464
465 snd_soc_codec_set_drvdata(codec, wl1273); 465 snd_soc_codec_set_drvdata(codec, wl1273);
466 466
467 r = snd_soc_add_controls(codec, wl1273_controls, 467 r = snd_soc_add_codec_controls(codec, wl1273_controls,
468 ARRAY_SIZE(wl1273_controls)); 468 ARRAY_SIZE(wl1273_controls));
469 if (r) 469 if (r)
470 kfree(wl1273); 470 kfree(wl1273);
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c
index ff95e62c56b9..4fe9d191e277 100644
--- a/sound/soc/codecs/wm8737.c
+++ b/sound/soc/codecs/wm8737.c
@@ -599,7 +599,7 @@ static int wm8737_probe(struct snd_soc_codec *codec)
599 /* Bias level configuration will have done an extra enable */ 599 /* Bias level configuration will have done an extra enable */
600 regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies); 600 regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
601 601
602 snd_soc_add_controls(codec, wm8737_snd_controls, 602 snd_soc_add_codec_controls(codec, wm8737_snd_controls,
603 ARRAY_SIZE(wm8737_snd_controls)); 603 ARRAY_SIZE(wm8737_snd_controls));
604 wm8737_add_widgets(codec); 604 wm8737_add_widgets(codec);
605 605
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c
index bd60f847762c..a5127b4ff9e1 100644
--- a/sound/soc/codecs/wm8770.c
+++ b/sound/soc/codecs/wm8770.c
@@ -641,7 +641,7 @@ static int wm8770_probe(struct snd_soc_codec *codec)
641 /* mute all DACs */ 641 /* mute all DACs */
642 snd_soc_update_bits(codec, WM8770_DACMUTE, 0x10, 0x10); 642 snd_soc_update_bits(codec, WM8770_DACMUTE, 0x10, 0x10);
643 643
644 snd_soc_add_controls(codec, wm8770_snd_controls, 644 snd_soc_add_codec_controls(codec, wm8770_snd_controls,
645 ARRAY_SIZE(wm8770_snd_controls)); 645 ARRAY_SIZE(wm8770_snd_controls));
646 snd_soc_dapm_new_controls(&codec->dapm, wm8770_dapm_widgets, 646 snd_soc_dapm_new_controls(&codec->dapm, wm8770_dapm_widgets,
647 ARRAY_SIZE(wm8770_dapm_widgets)); 647 ARRAY_SIZE(wm8770_dapm_widgets));
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 37079eace412..65d525d74c54 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1176,11 +1176,11 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)
1176 1176
1177 switch (wm8904->devtype) { 1177 switch (wm8904->devtype) {
1178 case WM8904: 1178 case WM8904:
1179 snd_soc_add_controls(codec, wm8904_adc_snd_controls, 1179 snd_soc_add_codec_controls(codec, wm8904_adc_snd_controls,
1180 ARRAY_SIZE(wm8904_adc_snd_controls)); 1180 ARRAY_SIZE(wm8904_adc_snd_controls));
1181 snd_soc_add_controls(codec, wm8904_dac_snd_controls, 1181 snd_soc_add_codec_controls(codec, wm8904_dac_snd_controls,
1182 ARRAY_SIZE(wm8904_dac_snd_controls)); 1182 ARRAY_SIZE(wm8904_dac_snd_controls));
1183 snd_soc_add_controls(codec, wm8904_snd_controls, 1183 snd_soc_add_codec_controls(codec, wm8904_snd_controls,
1184 ARRAY_SIZE(wm8904_snd_controls)); 1184 ARRAY_SIZE(wm8904_snd_controls));
1185 1185
1186 snd_soc_dapm_new_controls(dapm, wm8904_adc_dapm_widgets, 1186 snd_soc_dapm_new_controls(dapm, wm8904_adc_dapm_widgets,
@@ -1201,7 +1201,7 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)
1201 break; 1201 break;
1202 1202
1203 case WM8912: 1203 case WM8912:
1204 snd_soc_add_controls(codec, wm8904_dac_snd_controls, 1204 snd_soc_add_codec_controls(codec, wm8904_dac_snd_controls,
1205 ARRAY_SIZE(wm8904_dac_snd_controls)); 1205 ARRAY_SIZE(wm8904_dac_snd_controls));
1206 1206
1207 snd_soc_dapm_new_controls(dapm, wm8904_dac_dapm_widgets, 1207 snd_soc_dapm_new_controls(dapm, wm8904_dac_dapm_widgets,
@@ -2020,7 +2020,7 @@ static void wm8904_handle_retune_mobile_pdata(struct snd_soc_codec *codec)
2020 wm8904->retune_mobile_enum.max = wm8904->num_retune_mobile_texts; 2020 wm8904->retune_mobile_enum.max = wm8904->num_retune_mobile_texts;
2021 wm8904->retune_mobile_enum.texts = wm8904->retune_mobile_texts; 2021 wm8904->retune_mobile_enum.texts = wm8904->retune_mobile_texts;
2022 2022
2023 ret = snd_soc_add_controls(codec, &control, 1); 2023 ret = snd_soc_add_codec_controls(codec, &control, 1);
2024 if (ret != 0) 2024 if (ret != 0)
2025 dev_err(codec->dev, 2025 dev_err(codec->dev,
2026 "Failed to add ReTune Mobile control: %d\n", ret); 2026 "Failed to add ReTune Mobile control: %d\n", ret);
@@ -2033,7 +2033,7 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
2033 int ret, i; 2033 int ret, i;
2034 2034
2035 if (!pdata) { 2035 if (!pdata) {
2036 snd_soc_add_controls(codec, wm8904_eq_controls, 2036 snd_soc_add_codec_controls(codec, wm8904_eq_controls,
2037 ARRAY_SIZE(wm8904_eq_controls)); 2037 ARRAY_SIZE(wm8904_eq_controls));
2038 return; 2038 return;
2039 } 2039 }
@@ -2061,7 +2061,7 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
2061 wm8904->drc_enum.max = pdata->num_drc_cfgs; 2061 wm8904->drc_enum.max = pdata->num_drc_cfgs;
2062 wm8904->drc_enum.texts = wm8904->drc_texts; 2062 wm8904->drc_enum.texts = wm8904->drc_texts;
2063 2063
2064 ret = snd_soc_add_controls(codec, &control, 1); 2064 ret = snd_soc_add_codec_controls(codec, &control, 1);
2065 if (ret != 0) 2065 if (ret != 0)
2066 dev_err(codec->dev, 2066 dev_err(codec->dev,
2067 "Failed to add DRC mode control: %d\n", ret); 2067 "Failed to add DRC mode control: %d\n", ret);
@@ -2075,7 +2075,7 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
2075 if (pdata->num_retune_mobile_cfgs) 2075 if (pdata->num_retune_mobile_cfgs)
2076 wm8904_handle_retune_mobile_pdata(codec); 2076 wm8904_handle_retune_mobile_pdata(codec);
2077 else 2077 else
2078 snd_soc_add_controls(codec, wm8904_eq_controls, 2078 snd_soc_add_codec_controls(codec, wm8904_eq_controls,
2079 ARRAY_SIZE(wm8904_eq_controls)); 2079 ARRAY_SIZE(wm8904_eq_controls));
2080} 2080}
2081 2081
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index ae1933ed3e07..d2883affea3b 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -717,7 +717,7 @@ static int wm8940_probe(struct snd_soc_codec *codec)
717 return ret; 717 return ret;
718 } 718 }
719 719
720 ret = snd_soc_add_controls(codec, wm8940_snd_controls, 720 ret = snd_soc_add_codec_controls(codec, wm8940_snd_controls,
721 ARRAY_SIZE(wm8940_snd_controls)); 721 ARRAY_SIZE(wm8940_snd_controls));
722 if (ret) 722 if (ret)
723 return ret; 723 return ret;
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c
index 40ac888faf3d..1332692ef81b 100644
--- a/sound/soc/codecs/wm8958-dsp2.c
+++ b/sound/soc/codecs/wm8958-dsp2.c
@@ -920,11 +920,11 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
920 920
921 wm8994->dsp_active = -1; 921 wm8994->dsp_active = -1;
922 922
923 snd_soc_add_controls(codec, wm8958_mbc_snd_controls, 923 snd_soc_add_codec_controls(codec, wm8958_mbc_snd_controls,
924 ARRAY_SIZE(wm8958_mbc_snd_controls)); 924 ARRAY_SIZE(wm8958_mbc_snd_controls));
925 snd_soc_add_controls(codec, wm8958_vss_snd_controls, 925 snd_soc_add_codec_controls(codec, wm8958_vss_snd_controls,
926 ARRAY_SIZE(wm8958_vss_snd_controls)); 926 ARRAY_SIZE(wm8958_vss_snd_controls));
927 snd_soc_add_controls(codec, wm8958_enh_eq_snd_controls, 927 snd_soc_add_codec_controls(codec, wm8958_enh_eq_snd_controls,
928 ARRAY_SIZE(wm8958_enh_eq_snd_controls)); 928 ARRAY_SIZE(wm8958_enh_eq_snd_controls));
929 929
930 930
@@ -958,7 +958,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
958 wm8994->mbc_enum.max = pdata->num_mbc_cfgs; 958 wm8994->mbc_enum.max = pdata->num_mbc_cfgs;
959 wm8994->mbc_enum.texts = wm8994->mbc_texts; 959 wm8994->mbc_enum.texts = wm8994->mbc_texts;
960 960
961 ret = snd_soc_add_controls(wm8994->codec, control, 1); 961 ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
962 if (ret != 0) 962 if (ret != 0)
963 dev_err(wm8994->codec->dev, 963 dev_err(wm8994->codec->dev,
964 "Failed to add MBC mode controls: %d\n", ret); 964 "Failed to add MBC mode controls: %d\n", ret);
@@ -986,7 +986,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
986 wm8994->vss_enum.max = pdata->num_vss_cfgs; 986 wm8994->vss_enum.max = pdata->num_vss_cfgs;
987 wm8994->vss_enum.texts = wm8994->vss_texts; 987 wm8994->vss_enum.texts = wm8994->vss_texts;
988 988
989 ret = snd_soc_add_controls(wm8994->codec, control, 1); 989 ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
990 if (ret != 0) 990 if (ret != 0)
991 dev_err(wm8994->codec->dev, 991 dev_err(wm8994->codec->dev,
992 "Failed to add VSS mode controls: %d\n", ret); 992 "Failed to add VSS mode controls: %d\n", ret);
@@ -1015,7 +1015,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
1015 wm8994->vss_hpf_enum.max = pdata->num_vss_hpf_cfgs; 1015 wm8994->vss_hpf_enum.max = pdata->num_vss_hpf_cfgs;
1016 wm8994->vss_hpf_enum.texts = wm8994->vss_hpf_texts; 1016 wm8994->vss_hpf_enum.texts = wm8994->vss_hpf_texts;
1017 1017
1018 ret = snd_soc_add_controls(wm8994->codec, control, 1); 1018 ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
1019 if (ret != 0) 1019 if (ret != 0)
1020 dev_err(wm8994->codec->dev, 1020 dev_err(wm8994->codec->dev,
1021 "Failed to add VSS HPFmode controls: %d\n", 1021 "Failed to add VSS HPFmode controls: %d\n",
@@ -1045,7 +1045,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
1045 wm8994->enh_eq_enum.max = pdata->num_enh_eq_cfgs; 1045 wm8994->enh_eq_enum.max = pdata->num_enh_eq_cfgs;
1046 wm8994->enh_eq_enum.texts = wm8994->enh_eq_texts; 1046 wm8994->enh_eq_enum.texts = wm8994->enh_eq_texts;
1047 1047
1048 ret = snd_soc_add_controls(wm8994->codec, control, 1); 1048 ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
1049 if (ret != 0) 1049 if (ret != 0)
1050 dev_err(wm8994->codec->dev, 1050 dev_err(wm8994->codec->dev,
1051 "Failed to add enhanced EQ controls: %d\n", 1051 "Failed to add enhanced EQ controls: %d\n",
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index e5caae32e541..840d72086d04 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -940,7 +940,7 @@ static int wm8960_probe(struct snd_soc_codec *codec)
940 snd_soc_update_bits(codec, WM8960_LOUT2, 0x100, 0x100); 940 snd_soc_update_bits(codec, WM8960_LOUT2, 0x100, 0x100);
941 snd_soc_update_bits(codec, WM8960_ROUT2, 0x100, 0x100); 941 snd_soc_update_bits(codec, WM8960_ROUT2, 0x100, 0x100);
942 942
943 snd_soc_add_controls(codec, wm8960_snd_controls, 943 snd_soc_add_codec_controls(codec, wm8960_snd_controls,
944 ARRAY_SIZE(wm8960_snd_controls)); 944 ARRAY_SIZE(wm8960_snd_controls));
945 wm8960_add_widgets(codec); 945 wm8960_add_widgets(codec);
946 946
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c
index 4f20c72a0f1d..05ea7c274093 100644
--- a/sound/soc/codecs/wm8961.c
+++ b/sound/soc/codecs/wm8961.c
@@ -1022,7 +1022,7 @@ static int wm8961_probe(struct snd_soc_codec *codec)
1022 1022
1023 wm8961_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1023 wm8961_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1024 1024
1025 snd_soc_add_controls(codec, wm8961_snd_controls, 1025 snd_soc_add_codec_controls(codec, wm8961_snd_controls,
1026 ARRAY_SIZE(wm8961_snd_controls)); 1026 ARRAY_SIZE(wm8961_snd_controls));
1027 snd_soc_dapm_new_controls(dapm, wm8961_dapm_widgets, 1027 snd_soc_dapm_new_controls(dapm, wm8961_dapm_widgets,
1028 ARRAY_SIZE(wm8961_dapm_widgets)); 1028 ARRAY_SIZE(wm8961_dapm_widgets));
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index b6fcdcc4341e..25b6baed3a29 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2405,13 +2405,13 @@ static int wm8962_add_widgets(struct snd_soc_codec *codec)
2405 struct wm8962_pdata *pdata = dev_get_platdata(codec->dev); 2405 struct wm8962_pdata *pdata = dev_get_platdata(codec->dev);
2406 struct snd_soc_dapm_context *dapm = &codec->dapm; 2406 struct snd_soc_dapm_context *dapm = &codec->dapm;
2407 2407
2408 snd_soc_add_controls(codec, wm8962_snd_controls, 2408 snd_soc_add_codec_controls(codec, wm8962_snd_controls,
2409 ARRAY_SIZE(wm8962_snd_controls)); 2409 ARRAY_SIZE(wm8962_snd_controls));
2410 if (pdata && pdata->spk_mono) 2410 if (pdata && pdata->spk_mono)
2411 snd_soc_add_controls(codec, wm8962_spk_mono_controls, 2411 snd_soc_add_codec_controls(codec, wm8962_spk_mono_controls,
2412 ARRAY_SIZE(wm8962_spk_mono_controls)); 2412 ARRAY_SIZE(wm8962_spk_mono_controls));
2413 else 2413 else
2414 snd_soc_add_controls(codec, wm8962_spk_stereo_controls, 2414 snd_soc_add_codec_controls(codec, wm8962_spk_stereo_controls,
2415 ARRAY_SIZE(wm8962_spk_stereo_controls)); 2415 ARRAY_SIZE(wm8962_spk_stereo_controls));
2416 2416
2417 2417
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index e538edaae1f0..9d242351e6e8 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -1356,7 +1356,7 @@ static int wm8990_probe(struct snd_soc_codec *codec)
1356 snd_soc_write(codec, WM8990_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1356 snd_soc_write(codec, WM8990_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8));
1357 snd_soc_write(codec, WM8990_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1357 snd_soc_write(codec, WM8990_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8));
1358 1358
1359 snd_soc_add_controls(codec, wm8990_snd_controls, 1359 snd_soc_add_codec_controls(codec, wm8990_snd_controls,
1360 ARRAY_SIZE(wm8990_snd_controls)); 1360 ARRAY_SIZE(wm8990_snd_controls));
1361 wm8990_add_widgets(codec); 1361 wm8990_add_widgets(codec);
1362 1362
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 7ee40da8dbb5..9ac31ba9b82e 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -1297,7 +1297,7 @@ static int wm8991_probe(struct snd_soc_codec *codec)
1297 snd_soc_write(codec, WM8991_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1297 snd_soc_write(codec, WM8991_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8));
1298 snd_soc_write(codec, WM8991_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1298 snd_soc_write(codec, WM8991_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8));
1299 1299
1300 snd_soc_add_controls(codec, wm8991_snd_controls, 1300 snd_soc_add_codec_controls(codec, wm8991_snd_controls,
1301 ARRAY_SIZE(wm8991_snd_controls)); 1301 ARRAY_SIZE(wm8991_snd_controls));
1302 1302
1303 snd_soc_dapm_new_controls(&codec->dapm, wm8991_dapm_widgets, 1303 snd_soc_dapm_new_controls(&codec->dapm, wm8991_dapm_widgets,
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c
index db51007a6a43..f814d2711b55 100644
--- a/sound/soc/codecs/wm8993.c
+++ b/sound/soc/codecs/wm8993.c
@@ -1604,13 +1604,13 @@ static int wm8993_probe(struct snd_soc_codec *codec)
1604 if (ret != 0) 1604 if (ret != 0)
1605 return ret; 1605 return ret;
1606 1606
1607 snd_soc_add_controls(codec, wm8993_snd_controls, 1607 snd_soc_add_codec_controls(codec, wm8993_snd_controls,
1608 ARRAY_SIZE(wm8993_snd_controls)); 1608 ARRAY_SIZE(wm8993_snd_controls));
1609 if (wm8993->pdata.num_retune_configs != 0) { 1609 if (wm8993->pdata.num_retune_configs != 0) {
1610 dev_dbg(codec->dev, "Using ReTune Mobile\n"); 1610 dev_dbg(codec->dev, "Using ReTune Mobile\n");
1611 } else { 1611 } else {
1612 dev_dbg(codec->dev, "No ReTune Mobile, using normal EQ\n"); 1612 dev_dbg(codec->dev, "No ReTune Mobile, using normal EQ\n");
1613 snd_soc_add_controls(codec, wm8993_eq_controls, 1613 snd_soc_add_codec_controls(codec, wm8993_eq_controls,
1614 ARRAY_SIZE(wm8993_eq_controls)); 1614 ARRAY_SIZE(wm8993_eq_controls));
1615 } 1615 }
1616 1616
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index c26291844e5d..8ae6585edbe0 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2867,7 +2867,7 @@ static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994)
2867 wm8994->retune_mobile_enum.max = wm8994->num_retune_mobile_texts; 2867 wm8994->retune_mobile_enum.max = wm8994->num_retune_mobile_texts;
2868 wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts; 2868 wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts;
2869 2869
2870 ret = snd_soc_add_controls(wm8994->codec, controls, 2870 ret = snd_soc_add_codec_controls(wm8994->codec, controls,
2871 ARRAY_SIZE(controls)); 2871 ARRAY_SIZE(controls));
2872 if (ret != 0) 2872 if (ret != 0)
2873 dev_err(wm8994->codec->dev, 2873 dev_err(wm8994->codec->dev,
@@ -2920,7 +2920,7 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
2920 wm8994->drc_enum.max = pdata->num_drc_cfgs; 2920 wm8994->drc_enum.max = pdata->num_drc_cfgs;
2921 wm8994->drc_enum.texts = wm8994->drc_texts; 2921 wm8994->drc_enum.texts = wm8994->drc_texts;
2922 2922
2923 ret = snd_soc_add_controls(wm8994->codec, controls, 2923 ret = snd_soc_add_codec_controls(wm8994->codec, controls,
2924 ARRAY_SIZE(controls)); 2924 ARRAY_SIZE(controls));
2925 if (ret != 0) 2925 if (ret != 0)
2926 dev_err(wm8994->codec->dev, 2926 dev_err(wm8994->codec->dev,
@@ -2936,7 +2936,7 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
2936 if (pdata->num_retune_mobile_cfgs) 2936 if (pdata->num_retune_mobile_cfgs)
2937 wm8994_handle_retune_mobile_pdata(wm8994); 2937 wm8994_handle_retune_mobile_pdata(wm8994);
2938 else 2938 else
2939 snd_soc_add_controls(wm8994->codec, wm8994_eq_controls, 2939 snd_soc_add_codec_controls(wm8994->codec, wm8994_eq_controls,
2940 ARRAY_SIZE(wm8994_eq_controls)); 2940 ARRAY_SIZE(wm8994_eq_controls));
2941 2941
2942 for (i = 0; i < ARRAY_SIZE(pdata->micbias); i++) { 2942 for (i = 0; i < ARRAY_SIZE(pdata->micbias); i++) {
@@ -3652,7 +3652,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3652 wm8994_handle_pdata(wm8994); 3652 wm8994_handle_pdata(wm8994);
3653 3653
3654 wm_hubs_add_analogue_controls(codec); 3654 wm_hubs_add_analogue_controls(codec);
3655 snd_soc_add_controls(codec, wm8994_snd_controls, 3655 snd_soc_add_codec_controls(codec, wm8994_snd_controls,
3656 ARRAY_SIZE(wm8994_snd_controls)); 3656 ARRAY_SIZE(wm8994_snd_controls));
3657 snd_soc_dapm_new_controls(dapm, wm8994_dapm_widgets, 3657 snd_soc_dapm_new_controls(dapm, wm8994_dapm_widgets,
3658 ARRAY_SIZE(wm8994_dapm_widgets)); 3658 ARRAY_SIZE(wm8994_dapm_widgets));
@@ -3678,7 +3678,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3678 } 3678 }
3679 break; 3679 break;
3680 case WM8958: 3680 case WM8958:
3681 snd_soc_add_controls(codec, wm8958_snd_controls, 3681 snd_soc_add_codec_controls(codec, wm8958_snd_controls,
3682 ARRAY_SIZE(wm8958_snd_controls)); 3682 ARRAY_SIZE(wm8958_snd_controls));
3683 snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets, 3683 snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets,
3684 ARRAY_SIZE(wm8958_dapm_widgets)); 3684 ARRAY_SIZE(wm8958_dapm_widgets));
@@ -3700,7 +3700,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3700 break; 3700 break;
3701 3701
3702 case WM1811: 3702 case WM1811:
3703 snd_soc_add_controls(codec, wm8958_snd_controls, 3703 snd_soc_add_codec_controls(codec, wm8958_snd_controls,
3704 ARRAY_SIZE(wm8958_snd_controls)); 3704 ARRAY_SIZE(wm8958_snd_controls));
3705 snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets, 3705 snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets,
3706 ARRAY_SIZE(wm8958_dapm_widgets)); 3706 ARRAY_SIZE(wm8958_dapm_widgets));
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c
index 89a864287c13..28c89b094c6e 100644
--- a/sound/soc/codecs/wm8995.c
+++ b/sound/soc/codecs/wm8995.c
@@ -2136,7 +2136,7 @@ static int wm8995_probe(struct snd_soc_codec *codec)
2136 2136
2137 wm8995_update_class_w(codec); 2137 wm8995_update_class_w(codec);
2138 2138
2139 snd_soc_add_controls(codec, wm8995_snd_controls, 2139 snd_soc_add_codec_controls(codec, wm8995_snd_controls,
2140 ARRAY_SIZE(wm8995_snd_controls)); 2140 ARRAY_SIZE(wm8995_snd_controls));
2141 snd_soc_dapm_new_controls(&codec->dapm, wm8995_dapm_widgets, 2141 snd_soc_dapm_new_controls(&codec->dapm, wm8995_dapm_widgets,
2142 ARRAY_SIZE(wm8995_dapm_widgets)); 2142 ARRAY_SIZE(wm8995_dapm_widgets));
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 10f41c888884..86f449ccf813 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2771,7 +2771,7 @@ static void wm8996_retune_mobile_pdata(struct snd_soc_codec *codec)
2771 wm8996->retune_mobile_enum.max = wm8996->num_retune_mobile_texts; 2771 wm8996->retune_mobile_enum.max = wm8996->num_retune_mobile_texts;
2772 wm8996->retune_mobile_enum.texts = wm8996->retune_mobile_texts; 2772 wm8996->retune_mobile_enum.texts = wm8996->retune_mobile_texts;
2773 2773
2774 ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls)); 2774 ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
2775 if (ret != 0) 2775 if (ret != 0)
2776 dev_err(codec->dev, 2776 dev_err(codec->dev,
2777 "Failed to add ReTune Mobile controls: %d\n", ret); 2777 "Failed to add ReTune Mobile controls: %d\n", ret);
@@ -2966,7 +2966,7 @@ static int wm8996_probe(struct snd_soc_codec *codec)
2966 if (wm8996->pdata.num_retune_mobile_cfgs) 2966 if (wm8996->pdata.num_retune_mobile_cfgs)
2967 wm8996_retune_mobile_pdata(codec); 2967 wm8996_retune_mobile_pdata(codec);
2968 else 2968 else
2969 snd_soc_add_controls(codec, wm8996_eq_controls, 2969 snd_soc_add_codec_controls(codec, wm8996_eq_controls,
2970 ARRAY_SIZE(wm8996_eq_controls)); 2970 ARRAY_SIZE(wm8996_eq_controls));
2971 2971
2972 /* If the TX LRCLK pins are not in LRCLK mode configure the 2972 /* If the TX LRCLK pins are not in LRCLK mode configure the
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index a6bab392700e..7b09b1f86dbb 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -1287,7 +1287,7 @@ static int wm9081_probe(struct snd_soc_codec *codec)
1287 if (!wm9081->pdata.num_retune_configs) { 1287 if (!wm9081->pdata.num_retune_configs) {
1288 dev_dbg(codec->dev, 1288 dev_dbg(codec->dev,
1289 "No ReTune Mobile data, using normal EQ\n"); 1289 "No ReTune Mobile data, using normal EQ\n");
1290 snd_soc_add_controls(codec, wm9081_eq_controls, 1290 snd_soc_add_codec_controls(codec, wm9081_eq_controls,
1291 ARRAY_SIZE(wm9081_eq_controls)); 1291 ARRAY_SIZE(wm9081_eq_controls));
1292 } 1292 }
1293 1293
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c
index a2b9208a08f0..e8280eecd4c9 100644
--- a/sound/soc/codecs/wm9090.c
+++ b/sound/soc/codecs/wm9090.c
@@ -433,7 +433,7 @@ static int wm9090_add_controls(struct snd_soc_codec *codec)
433 433
434 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); 434 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
435 435
436 snd_soc_add_controls(codec, wm9090_controls, 436 snd_soc_add_codec_controls(codec, wm9090_controls,
437 ARRAY_SIZE(wm9090_controls)); 437 ARRAY_SIZE(wm9090_controls));
438 438
439 if (wm9090->pdata.lin1_diff) { 439 if (wm9090->pdata.lin1_diff) {
@@ -442,7 +442,7 @@ static int wm9090_add_controls(struct snd_soc_codec *codec)
442 } else { 442 } else {
443 snd_soc_dapm_add_routes(dapm, audio_map_in1_se, 443 snd_soc_dapm_add_routes(dapm, audio_map_in1_se,
444 ARRAY_SIZE(audio_map_in1_se)); 444 ARRAY_SIZE(audio_map_in1_se));
445 snd_soc_add_controls(codec, wm9090_in1_se_controls, 445 snd_soc_add_codec_controls(codec, wm9090_in1_se_controls,
446 ARRAY_SIZE(wm9090_in1_se_controls)); 446 ARRAY_SIZE(wm9090_in1_se_controls));
447 } 447 }
448 448
@@ -452,7 +452,7 @@ static int wm9090_add_controls(struct snd_soc_codec *codec)
452 } else { 452 } else {
453 snd_soc_dapm_add_routes(dapm, audio_map_in2_se, 453 snd_soc_dapm_add_routes(dapm, audio_map_in2_se,
454 ARRAY_SIZE(audio_map_in2_se)); 454 ARRAY_SIZE(audio_map_in2_se));
455 snd_soc_add_controls(codec, wm9090_in2_se_controls, 455 snd_soc_add_codec_controls(codec, wm9090_in2_se_controls,
456 ARRAY_SIZE(wm9090_in2_se_controls)); 456 ARRAY_SIZE(wm9090_in2_se_controls));
457 } 457 }
458 458
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index 40c92ead85a3..cacc6a86b46f 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -351,7 +351,7 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
351 if (ret) 351 if (ret)
352 goto reset_err; 352 goto reset_err;
353 353
354 snd_soc_add_controls(codec, wm9705_snd_ac97_controls, 354 snd_soc_add_codec_controls(codec, wm9705_snd_ac97_controls,
355 ARRAY_SIZE(wm9705_snd_ac97_controls)); 355 ARRAY_SIZE(wm9705_snd_ac97_controls));
356 356
357 return 0; 357 return 0;
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 7291eabb0eb1..b342ae50bcd6 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -637,7 +637,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
637 ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); 637 ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);
638 638
639 wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 639 wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
640 snd_soc_add_controls(codec, wm9712_snd_ac97_controls, 640 snd_soc_add_codec_controls(codec, wm9712_snd_ac97_controls,
641 ARRAY_SIZE(wm9712_snd_ac97_controls)); 641 ARRAY_SIZE(wm9712_snd_ac97_controls));
642 642
643 return 0; 643 return 0;
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 2b8479bfcd93..2d22cc70d536 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1216,7 +1216,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
1216 reg = ac97_read(codec, AC97_CD) & 0x7fff; 1216 reg = ac97_read(codec, AC97_CD) & 0x7fff;
1217 ac97_write(codec, AC97_CD, reg); 1217 ac97_write(codec, AC97_CD, reg);
1218 1218
1219 snd_soc_add_controls(codec, wm9713_snd_ac97_controls, 1219 snd_soc_add_codec_controls(codec, wm9713_snd_ac97_controls,
1220 ARRAY_SIZE(wm9713_snd_ac97_controls)); 1220 ARRAY_SIZE(wm9713_snd_ac97_controls));
1221 1221
1222 return 0; 1222 return 0;
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
index ec7d49033d4c..c509911a59fc 100644
--- a/sound/soc/codecs/wm_hubs.c
+++ b/sound/soc/codecs/wm_hubs.c
@@ -895,7 +895,7 @@ int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec)
895 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU, 895 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU,
896 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU); 896 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU);
897 897
898 snd_soc_add_controls(codec, analogue_snd_controls, 898 snd_soc_add_codec_controls(codec, analogue_snd_controls,
899 ARRAY_SIZE(analogue_snd_controls)); 899 ARRAY_SIZE(analogue_snd_controls));
900 900
901 snd_soc_dapm_new_controls(dapm, analogue_dapm_widgets, 901 snd_soc_dapm_new_controls(dapm, analogue_dapm_widgets,
diff --git a/sound/soc/mid-x86/mfld_machine.c b/sound/soc/mid-x86/mfld_machine.c
index 6f77eef0f131..2937e54da49e 100644
--- a/sound/soc/mid-x86/mfld_machine.c
+++ b/sound/soc/mid-x86/mfld_machine.c
@@ -235,7 +235,7 @@ static int mfld_init(struct snd_soc_pcm_runtime *runtime)
235 snd_soc_dapm_enable_pin(dapm, "Headphones"); 235 snd_soc_dapm_enable_pin(dapm, "Headphones");
236 snd_soc_dapm_enable_pin(dapm, "Mic"); 236 snd_soc_dapm_enable_pin(dapm, "Mic");
237 237
238 ret_val = snd_soc_add_controls(codec, mfld_snd_controls, 238 ret_val = snd_soc_add_codec_controls(codec, mfld_snd_controls,
239 ARRAY_SIZE(mfld_snd_controls)); 239 ARRAY_SIZE(mfld_snd_controls));
240 if (ret_val) { 240 if (ret_val) {
241 pr_err("soc_add_controls failed %d", ret_val); 241 pr_err("soc_add_controls failed %d", ret_val);
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index a67f4370bc9f..78563bbbbf01 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -570,7 +570,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
570 snd_soc_dapm_disable_pin(dapm, "AGCOUT"); 570 snd_soc_dapm_disable_pin(dapm, "AGCOUT");
571 571
572 /* Add virtual switch */ 572 /* Add virtual switch */
573 ret = snd_soc_add_controls(codec, ams_delta_audio_controls, 573 ret = snd_soc_add_codec_controls(codec, ams_delta_audio_controls,
574 ARRAY_SIZE(ams_delta_audio_controls)); 574 ARRAY_SIZE(ams_delta_audio_controls));
575 if (ret) 575 if (ret)
576 dev_warn(card->dev, 576 dev_warn(card->dev,
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 597be412f1e4..1490227cd379 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -55,9 +55,8 @@ static int n810_spk_func;
55static int n810_jack_func; 55static int n810_jack_func;
56static int n810_dmic_func; 56static int n810_dmic_func;
57 57
58static void n810_ext_control(struct snd_soc_codec *codec) 58static void n810_ext_control(struct snd_soc_dapm_context *dapm)
59{ 59{
60 struct snd_soc_dapm_context *dapm = &codec->dapm;
61 int hp = 0, line1l = 0; 60 int hp = 0, line1l = 0;
62 61
63 switch (n810_jack_func) { 62 switch (n810_jack_func) {
@@ -102,7 +101,7 @@ static int n810_startup(struct snd_pcm_substream *substream)
102 snd_pcm_hw_constraint_minmax(runtime, 101 snd_pcm_hw_constraint_minmax(runtime,
103 SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); 102 SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2);
104 103
105 n810_ext_control(codec); 104 n810_ext_control(&codec->dapm);
106 return clk_enable(sys_clkout2); 105 return clk_enable(sys_clkout2);
107} 106}
108 107
@@ -142,13 +141,13 @@ static int n810_get_spk(struct snd_kcontrol *kcontrol,
142static int n810_set_spk(struct snd_kcontrol *kcontrol, 141static int n810_set_spk(struct snd_kcontrol *kcontrol,
143 struct snd_ctl_elem_value *ucontrol) 142 struct snd_ctl_elem_value *ucontrol)
144{ 143{
145 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 144 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
146 145
147 if (n810_spk_func == ucontrol->value.integer.value[0]) 146 if (n810_spk_func == ucontrol->value.integer.value[0])
148 return 0; 147 return 0;
149 148
150 n810_spk_func = ucontrol->value.integer.value[0]; 149 n810_spk_func = ucontrol->value.integer.value[0];
151 n810_ext_control(codec); 150 n810_ext_control(&card->dapm);
152 151
153 return 1; 152 return 1;
154} 153}
@@ -164,13 +163,13 @@ static int n810_get_jack(struct snd_kcontrol *kcontrol,
164static int n810_set_jack(struct snd_kcontrol *kcontrol, 163static int n810_set_jack(struct snd_kcontrol *kcontrol,
165 struct snd_ctl_elem_value *ucontrol) 164 struct snd_ctl_elem_value *ucontrol)
166{ 165{
167 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 166 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
168 167
169 if (n810_jack_func == ucontrol->value.integer.value[0]) 168 if (n810_jack_func == ucontrol->value.integer.value[0])
170 return 0; 169 return 0;
171 170
172 n810_jack_func = ucontrol->value.integer.value[0]; 171 n810_jack_func = ucontrol->value.integer.value[0];
173 n810_ext_control(codec); 172 n810_ext_control(&card->dapm);
174 173
175 return 1; 174 return 1;
176} 175}
@@ -186,7 +185,7 @@ static int n810_get_input(struct snd_kcontrol *kcontrol,
186static int n810_set_input(struct snd_kcontrol *kcontrol, 185static int n810_set_input(struct snd_kcontrol *kcontrol,
187 struct snd_ctl_elem_value *ucontrol) 186 struct snd_ctl_elem_value *ucontrol)
188{ 187{
189 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 188 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
190 189
191 if (n810_dmic_func == ucontrol->value.integer.value[0]) 190 if (n810_dmic_func == ucontrol->value.integer.value[0])
192 return 0; 191 return 0;
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 017371913ec3..1287b870f221 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -744,17 +744,17 @@ static const struct snd_kcontrol_new omap_mcbsp3_st_controls[] = {
744 omap_mcbsp3_set_st_ch1_volume), 744 omap_mcbsp3_set_st_ch1_volume),
745}; 745};
746 746
747int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id) 747int omap_mcbsp_st_add_controls(struct snd_soc_dai *dai)
748{ 748{
749 if (!cpu_is_omap34xx()) 749 if (!cpu_is_omap34xx())
750 return -ENODEV; 750 return -ENODEV;
751 751
752 switch (mcbsp_id) { 752 switch (dai->id) {
753 case 1: /* McBSP 2 */ 753 case 1: /* McBSP 2 */
754 return snd_soc_add_controls(codec, omap_mcbsp2_st_controls, 754 return snd_soc_add_dai_controls(dai, omap_mcbsp2_st_controls,
755 ARRAY_SIZE(omap_mcbsp2_st_controls)); 755 ARRAY_SIZE(omap_mcbsp2_st_controls));
756 case 2: /* McBSP 3 */ 756 case 2: /* McBSP 3 */
757 return snd_soc_add_controls(codec, omap_mcbsp3_st_controls, 757 return snd_soc_add_dai_controls(dai, omap_mcbsp3_st_controls,
758 ARRAY_SIZE(omap_mcbsp3_st_controls)); 758 ARRAY_SIZE(omap_mcbsp3_st_controls));
759 default: 759 default:
760 break; 760 break;
diff --git a/sound/soc/omap/omap-mcbsp.h b/sound/soc/omap/omap-mcbsp.h
index 65cde9d3807b..476fe2add703 100644
--- a/sound/soc/omap/omap-mcbsp.h
+++ b/sound/soc/omap/omap-mcbsp.h
@@ -59,6 +59,6 @@ enum omap_mcbsp_div {
59#define NUM_LINKS 5 59#define NUM_LINKS 5
60#endif 60#endif
61 61
62int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id); 62int omap_mcbsp_st_add_controls(struct snd_soc_dai *dai);
63 63
64#endif 64#endif
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index fada6ef43eea..58936c730a87 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -59,9 +59,8 @@ static int rx51_spk_func;
59static int rx51_dmic_func; 59static int rx51_dmic_func;
60static int rx51_jack_func; 60static int rx51_jack_func;
61 61
62static void rx51_ext_control(struct snd_soc_codec *codec) 62static void rx51_ext_control(struct snd_soc_dapm_context *dapm)
63{ 63{
64 struct snd_soc_dapm_context *dapm = &codec->dapm;
65 int hp = 0, hs = 0, tvout = 0; 64 int hp = 0, hs = 0, tvout = 0;
66 65
67 switch (rx51_jack_func) { 66 switch (rx51_jack_func) {
@@ -102,11 +101,11 @@ static int rx51_startup(struct snd_pcm_substream *substream)
102{ 101{
103 struct snd_pcm_runtime *runtime = substream->runtime; 102 struct snd_pcm_runtime *runtime = substream->runtime;
104 struct snd_soc_pcm_runtime *rtd = substream->private_data; 103 struct snd_soc_pcm_runtime *rtd = substream->private_data;
105 struct snd_soc_codec *codec = rtd->codec; 104 struct snd_soc_card *card = rtd->card;
106 105
107 snd_pcm_hw_constraint_minmax(runtime, 106 snd_pcm_hw_constraint_minmax(runtime,
108 SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); 107 SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2);
109 rx51_ext_control(codec); 108 rx51_ext_control(&card->dapm);
110 109
111 return 0; 110 return 0;
112} 111}
@@ -138,13 +137,13 @@ static int rx51_get_spk(struct snd_kcontrol *kcontrol,
138static int rx51_set_spk(struct snd_kcontrol *kcontrol, 137static int rx51_set_spk(struct snd_kcontrol *kcontrol,
139 struct snd_ctl_elem_value *ucontrol) 138 struct snd_ctl_elem_value *ucontrol)
140{ 139{
141 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 140 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
142 141
143 if (rx51_spk_func == ucontrol->value.integer.value[0]) 142 if (rx51_spk_func == ucontrol->value.integer.value[0])
144 return 0; 143 return 0;
145 144
146 rx51_spk_func = ucontrol->value.integer.value[0]; 145 rx51_spk_func = ucontrol->value.integer.value[0];
147 rx51_ext_control(codec); 146 rx51_ext_control(&card->dapm);
148 147
149 return 1; 148 return 1;
150} 149}
@@ -184,13 +183,13 @@ static int rx51_get_input(struct snd_kcontrol *kcontrol,
184static int rx51_set_input(struct snd_kcontrol *kcontrol, 183static int rx51_set_input(struct snd_kcontrol *kcontrol,
185 struct snd_ctl_elem_value *ucontrol) 184 struct snd_ctl_elem_value *ucontrol)
186{ 185{
187 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 186 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
188 187
189 if (rx51_dmic_func == ucontrol->value.integer.value[0]) 188 if (rx51_dmic_func == ucontrol->value.integer.value[0])
190 return 0; 189 return 0;
191 190
192 rx51_dmic_func = ucontrol->value.integer.value[0]; 191 rx51_dmic_func = ucontrol->value.integer.value[0];
193 rx51_ext_control(codec); 192 rx51_ext_control(&card->dapm);
194 193
195 return 1; 194 return 1;
196} 195}
@@ -206,13 +205,13 @@ static int rx51_get_jack(struct snd_kcontrol *kcontrol,
206static int rx51_set_jack(struct snd_kcontrol *kcontrol, 205static int rx51_set_jack(struct snd_kcontrol *kcontrol,
207 struct snd_ctl_elem_value *ucontrol) 206 struct snd_ctl_elem_value *ucontrol)
208{ 207{
209 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 208 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
210 209
211 if (rx51_jack_func == ucontrol->value.integer.value[0]) 210 if (rx51_jack_func == ucontrol->value.integer.value[0])
212 return 0; 211 return 0;
213 212
214 rx51_jack_func = ucontrol->value.integer.value[0]; 213 rx51_jack_func = ucontrol->value.integer.value[0];
215 rx51_ext_control(codec); 214 rx51_ext_control(&card->dapm);
216 215
217 return 1; 216 return 1;
218} 217}
@@ -297,7 +296,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
297 snd_soc_dapm_nc_pin(dapm, "LINE1R"); 296 snd_soc_dapm_nc_pin(dapm, "LINE1R");
298 297
299 /* Add RX-51 specific controls */ 298 /* Add RX-51 specific controls */
300 err = snd_soc_add_controls(codec, aic34_rx51_controls, 299 err = snd_soc_add_card_controls(rtd->card, aic34_rx51_controls,
301 ARRAY_SIZE(aic34_rx51_controls)); 300 ARRAY_SIZE(aic34_rx51_controls));
302 if (err < 0) 301 if (err < 0)
303 return err; 302 return err;
@@ -314,7 +313,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
314 return err; 313 return err;
315 snd_soc_limit_volume(codec, "TPA6130A2 Headphone Playback Volume", 42); 314 snd_soc_limit_volume(codec, "TPA6130A2 Headphone Playback Volume", 42);
316 315
317 err = omap_mcbsp_st_add_controls(codec, 1); 316 err = omap_mcbsp_st_add_controls(rtd->cpu_dai);
318 if (err < 0) 317 if (err < 0)
319 return err; 318 return err;
320 319
@@ -335,7 +334,7 @@ static int rx51_aic34b_init(struct snd_soc_dapm_context *dapm)
335{ 334{
336 int err; 335 int err;
337 336
338 err = snd_soc_add_controls(dapm->codec, aic34_rx51_controlsb, 337 err = snd_soc_add_card_controls(dapm->card, aic34_rx51_controlsb,
339 ARRAY_SIZE(aic34_rx51_controlsb)); 338 ARRAY_SIZE(aic34_rx51_controlsb));
340 if (err < 0) 339 if (err < 0)
341 return err; 340 return err;
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
index bc21944851c4..863367ad89ce 100644
--- a/sound/soc/pxa/corgi.c
+++ b/sound/soc/pxa/corgi.c
@@ -45,10 +45,8 @@
45static int corgi_jack_func; 45static int corgi_jack_func;
46static int corgi_spk_func; 46static int corgi_spk_func;
47 47
48static void corgi_ext_control(struct snd_soc_codec *codec) 48static void corgi_ext_control(struct snd_soc_dapm_context *dapm)
49{ 49{
50 struct snd_soc_dapm_context *dapm = &codec->dapm;
51
52 /* set up jack connection */ 50 /* set up jack connection */
53 switch (corgi_jack_func) { 51 switch (corgi_jack_func) {
54 case CORGI_HP: 52 case CORGI_HP:
@@ -104,7 +102,7 @@ static int corgi_startup(struct snd_pcm_substream *substream)
104 mutex_lock(&codec->mutex); 102 mutex_lock(&codec->mutex);
105 103
106 /* check the jack status at stream startup */ 104 /* check the jack status at stream startup */
107 corgi_ext_control(codec); 105 corgi_ext_control(&codec->dapm);
108 106
109 mutex_unlock(&codec->mutex); 107 mutex_unlock(&codec->mutex);
110 108
@@ -173,13 +171,13 @@ static int corgi_get_jack(struct snd_kcontrol *kcontrol,
173static int corgi_set_jack(struct snd_kcontrol *kcontrol, 171static int corgi_set_jack(struct snd_kcontrol *kcontrol,
174 struct snd_ctl_elem_value *ucontrol) 172 struct snd_ctl_elem_value *ucontrol)
175{ 173{
176 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 174 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
177 175
178 if (corgi_jack_func == ucontrol->value.integer.value[0]) 176 if (corgi_jack_func == ucontrol->value.integer.value[0])
179 return 0; 177 return 0;
180 178
181 corgi_jack_func = ucontrol->value.integer.value[0]; 179 corgi_jack_func = ucontrol->value.integer.value[0];
182 corgi_ext_control(codec); 180 corgi_ext_control(&card->dapm);
183 return 1; 181 return 1;
184} 182}
185 183
@@ -193,13 +191,13 @@ static int corgi_get_spk(struct snd_kcontrol *kcontrol,
193static int corgi_set_spk(struct snd_kcontrol *kcontrol, 191static int corgi_set_spk(struct snd_kcontrol *kcontrol,
194 struct snd_ctl_elem_value *ucontrol) 192 struct snd_ctl_elem_value *ucontrol)
195{ 193{
196 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 194 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
197 195
198 if (corgi_spk_func == ucontrol->value.integer.value[0]) 196 if (corgi_spk_func == ucontrol->value.integer.value[0])
199 return 0; 197 return 0;
200 198
201 corgi_spk_func = ucontrol->value.integer.value[0]; 199 corgi_spk_func = ucontrol->value.integer.value[0];
202 corgi_ext_control(codec); 200 corgi_ext_control(&card->dapm);
203 return 1; 201 return 1;
204} 202}
205 203
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c
index 3f7a8ecb9720..aace19e0fe2c 100644
--- a/sound/soc/pxa/magician.c
+++ b/sound/soc/pxa/magician.c
@@ -411,7 +411,7 @@ static int magician_uda1380_init(struct snd_soc_pcm_runtime *rtd)
411 snd_soc_dapm_nc_pin(dapm, "VINR"); 411 snd_soc_dapm_nc_pin(dapm, "VINR");
412 412
413 /* Add magician specific controls */ 413 /* Add magician specific controls */
414 err = snd_soc_add_controls(codec, uda1380_magician_controls, 414 err = snd_soc_add_codec_controls(codec, uda1380_magician_controls,
415 ARRAY_SIZE(uda1380_magician_controls)); 415 ARRAY_SIZE(uda1380_magician_controls));
416 if (err < 0) 416 if (err < 0)
417 return err; 417 return err;
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index fd0ed10c6fe7..d2cc81735036 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -43,10 +43,8 @@
43static int poodle_jack_func; 43static int poodle_jack_func;
44static int poodle_spk_func; 44static int poodle_spk_func;
45 45
46static void poodle_ext_control(struct snd_soc_codec *codec) 46static void poodle_ext_control(struct snd_soc_dapm_context *dapm)
47{ 47{
48 struct snd_soc_dapm_context *dapm = &codec->dapm;
49
50 /* set up jack connection */ 48 /* set up jack connection */
51 if (poodle_jack_func == POODLE_HP) { 49 if (poodle_jack_func == POODLE_HP) {
52 /* set = unmute headphone */ 50 /* set = unmute headphone */
@@ -81,7 +79,7 @@ static int poodle_startup(struct snd_pcm_substream *substream)
81 mutex_lock(&codec->mutex); 79 mutex_lock(&codec->mutex);
82 80
83 /* check the jack status at stream startup */ 81 /* check the jack status at stream startup */
84 poodle_ext_control(codec); 82 poodle_ext_control(&codec->dapm);
85 83
86 mutex_unlock(&codec->mutex); 84 mutex_unlock(&codec->mutex);
87 85
@@ -152,13 +150,13 @@ static int poodle_get_jack(struct snd_kcontrol *kcontrol,
152static int poodle_set_jack(struct snd_kcontrol *kcontrol, 150static int poodle_set_jack(struct snd_kcontrol *kcontrol,
153 struct snd_ctl_elem_value *ucontrol) 151 struct snd_ctl_elem_value *ucontrol)
154{ 152{
155 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 153 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
156 154
157 if (poodle_jack_func == ucontrol->value.integer.value[0]) 155 if (poodle_jack_func == ucontrol->value.integer.value[0])
158 return 0; 156 return 0;
159 157
160 poodle_jack_func = ucontrol->value.integer.value[0]; 158 poodle_jack_func = ucontrol->value.integer.value[0];
161 poodle_ext_control(codec); 159 poodle_ext_control(&card->dapm);
162 return 1; 160 return 1;
163} 161}
164 162
@@ -172,13 +170,13 @@ static int poodle_get_spk(struct snd_kcontrol *kcontrol,
172static int poodle_set_spk(struct snd_kcontrol *kcontrol, 170static int poodle_set_spk(struct snd_kcontrol *kcontrol,
173 struct snd_ctl_elem_value *ucontrol) 171 struct snd_ctl_elem_value *ucontrol)
174{ 172{
175 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 173 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
176 174
177 if (poodle_spk_func == ucontrol->value.integer.value[0]) 175 if (poodle_spk_func == ucontrol->value.integer.value[0])
178 return 0; 176 return 0;
179 177
180 poodle_spk_func = ucontrol->value.integer.value[0]; 178 poodle_spk_func = ucontrol->value.integer.value[0];
181 poodle_ext_control(codec); 179 poodle_ext_control(&card->dapm);
182 return 1; 180 return 1;
183} 181}
184 182
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index 564ef08a89f2..2aec63f3706a 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -197,7 +197,7 @@ static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd)
197 snd_soc_dapm_nc_pin(dapm, "MONOOUT"); 197 snd_soc_dapm_nc_pin(dapm, "MONOOUT");
198 198
199 /* add tosa specific controls */ 199 /* add tosa specific controls */
200 err = snd_soc_add_controls(codec, tosa_controls, 200 err = snd_soc_add_codec_controls(codec, tosa_controls,
201 ARRAY_SIZE(tosa_controls)); 201 ARRAY_SIZE(tosa_controls));
202 if (err < 0) 202 if (err < 0)
203 return err; 203 return err;
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c
index 7ac0ba2025c3..e34f4e803424 100644
--- a/sound/soc/samsung/neo1973_wm8753.c
+++ b/sound/soc/samsung/neo1973_wm8753.c
@@ -298,7 +298,7 @@ static int neo1973_gta02_wm8753_init(struct snd_soc_codec *codec)
298 if (ret) 298 if (ret)
299 return ret; 299 return ret;
300 300
301 ret = snd_soc_add_controls(codec, neo1973_gta02_wm8753_controls, 301 ret = snd_soc_add_card_controls(codec->card, neo1973_gta02_wm8753_controls,
302 ARRAY_SIZE(neo1973_gta02_wm8753_controls)); 302 ARRAY_SIZE(neo1973_gta02_wm8753_controls));
303 if (ret) 303 if (ret)
304 return ret; 304 return ret;
@@ -338,7 +338,7 @@ static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd)
338 return ret; 338 return ret;
339 339
340 /* add neo1973 specific controls */ 340 /* add neo1973 specific controls */
341 ret = snd_soc_add_controls(codec, neo1973_wm8753_controls, 341 ret = snd_soc_add_card_controls(rtd->card, neo1973_wm8753_controls,
342 ARRAY_SIZE(neo1973_wm8753_controls)); 342 ARRAY_SIZE(neo1973_wm8753_controls));
343 if (ret) 343 if (ret)
344 return ret; 344 return ret;
diff --git a/sound/soc/samsung/s3c24xx_simtec.c b/sound/soc/samsung/s3c24xx_simtec.c
index a253bcc1646a..656d5afe4ca9 100644
--- a/sound/soc/samsung/s3c24xx_simtec.c
+++ b/sound/soc/samsung/s3c24xx_simtec.c
@@ -134,18 +134,18 @@ static const struct snd_kcontrol_new amp_unmute_controls[] = {
134 134
135void simtec_audio_init(struct snd_soc_pcm_runtime *rtd) 135void simtec_audio_init(struct snd_soc_pcm_runtime *rtd)
136{ 136{
137 struct snd_soc_codec *codec = rtd->codec; 137 struct snd_soc_card *card = rtd->card;
138 138
139 if (pdata->amp_gpio > 0) { 139 if (pdata->amp_gpio > 0) {
140 pr_debug("%s: adding amp routes\n", __func__); 140 pr_debug("%s: adding amp routes\n", __func__);
141 141
142 snd_soc_add_controls(codec, amp_unmute_controls, 142 snd_soc_add_card_controls(card, amp_unmute_controls,
143 ARRAY_SIZE(amp_unmute_controls)); 143 ARRAY_SIZE(amp_unmute_controls));
144 } 144 }
145 145
146 if (pdata->amp_gain[0] > 0) { 146 if (pdata->amp_gain[0] > 0) {
147 pr_debug("%s: adding amp controls\n", __func__); 147 pr_debug("%s: adding amp controls\n", __func__);
148 snd_soc_add_controls(codec, amp_gain_controls, 148 snd_soc_add_card_controls(card, amp_gain_controls,
149 ARRAY_SIZE(amp_gain_controls)); 149 ARRAY_SIZE(amp_gain_controls));
150 } 150 }
151} 151}
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 091d5f37ae64..a3a47cdaac8f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -996,7 +996,7 @@ static int soc_probe_codec(struct snd_soc_card *card,
996 } 996 }
997 997
998 if (driver->controls) 998 if (driver->controls)
999 snd_soc_add_controls(codec, driver->controls, 999 snd_soc_add_codec_controls(codec, driver->controls,
1000 driver->num_controls); 1000 driver->num_controls);
1001 if (driver->dapm_routes) 1001 if (driver->dapm_routes)
1002 snd_soc_dapm_add_routes(&codec->dapm, driver->dapm_routes, 1002 snd_soc_dapm_add_routes(&codec->dapm, driver->dapm_routes,
@@ -1457,13 +1457,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
1457 } 1457 }
1458 } 1458 }
1459 1459
1460 /* We should have a non-codec control add function but we don't */
1461 if (card->controls) 1460 if (card->controls)
1462 snd_soc_add_controls(list_first_entry(&card->codec_dev_list, 1461 snd_soc_add_card_controls(card, card->controls, card->num_controls);
1463 struct snd_soc_codec,
1464 card_list),
1465 card->controls,
1466 card->num_controls);
1467 1462
1468 if (card->dapm_routes) 1463 if (card->dapm_routes)
1469 snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, 1464 snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
@@ -2015,9 +2010,28 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
2015} 2010}
2016EXPORT_SYMBOL_GPL(snd_soc_cnew); 2011EXPORT_SYMBOL_GPL(snd_soc_cnew);
2017 2012
2013static int snd_soc_add_controls(struct snd_card *card, struct device *dev,
2014 const struct snd_kcontrol_new *controls, int num_controls,
2015 const char *prefix, void *data)
2016{
2017 int err, i;
2018
2019 for (i = 0; i < num_controls; i++) {
2020 const struct snd_kcontrol_new *control = &controls[i];
2021 err = snd_ctl_add(card, snd_soc_cnew(control, data,
2022 control->name, prefix));
2023 if (err < 0) {
2024 dev_err(dev, "Failed to add %s: %d\n", control->name, err);
2025 return err;
2026 }
2027 }
2028
2029 return 0;
2030}
2031
2018/** 2032/**
2019 * snd_soc_add_controls - add an array of controls to a codec. 2033 * snd_soc_add_codec_controls - add an array of controls to a codec.
2020 * Convienience function to add a list of controls. Many codecs were 2034 * Convenience function to add a list of controls. Many codecs were
2021 * duplicating this code. 2035 * duplicating this code.
2022 * 2036 *
2023 * @codec: codec to add controls to 2037 * @codec: codec to add controls to
@@ -2026,31 +2040,19 @@ EXPORT_SYMBOL_GPL(snd_soc_cnew);
2026 * 2040 *
2027 * Return 0 for success, else error. 2041 * Return 0 for success, else error.
2028 */ 2042 */
2029int snd_soc_add_controls(struct snd_soc_codec *codec, 2043int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
2030 const struct snd_kcontrol_new *controls, int num_controls) 2044 const struct snd_kcontrol_new *controls, int num_controls)
2031{ 2045{
2032 struct snd_card *card = codec->card->snd_card; 2046 struct snd_card *card = codec->card->snd_card;
2033 int err, i;
2034 2047
2035 for (i = 0; i < num_controls; i++) { 2048 return snd_soc_add_controls(card, codec->dev, controls, num_controls,
2036 const struct snd_kcontrol_new *control = &controls[i]; 2049 codec->name_prefix, codec);
2037 err = snd_ctl_add(card, snd_soc_cnew(control, codec,
2038 control->name,
2039 codec->name_prefix));
2040 if (err < 0) {
2041 dev_err(codec->dev, "%s: Failed to add %s: %d\n",
2042 codec->name, control->name, err);
2043 return err;
2044 }
2045 }
2046
2047 return 0;
2048} 2050}
2049EXPORT_SYMBOL_GPL(snd_soc_add_controls); 2051EXPORT_SYMBOL_GPL(snd_soc_add_codec_controls);
2050 2052
2051/** 2053/**
2052 * snd_soc_add_platform_controls - add an array of controls to a platform. 2054 * snd_soc_add_platform_controls - add an array of controls to a platform.
2053 * Convienience function to add a list of controls. 2055 * Convenience function to add a list of controls.
2054 * 2056 *
2055 * @platform: platform to add controls to 2057 * @platform: platform to add controls to
2056 * @controls: array of controls to add 2058 * @controls: array of controls to add
@@ -2062,23 +2064,53 @@ int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
2062 const struct snd_kcontrol_new *controls, int num_controls) 2064 const struct snd_kcontrol_new *controls, int num_controls)
2063{ 2065{
2064 struct snd_card *card = platform->card->snd_card; 2066 struct snd_card *card = platform->card->snd_card;
2065 int err, i;
2066 2067
2067 for (i = 0; i < num_controls; i++) { 2068 return snd_soc_add_controls(card, platform->dev, controls, num_controls,
2068 const struct snd_kcontrol_new *control = &controls[i]; 2069 NULL, platform);
2069 err = snd_ctl_add(card, snd_soc_cnew(control, platform,
2070 control->name, NULL));
2071 if (err < 0) {
2072 dev_err(platform->dev, "Failed to add %s %d\n",control->name, err);
2073 return err;
2074 }
2075 }
2076
2077 return 0;
2078} 2070}
2079EXPORT_SYMBOL_GPL(snd_soc_add_platform_controls); 2071EXPORT_SYMBOL_GPL(snd_soc_add_platform_controls);
2080 2072
2081/** 2073/**
2074 * snd_soc_add_card_controls - add an array of controls to a SoC card.
2075 * Convenience function to add a list of controls.
2076 *
2077 * @soc_card: SoC card to add controls to
2078 * @controls: array of controls to add
2079 * @num_controls: number of elements in the array
2080 *
2081 * Return 0 for success, else error.
2082 */
2083int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
2084 const struct snd_kcontrol_new *controls, int num_controls)
2085{
2086 struct snd_card *card = soc_card->snd_card;
2087
2088 return snd_soc_add_controls(card, soc_card->dev, controls, num_controls,
2089 NULL, soc_card);
2090}
2091EXPORT_SYMBOL_GPL(snd_soc_add_card_controls);
2092
2093/**
2094 * snd_soc_add_dai_controls - add an array of controls to a DAI.
2095 * Convienience function to add a list of controls.
2096 *
2097 * @dai: DAI to add controls to
2098 * @controls: array of controls to add
2099 * @num_controls: number of elements in the array
2100 *
2101 * Return 0 for success, else error.
2102 */
2103int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
2104 const struct snd_kcontrol_new *controls, int num_controls)
2105{
2106 struct snd_card *card = dai->card->snd_card;
2107
2108 return snd_soc_add_controls(card, dai->dev, controls, num_controls,
2109 NULL, dai);
2110}
2111EXPORT_SYMBOL_GPL(snd_soc_add_dai_controls);
2112
2113/**
2082 * snd_soc_info_enum_double - enumerated double mixer info callback 2114 * snd_soc_info_enum_double - enumerated double mixer info callback
2083 * @kcontrol: mixer control 2115 * @kcontrol: mixer control
2084 * @uinfo: control element information 2116 * @uinfo: control element information