aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/88pm860x-codec.c3
-rw-r--r--sound/soc/codecs/ad193x.c10
-rw-r--r--sound/soc/codecs/adau1373.c7
-rw-r--r--sound/soc/codecs/adav80x.c7
-rw-r--r--sound/soc/codecs/ak4535.c9
-rw-r--r--sound/soc/codecs/ak4641.c8
-rw-r--r--sound/soc/codecs/ak4642.c8
-rw-r--r--sound/soc/codecs/ak4671.c12
-rw-r--r--sound/soc/codecs/alc5623.c7
-rw-r--r--sound/soc/codecs/alc5632.c8
-rw-r--r--sound/soc/codecs/cq93vc.c3
-rw-r--r--sound/soc/codecs/cs4270.c9
-rw-r--r--sound/soc/codecs/cs42l51.c6
-rw-r--r--sound/soc/codecs/cs42l52.c9
-rw-r--r--sound/soc/codecs/cs42l73.c11
-rw-r--r--sound/soc/codecs/da7210.c8
-rw-r--r--sound/soc/codecs/da7213.c8
-rw-r--r--sound/soc/codecs/da732x.c29
-rw-r--r--sound/soc/codecs/da9055.c8
-rw-r--r--sound/soc/codecs/isabelle.c16
-rw-r--r--sound/soc/codecs/lm49453.c17
-rw-r--r--sound/soc/codecs/max9768.c5
-rw-r--r--sound/soc/codecs/max98088.c6
-rw-r--r--sound/soc/codecs/max98090.c8
-rw-r--r--sound/soc/codecs/max98095.c6
-rw-r--r--sound/soc/codecs/max9850.c8
-rw-r--r--sound/soc/codecs/mc13783.c4
-rw-r--r--sound/soc/codecs/ml26124.c10
-rw-r--r--sound/soc/codecs/rt5631.c9
-rw-r--r--sound/soc/codecs/rt5640.c8
-rw-r--r--sound/soc/codecs/sgtl5000.c8
-rw-r--r--sound/soc/codecs/si476x.c6
-rw-r--r--sound/soc/codecs/sn95031.c2
-rw-r--r--sound/soc/codecs/ssm2518.c10
-rw-r--r--sound/soc/codecs/ssm2602.c7
-rw-r--r--sound/soc/codecs/sta32x.c14
-rw-r--r--sound/soc/codecs/sta529.c10
-rw-r--r--sound/soc/codecs/tlv320aic23.c8
-rw-r--r--sound/soc/codecs/tlv320aic26.c2
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c2
-rw-r--r--sound/soc/codecs/tlv320aic3x.c6
-rw-r--r--sound/soc/codecs/tlv320dac33.c1
-rw-r--r--sound/soc/codecs/wm2000.c2
-rw-r--r--sound/soc/codecs/wm2200.c7
-rw-r--r--sound/soc/codecs/wm5100.c7
-rw-r--r--sound/soc/codecs/wm5102.c4
-rw-r--r--sound/soc/codecs/wm5110.c3
-rw-r--r--sound/soc/codecs/wm8350.c4
-rw-r--r--sound/soc/codecs/wm8400.c3
-rw-r--r--sound/soc/codecs/wm8510.c10
-rw-r--r--sound/soc/codecs/wm8523.c7
-rw-r--r--sound/soc/codecs/wm8580.c6
-rw-r--r--sound/soc/codecs/wm8711.c6
-rw-r--r--sound/soc/codecs/wm8728.c11
-rw-r--r--sound/soc/codecs/wm8731.c7
-rw-r--r--sound/soc/codecs/wm8737.c6
-rw-r--r--sound/soc/codecs/wm8741.c6
-rw-r--r--sound/soc/codecs/wm8750.c6
-rw-r--r--sound/soc/codecs/wm8753.c7
-rw-r--r--sound/soc/codecs/wm8770.c6
-rw-r--r--sound/soc/codecs/wm8776.c6
-rw-r--r--sound/soc/codecs/wm8804.c8
-rw-r--r--sound/soc/codecs/wm8900.c8
-rw-r--r--sound/soc/codecs/wm8903.c10
-rw-r--r--sound/soc/codecs/wm8904.c9
-rw-r--r--sound/soc/codecs/wm8940.c6
-rw-r--r--sound/soc/codecs/wm8955.c8
-rw-r--r--sound/soc/codecs/wm8960.c6
-rw-r--r--sound/soc/codecs/wm8961.c7
-rw-r--r--sound/soc/codecs/wm8962.c7
-rw-r--r--sound/soc/codecs/wm8971.c6
-rw-r--r--sound/soc/codecs/wm8974.c6
-rw-r--r--sound/soc/codecs/wm8978.c8
-rw-r--r--sound/soc/codecs/wm8983.c6
-rw-r--r--sound/soc/codecs/wm8985.c7
-rw-r--r--sound/soc/codecs/wm8988.c8
-rw-r--r--sound/soc/codecs/wm8990.c8
-rw-r--r--sound/soc/codecs/wm8991.c8
-rw-r--r--sound/soc/codecs/wm8993.c7
-rw-r--r--sound/soc/codecs/wm8994.c3
-rw-r--r--sound/soc/codecs/wm8995.c7
-rw-r--r--sound/soc/codecs/wm8996.c12
-rw-r--r--sound/soc/codecs/wm8997.c4
-rw-r--r--sound/soc/codecs/wm9081.c11
-rw-r--r--sound/soc/codecs/wm9090.c10
-rw-r--r--sound/soc/soc-core.c14
-rw-r--r--sound/soc/soc-io.c64
87 files changed, 64 insertions, 651 deletions
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 8703244ee9fb..b07e17160f94 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -1327,8 +1327,7 @@ static int pm860x_probe(struct snd_soc_codec *codec)
1327 1327
1328 pm860x->codec = codec; 1328 pm860x->codec = codec;
1329 1329
1330 codec->control_data = pm860x->regmap; 1330 ret = snd_soc_codec_set_cache_io(codec, pm860x->regmap);
1331 ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
1332 if (ret) 1331 if (ret)
1333 return ret; 1332 return ret;
1334 1333
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index 9381a767e75f..6844d0b2af68 100644
--- a/sound/soc/codecs/ad193x.c
+++ b/sound/soc/codecs/ad193x.c
@@ -322,14 +322,6 @@ static struct snd_soc_dai_driver ad193x_dai = {
322static int ad193x_codec_probe(struct snd_soc_codec *codec) 322static int ad193x_codec_probe(struct snd_soc_codec *codec)
323{ 323{
324 struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); 324 struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec);
325 int ret;
326
327 codec->control_data = ad193x->regmap;
328 ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
329 if (ret < 0) {
330 dev_err(codec->dev, "failed to set cache I/O: %d\n", ret);
331 return ret;
332 }
333 325
334 /* default setting for ad193x */ 326 /* default setting for ad193x */
335 327
@@ -347,7 +339,7 @@ static int ad193x_codec_probe(struct snd_soc_codec *codec)
347 regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL0, 0x99); /* mclk=24.576Mhz: 0x9D; mclk=12.288Mhz: 0x99 */ 339 regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL0, 0x99); /* mclk=24.576Mhz: 0x9D; mclk=12.288Mhz: 0x99 */
348 regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL1, 0x04); 340 regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL1, 0x04);
349 341
350 return ret; 342 return 0;
351} 343}
352 344
353static struct snd_soc_codec_driver soc_codec_dev_ad193x = { 345static struct snd_soc_codec_driver soc_codec_dev_ad193x = {
diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c
index 5223800775ad..877f5737bb6b 100644
--- a/sound/soc/codecs/adau1373.c
+++ b/sound/soc/codecs/adau1373.c
@@ -1376,15 +1376,8 @@ static int adau1373_probe(struct snd_soc_codec *codec)
1376 struct adau1373_platform_data *pdata = codec->dev->platform_data; 1376 struct adau1373_platform_data *pdata = codec->dev->platform_data;
1377 bool lineout_differential = false; 1377 bool lineout_differential = false;
1378 unsigned int val; 1378 unsigned int val;
1379 int ret;
1380 int i; 1379 int i;
1381 1380
1382 ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
1383 if (ret) {
1384 dev_err(codec->dev, "failed to set cache I/O: %d\n", ret);
1385 return ret;
1386 }
1387
1388 if (pdata) { 1381 if (pdata) {
1389 if (pdata->num_drc > ARRAY_SIZE(pdata->drc_setting)) 1382 if (pdata->num_drc > ARRAY_SIZE(pdata->drc_setting))
1390 return -EINVAL; 1383 return -EINVAL;
diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c
index 7470831ba756..5062e34ee8dc 100644
--- a/sound/soc/codecs/adav80x.c
+++ b/sound/soc/codecs/adav80x.c
@@ -801,15 +801,8 @@ static struct snd_soc_dai_driver adav80x_dais[] = {
801 801
802static int adav80x_probe(struct snd_soc_codec *codec) 802static int adav80x_probe(struct snd_soc_codec *codec)
803{ 803{
804 int ret;
805 struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); 804 struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
806 805
807 ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
808 if (ret) {
809 dev_err(codec->dev, "failed to set cache I/O: %d\n", ret);
810 return ret;
811 }
812
813 /* Force PLLs on for SYSCLK output */ 806 /* Force PLLs on for SYSCLK output */
814 snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL1"); 807 snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL1");
815 snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL2"); 808 snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL2");
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 684fe910669f..30e297890fec 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -388,15 +388,6 @@ static int ak4535_resume(struct snd_soc_codec *codec)
388 388
389static int ak4535_probe(struct snd_soc_codec *codec) 389static int ak4535_probe(struct snd_soc_codec *codec)
390{ 390{
391 struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec);
392 int ret;
393
394 codec->control_data = ak4535->regmap;
395 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
396 if (ret < 0) {
397 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
398 return ret;
399 }
400 /* power on device */ 391 /* power on device */
401 ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 392 ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
402 393
diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c
index 684b56f2856a..868c0e2da1ec 100644
--- a/sound/soc/codecs/ak4641.c
+++ b/sound/soc/codecs/ak4641.c
@@ -519,14 +519,6 @@ static int ak4641_resume(struct snd_soc_codec *codec)
519 519
520static int ak4641_probe(struct snd_soc_codec *codec) 520static int ak4641_probe(struct snd_soc_codec *codec)
521{ 521{
522 int ret;
523
524 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
525 if (ret != 0) {
526 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
527 return ret;
528 }
529
530 /* power on device */ 522 /* power on device */
531 ak4641_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 523 ak4641_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
532 524
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index 1f646c6e90c6..92655cc189ae 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -465,14 +465,6 @@ static int ak4642_resume(struct snd_soc_codec *codec)
465 465
466static int ak4642_probe(struct snd_soc_codec *codec) 466static int ak4642_probe(struct snd_soc_codec *codec)
467{ 467{
468 int ret;
469
470 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
471 if (ret < 0) {
472 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
473 return ret;
474 }
475
476 ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 468 ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
477 469
478 return 0; 470 return 0;
diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c
index deb2b44669de..998fa0c5a0b9 100644
--- a/sound/soc/codecs/ak4671.c
+++ b/sound/soc/codecs/ak4671.c
@@ -613,17 +613,7 @@ static struct snd_soc_dai_driver ak4671_dai = {
613 613
614static int ak4671_probe(struct snd_soc_codec *codec) 614static int ak4671_probe(struct snd_soc_codec *codec)
615{ 615{
616 int ret; 616 return ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
617
618 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
619 if (ret < 0) {
620 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
621 return ret;
622 }
623
624 ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
625
626 return ret;
627} 617}
628 618
629static int ak4671_remove(struct snd_soc_codec *codec) 619static int ak4671_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c
index ed506253a914..09f7e773bafb 100644
--- a/sound/soc/codecs/alc5623.c
+++ b/sound/soc/codecs/alc5623.c
@@ -904,13 +904,6 @@ static int alc5623_probe(struct snd_soc_codec *codec)
904 struct snd_soc_dapm_context *dapm = &codec->dapm; 904 struct snd_soc_dapm_context *dapm = &codec->dapm;
905 int ret; 905 int ret;
906 906
907 codec->control_data = alc5623->regmap;
908 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
909 if (ret < 0) {
910 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
911 return ret;
912 }
913
914 alc5623_reset(codec); 907 alc5623_reset(codec);
915 908
916 /* power on device */ 909 /* power on device */
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index d885056ad8f2..ec071a6306ef 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -1063,14 +1063,6 @@ static int alc5632_probe(struct snd_soc_codec *codec)
1063 struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); 1063 struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec);
1064 int ret; 1064 int ret;
1065 1065
1066 codec->control_data = alc5632->regmap;
1067
1068 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1069 if (ret != 0) {
1070 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1071 return ret;
1072 }
1073
1074 /* power on device */ 1066 /* power on device */
1075 alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1067 alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1076 1068
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
index 43737a27d79c..1e25c7af853b 100644
--- a/sound/soc/codecs/cq93vc.c
+++ b/sound/soc/codecs/cq93vc.c
@@ -138,9 +138,8 @@ static int cq93vc_probe(struct snd_soc_codec *codec)
138 struct davinci_vc *davinci_vc = codec->dev->platform_data; 138 struct davinci_vc *davinci_vc = codec->dev->platform_data;
139 139
140 davinci_vc->cq93vc.codec = codec; 140 davinci_vc->cq93vc.codec = codec;
141 codec->control_data = davinci_vc->regmap;
142 141
143 snd_soc_codec_set_cache_io(codec, 32, 32, SND_SOC_REGMAP); 142 snd_soc_codec_set_cache_io(codec, davinci_vc->regmap);
144 143
145 /* Off, with power on */ 144 /* Off, with power on */
146 cq93vc_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 145 cq93vc_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 83c835d9fd88..3920e6264948 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -506,15 +506,6 @@ static int cs4270_probe(struct snd_soc_codec *codec)
506 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); 506 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
507 int ret; 507 int ret;
508 508
509 /* Tell ASoC what kind of I/O to use to read the registers. ASoC will
510 * then do the I2C transactions itself.
511 */
512 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
513 if (ret < 0) {
514 dev_err(codec->dev, "failed to set cache I/O (ret=%i)\n", ret);
515 return ret;
516 }
517
518 /* Disable auto-mute. This feature appears to be buggy. In some 509 /* Disable auto-mute. This feature appears to be buggy. In some
519 * situations, auto-mute will not deactivate when it should, so we want 510 * situations, auto-mute will not deactivate when it should, so we want
520 * this feature disabled by default. An application (e.g. alsactl) can 511 * this feature disabled by default. An application (e.g. alsactl) can
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
index 5caf75bc6bca..187062061152 100644
--- a/sound/soc/codecs/cs42l51.c
+++ b/sound/soc/codecs/cs42l51.c
@@ -488,12 +488,6 @@ static int cs42l51_probe(struct snd_soc_codec *codec)
488{ 488{
489 int ret, reg; 489 int ret, reg;
490 490
491 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
492 if (ret < 0) {
493 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
494 return ret;
495 }
496
497 /* 491 /*
498 * DAC configuration 492 * DAC configuration
499 * - Use signal processor 493 * - Use signal processor
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index be455ea5f2fe..ff454000ef7d 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -1109,14 +1109,7 @@ static void cs42l52_free_beep(struct snd_soc_codec *codec)
1109static int cs42l52_probe(struct snd_soc_codec *codec) 1109static int cs42l52_probe(struct snd_soc_codec *codec)
1110{ 1110{
1111 struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); 1111 struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec);
1112 int ret;
1113 1112
1114 codec->control_data = cs42l52->regmap;
1115 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1116 if (ret < 0) {
1117 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1118 return ret;
1119 }
1120 regcache_cache_only(cs42l52->regmap, true); 1113 regcache_cache_only(cs42l52->regmap, true);
1121 1114
1122 cs42l52_add_mic_controls(codec); 1115 cs42l52_add_mic_controls(codec);
@@ -1128,7 +1121,7 @@ static int cs42l52_probe(struct snd_soc_codec *codec)
1128 cs42l52->sysclk = CS42L52_DEFAULT_CLK; 1121 cs42l52->sysclk = CS42L52_DEFAULT_CLK;
1129 cs42l52->config.format = CS42L52_DEFAULT_FORMAT; 1122 cs42l52->config.format = CS42L52_DEFAULT_FORMAT;
1130 1123
1131 return ret; 1124 return 0;
1132} 1125}
1133 1126
1134static int cs42l52_remove(struct snd_soc_codec *codec) 1127static int cs42l52_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index 06f429184821..b2906c60254e 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -1345,17 +1345,8 @@ static int cs42l73_resume(struct snd_soc_codec *codec)
1345 1345
1346static int cs42l73_probe(struct snd_soc_codec *codec) 1346static int cs42l73_probe(struct snd_soc_codec *codec)
1347{ 1347{
1348 int ret;
1349 struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec); 1348 struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec);
1350 1349
1351 codec->control_data = cs42l73->regmap;
1352
1353 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1354 if (ret < 0) {
1355 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1356 return ret;
1357 }
1358
1359 cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1350 cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1360 1351
1361 /* Set Charge Pump Frequency */ 1352 /* Set Charge Pump Frequency */
@@ -1368,7 +1359,7 @@ static int cs42l73_probe(struct snd_soc_codec *codec)
1368 cs42l73->mclksel = CS42L73_CLKID_MCLK1; 1359 cs42l73->mclksel = CS42L73_CLKID_MCLK1;
1369 cs42l73->mclk = 0; 1360 cs42l73->mclk = 0;
1370 1361
1371 return ret; 1362 return 0;
1372} 1363}
1373 1364
1374static int cs42l73_remove(struct snd_soc_codec *codec) 1365static int cs42l73_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c
index 01e55fc72307..137e8ebc092c 100644
--- a/sound/soc/codecs/da7210.c
+++ b/sound/soc/codecs/da7210.c
@@ -1071,17 +1071,9 @@ static struct snd_soc_dai_driver da7210_dai = {
1071static int da7210_probe(struct snd_soc_codec *codec) 1071static int da7210_probe(struct snd_soc_codec *codec)
1072{ 1072{
1073 struct da7210_priv *da7210 = snd_soc_codec_get_drvdata(codec); 1073 struct da7210_priv *da7210 = snd_soc_codec_get_drvdata(codec);
1074 int ret;
1075 1074
1076 dev_info(codec->dev, "DA7210 Audio Codec %s\n", DA7210_VERSION); 1075 dev_info(codec->dev, "DA7210 Audio Codec %s\n", DA7210_VERSION);
1077 1076
1078 codec->control_data = da7210->regmap;
1079 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1080 if (ret < 0) {
1081 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1082 return ret;
1083 }
1084
1085 da7210->mclk_rate = 0; /* This will be set from set_sysclk() */ 1077 da7210->mclk_rate = 0; /* This will be set from set_sysclk() */
1086 da7210->master = 0; /* This will be set from set_fmt() */ 1078 da7210->master = 0; /* This will be set from set_fmt() */
1087 1079
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c
index 439d10387f10..738fa18a50d2 100644
--- a/sound/soc/codecs/da7213.c
+++ b/sound/soc/codecs/da7213.c
@@ -1393,17 +1393,9 @@ static int da7213_set_bias_level(struct snd_soc_codec *codec,
1393 1393
1394static int da7213_probe(struct snd_soc_codec *codec) 1394static int da7213_probe(struct snd_soc_codec *codec)
1395{ 1395{
1396 int ret;
1397 struct da7213_priv *da7213 = snd_soc_codec_get_drvdata(codec); 1396 struct da7213_priv *da7213 = snd_soc_codec_get_drvdata(codec);
1398 struct da7213_platform_data *pdata = da7213->pdata; 1397 struct da7213_platform_data *pdata = da7213->pdata;
1399 1398
1400 codec->control_data = da7213->regmap;
1401 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1402 if (ret < 0) {
1403 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1404 return ret;
1405 }
1406
1407 /* Default to using ALC auto offset calibration mode. */ 1399 /* Default to using ALC auto offset calibration mode. */
1408 snd_soc_update_bits(codec, DA7213_ALC_CTRL1, 1400 snd_soc_update_bits(codec, DA7213_ALC_CTRL1,
1409 DA7213_ALC_CALIB_MODE_MAN, 0); 1401 DA7213_ALC_CALIB_MODE_MAN, 0);
diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
index 4d1c302f5a76..7d168ec71cd7 100644
--- a/sound/soc/codecs/da732x.c
+++ b/sound/soc/codecs/da732x.c
@@ -1297,9 +1297,9 @@ static void da732x_dac_offset_adjust(struct snd_soc_codec *codec)
1297 msleep(DA732X_WAIT_FOR_STABILIZATION); 1297 msleep(DA732X_WAIT_FOR_STABILIZATION);
1298 1298
1299 /* Check DAC offset sign */ 1299 /* Check DAC offset sign */
1300 sign[DA732X_HPL_DAC] = (codec->hw_read(codec, DA732X_REG_HPL_DAC_OFF_CNTL) & 1300 sign[DA732X_HPL_DAC] = (snd_soc_read(codec, DA732X_REG_HPL_DAC_OFF_CNTL) &
1301 DA732X_HP_DAC_OFF_CNTL_COMPO); 1301 DA732X_HP_DAC_OFF_CNTL_COMPO);
1302 sign[DA732X_HPR_DAC] = (codec->hw_read(codec, DA732X_REG_HPR_DAC_OFF_CNTL) & 1302 sign[DA732X_HPR_DAC] = (snd_soc_read(codec, DA732X_REG_HPR_DAC_OFF_CNTL) &
1303 DA732X_HP_DAC_OFF_CNTL_COMPO); 1303 DA732X_HP_DAC_OFF_CNTL_COMPO);
1304 1304
1305 /* Binary search DAC offset values (both channels at once) */ 1305 /* Binary search DAC offset values (both channels at once) */
@@ -1316,10 +1316,10 @@ static void da732x_dac_offset_adjust(struct snd_soc_codec *codec)
1316 1316
1317 msleep(DA732X_WAIT_FOR_STABILIZATION); 1317 msleep(DA732X_WAIT_FOR_STABILIZATION);
1318 1318
1319 if ((codec->hw_read(codec, DA732X_REG_HPL_DAC_OFF_CNTL) & 1319 if ((snd_soc_read(codec, DA732X_REG_HPL_DAC_OFF_CNTL) &
1320 DA732X_HP_DAC_OFF_CNTL_COMPO) ^ sign[DA732X_HPL_DAC]) 1320 DA732X_HP_DAC_OFF_CNTL_COMPO) ^ sign[DA732X_HPL_DAC])
1321 offset[DA732X_HPL_DAC] &= ~step; 1321 offset[DA732X_HPL_DAC] &= ~step;
1322 if ((codec->hw_read(codec, DA732X_REG_HPR_DAC_OFF_CNTL) & 1322 if ((snd_soc_read(codec, DA732X_REG_HPR_DAC_OFF_CNTL) &
1323 DA732X_HP_DAC_OFF_CNTL_COMPO) ^ sign[DA732X_HPR_DAC]) 1323 DA732X_HP_DAC_OFF_CNTL_COMPO) ^ sign[DA732X_HPR_DAC])
1324 offset[DA732X_HPR_DAC] &= ~step; 1324 offset[DA732X_HPR_DAC] &= ~step;
1325 1325
@@ -1360,9 +1360,9 @@ static void da732x_output_offset_adjust(struct snd_soc_codec *codec)
1360 msleep(DA732X_WAIT_FOR_STABILIZATION); 1360 msleep(DA732X_WAIT_FOR_STABILIZATION);
1361 1361
1362 /* Check output offset sign */ 1362 /* Check output offset sign */
1363 sign[DA732X_HPL_AMP] = codec->hw_read(codec, DA732X_REG_HPL) & 1363 sign[DA732X_HPL_AMP] = snd_soc_read(codec, DA732X_REG_HPL) &
1364 DA732X_HP_OUT_COMPO; 1364 DA732X_HP_OUT_COMPO;
1365 sign[DA732X_HPR_AMP] = codec->hw_read(codec, DA732X_REG_HPR) & 1365 sign[DA732X_HPR_AMP] = snd_soc_read(codec, DA732X_REG_HPR) &
1366 DA732X_HP_OUT_COMPO; 1366 DA732X_HP_OUT_COMPO;
1367 1367
1368 snd_soc_write(codec, DA732X_REG_HPL, DA732X_HP_OUT_COMP | 1368 snd_soc_write(codec, DA732X_REG_HPL, DA732X_HP_OUT_COMP |
@@ -1383,10 +1383,10 @@ static void da732x_output_offset_adjust(struct snd_soc_codec *codec)
1383 1383
1384 msleep(DA732X_WAIT_FOR_STABILIZATION); 1384 msleep(DA732X_WAIT_FOR_STABILIZATION);
1385 1385
1386 if ((codec->hw_read(codec, DA732X_REG_HPL) & 1386 if ((snd_soc_read(codec, DA732X_REG_HPL) &
1387 DA732X_HP_OUT_COMPO) ^ sign[DA732X_HPL_AMP]) 1387 DA732X_HP_OUT_COMPO) ^ sign[DA732X_HPL_AMP])
1388 offset[DA732X_HPL_AMP] &= ~step; 1388 offset[DA732X_HPL_AMP] &= ~step;
1389 if ((codec->hw_read(codec, DA732X_REG_HPR) & 1389 if ((snd_soc_read(codec, DA732X_REG_HPR) &
1390 DA732X_HP_OUT_COMPO) ^ sign[DA732X_HPR_AMP]) 1390 DA732X_HP_OUT_COMPO) ^ sign[DA732X_HPR_AMP])
1391 offset[DA732X_HPR_AMP] &= ~step; 1391 offset[DA732X_HPR_AMP] &= ~step;
1392 1392
@@ -1512,23 +1512,14 @@ static int da732x_probe(struct snd_soc_codec *codec)
1512{ 1512{
1513 struct da732x_priv *da732x = snd_soc_codec_get_drvdata(codec); 1513 struct da732x_priv *da732x = snd_soc_codec_get_drvdata(codec);
1514 struct snd_soc_dapm_context *dapm = &codec->dapm; 1514 struct snd_soc_dapm_context *dapm = &codec->dapm;
1515 int ret = 0;
1516 1515
1517 da732x->codec = codec; 1516 da732x->codec = codec;
1518 1517
1519 dapm->idle_bias_off = false; 1518 dapm->idle_bias_off = false;
1520 1519
1521 codec->control_data = da732x->regmap;
1522
1523 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1524 if (ret != 0) {
1525 dev_err(codec->dev, "Failed to register codec.\n");
1526 goto err;
1527 }
1528
1529 da732x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1520 da732x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1530err: 1521
1531 return ret; 1522 return 0;
1532} 1523}
1533 1524
1534static int da732x_remove(struct snd_soc_codec *codec) 1525static int da732x_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c
index f118daa91234..4ff06b50fbba 100644
--- a/sound/soc/codecs/da9055.c
+++ b/sound/soc/codecs/da9055.c
@@ -1383,16 +1383,8 @@ static int da9055_set_bias_level(struct snd_soc_codec *codec,
1383 1383
1384static int da9055_probe(struct snd_soc_codec *codec) 1384static int da9055_probe(struct snd_soc_codec *codec)
1385{ 1385{
1386 int ret;
1387 struct da9055_priv *da9055 = snd_soc_codec_get_drvdata(codec); 1386 struct da9055_priv *da9055 = snd_soc_codec_get_drvdata(codec);
1388 1387
1389 codec->control_data = da9055->regmap;
1390 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1391 if (ret < 0) {
1392 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1393 return ret;
1394 }
1395
1396 /* Enable all Gain Ramps */ 1388 /* Enable all Gain Ramps */
1397 snd_soc_update_bits(codec, DA9055_AUX_L_CTRL, 1389 snd_soc_update_bits(codec, DA9055_AUX_L_CTRL,
1398 DA9055_GAIN_RAMPING_EN, DA9055_GAIN_RAMPING_EN); 1390 DA9055_GAIN_RAMPING_EN, DA9055_GAIN_RAMPING_EN);
diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c
index cb736ddc446d..3e264a78017a 100644
--- a/sound/soc/codecs/isabelle.c
+++ b/sound/soc/codecs/isabelle.c
@@ -1090,23 +1090,7 @@ static struct snd_soc_dai_driver isabelle_dai[] = {
1090 }, 1090 },
1091}; 1091};
1092 1092
1093static int isabelle_probe(struct snd_soc_codec *codec)
1094{
1095 int ret = 0;
1096
1097 codec->control_data = dev_get_regmap(codec->dev, NULL);
1098
1099 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1100 if (ret < 0) {
1101 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1102 return ret;
1103 }
1104
1105 return 0;
1106}
1107
1108static struct snd_soc_codec_driver soc_codec_dev_isabelle = { 1093static struct snd_soc_codec_driver soc_codec_dev_isabelle = {
1109 .probe = isabelle_probe,
1110 .set_bias_level = isabelle_set_bias_level, 1094 .set_bias_level = isabelle_set_bias_level,
1111 .controls = isabelle_snd_controls, 1095 .controls = isabelle_snd_controls,
1112 .num_controls = ARRAY_SIZE(isabelle_snd_controls), 1096 .num_controls = ARRAY_SIZE(isabelle_snd_controls),
diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c
index 6b7fe5e54881..d237dd610985 100644
--- a/sound/soc/codecs/lm49453.c
+++ b/sound/soc/codecs/lm49453.c
@@ -1409,22 +1409,6 @@ static int lm49453_resume(struct snd_soc_codec *codec)
1409 return 0; 1409 return 0;
1410} 1410}
1411 1411
1412static int lm49453_probe(struct snd_soc_codec *codec)
1413{
1414 struct lm49453_priv *lm49453 = snd_soc_codec_get_drvdata(codec);
1415 int ret = 0;
1416
1417 codec->control_data = lm49453->regmap;
1418
1419 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1420 if (ret < 0) {
1421 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1422 return ret;
1423 }
1424
1425 return 0;
1426}
1427
1428/* power down chip */ 1412/* power down chip */
1429static int lm49453_remove(struct snd_soc_codec *codec) 1413static int lm49453_remove(struct snd_soc_codec *codec)
1430{ 1414{
@@ -1433,7 +1417,6 @@ static int lm49453_remove(struct snd_soc_codec *codec)
1433} 1417}
1434 1418
1435static struct snd_soc_codec_driver soc_codec_dev_lm49453 = { 1419static struct snd_soc_codec_driver soc_codec_dev_lm49453 = {
1436 .probe = lm49453_probe,
1437 .remove = lm49453_remove, 1420 .remove = lm49453_remove,
1438 .suspend = lm49453_suspend, 1421 .suspend = lm49453_suspend,
1439 .resume = lm49453_resume, 1422 .resume = lm49453_resume,
diff --git a/sound/soc/codecs/max9768.c b/sound/soc/codecs/max9768.c
index 31f91560e9f6..ec481fc428c7 100644
--- a/sound/soc/codecs/max9768.c
+++ b/sound/soc/codecs/max9768.c
@@ -135,11 +135,6 @@ static int max9768_probe(struct snd_soc_codec *codec)
135 struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec); 135 struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec);
136 int ret; 136 int ret;
137 137
138 codec->control_data = max9768->regmap;
139 ret = snd_soc_codec_set_cache_io(codec, 2, 6, SND_SOC_REGMAP);
140 if (ret)
141 return ret;
142
143 if (max9768->flags & MAX9768_FLAG_CLASSIC_PWM) { 138 if (max9768->flags & MAX9768_FLAG_CLASSIC_PWM) {
144 ret = snd_soc_write(codec, MAX9768_CTRL, MAX9768_CTRL_PWM); 139 ret = snd_soc_write(codec, MAX9768_CTRL, MAX9768_CTRL_PWM);
145 if (ret) 140 if (ret)
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index bb1ecfc4459b..d489b2d10eca 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -1915,12 +1915,6 @@ static int max98088_probe(struct snd_soc_codec *codec)
1915 1915
1916 regcache_mark_dirty(max98088->regmap); 1916 regcache_mark_dirty(max98088->regmap);
1917 1917
1918 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1919 if (ret != 0) {
1920 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1921 return ret;
1922 }
1923
1924 /* initialize private data */ 1918 /* initialize private data */
1925 1919
1926 max98088->sysclk = (unsigned)-1; 1920 max98088->sysclk = (unsigned)-1;
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index f363de19be07..96a47459b3d7 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2218,14 +2218,6 @@ static int max98090_probe(struct snd_soc_codec *codec)
2218 2218
2219 max98090->codec = codec; 2219 max98090->codec = codec;
2220 2220
2221 codec->control_data = max98090->regmap;
2222
2223 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
2224 if (ret != 0) {
2225 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
2226 return ret;
2227 }
2228
2229 /* Reset the codec, the DSP core, and disable all interrupts */ 2221 /* Reset the codec, the DSP core, and disable all interrupts */
2230 max98090_reset(max98090); 2222 max98090_reset(max98090);
2231 2223
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 5bce9cde4a6d..a1b9834d57bb 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -2234,12 +2234,6 @@ static int max98095_probe(struct snd_soc_codec *codec)
2234 struct i2c_client *client; 2234 struct i2c_client *client;
2235 int ret = 0; 2235 int ret = 0;
2236 2236
2237 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
2238 if (ret != 0) {
2239 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
2240 return ret;
2241 }
2242
2243 /* reset the codec, the DSP core, and disable all interrupts */ 2237 /* reset the codec, the DSP core, and disable all interrupts */
2244 max98095_reset(codec); 2238 max98095_reset(codec);
2245 2239
diff --git a/sound/soc/codecs/max9850.c b/sound/soc/codecs/max9850.c
index 82757ebf0301..4fdf5aaa236f 100644
--- a/sound/soc/codecs/max9850.c
+++ b/sound/soc/codecs/max9850.c
@@ -312,14 +312,6 @@ static int max9850_resume(struct snd_soc_codec *codec)
312 312
313static int max9850_probe(struct snd_soc_codec *codec) 313static int max9850_probe(struct snd_soc_codec *codec)
314{ 314{
315 int ret;
316
317 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
318 if (ret < 0) {
319 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
320 return ret;
321 }
322
323 /* enable zero-detect */ 315 /* enable zero-detect */
324 snd_soc_update_bits(codec, MAX9850_GENERAL_PURPOSE, 1, 1); 316 snd_soc_update_bits(codec, MAX9850_GENERAL_PURPOSE, 1, 1);
325 /* enable slew-rate control */ 317 /* enable slew-rate control */
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index ec89b8f90a64..37d737e567a1 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -612,8 +612,8 @@ static int mc13783_probe(struct snd_soc_codec *codec)
612 struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec); 612 struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec);
613 int ret; 613 int ret;
614 614
615 codec->control_data = dev_get_regmap(codec->dev->parent, NULL); 615 ret = snd_soc_codec_set_cache_io(codec,
616 ret = snd_soc_codec_set_cache_io(codec, 8, 24, SND_SOC_REGMAP); 616 dev_get_regmap(codec->dev->parent, NULL));
617 if (ret != 0) { 617 if (ret != 0) {
618 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); 618 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
619 return ret; 619 return ret;
diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c
index 577fb8776ce7..e661e8420e3d 100644
--- a/sound/soc/codecs/ml26124.c
+++ b/sound/soc/codecs/ml26124.c
@@ -586,16 +586,6 @@ static int ml26124_resume(struct snd_soc_codec *codec)
586 586
587static int ml26124_probe(struct snd_soc_codec *codec) 587static int ml26124_probe(struct snd_soc_codec *codec)
588{ 588{
589 int ret;
590 struct ml26124_priv *priv = snd_soc_codec_get_drvdata(codec);
591 codec->control_data = priv->regmap;
592
593 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
594 if (ret < 0) {
595 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
596 return ret;
597 }
598
599 /* Software Reset */ 589 /* Software Reset */
600 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 1); 590 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 1);
601 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 0); 591 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 0);
diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
index ce199d375209..d4c229f0233f 100644
--- a/sound/soc/codecs/rt5631.c
+++ b/sound/soc/codecs/rt5631.c
@@ -1570,15 +1570,6 @@ static int rt5631_probe(struct snd_soc_codec *codec)
1570{ 1570{
1571 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec); 1571 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
1572 unsigned int val; 1572 unsigned int val;
1573 int ret;
1574
1575 codec->control_data = rt5631->regmap;
1576
1577 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1578 if (ret != 0) {
1579 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1580 return ret;
1581 }
1582 1573
1583 val = rt5631_read_index(codec, RT5631_ADDA_MIXER_INTL_REG3); 1574 val = rt5631_read_index(codec, RT5631_ADDA_MIXER_INTL_REG3);
1584 if (val & 0x0002) 1575 if (val & 0x0002)
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 1a1e1150237d..13ccee43cfc5 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -1936,16 +1936,8 @@ static int rt5640_set_bias_level(struct snd_soc_codec *codec,
1936static int rt5640_probe(struct snd_soc_codec *codec) 1936static int rt5640_probe(struct snd_soc_codec *codec)
1937{ 1937{
1938 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); 1938 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
1939 int ret;
1940 1939
1941 rt5640->codec = codec; 1940 rt5640->codec = codec;
1942 codec->control_data = rt5640->regmap;
1943
1944 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1945 if (ret != 0) {
1946 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1947 return ret;
1948 }
1949 1941
1950 codec->dapm.idle_bias_off = 1; 1942 codec->dapm.idle_bias_off = 1;
1951 rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF); 1943 rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF);
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index ab4754a7a88c..d3ed1be5a186 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1352,14 +1352,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
1352 int ret; 1352 int ret;
1353 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); 1353 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
1354 1354
1355 /* setup i2c data ops */
1356 codec->control_data = sgtl5000->regmap;
1357 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
1358 if (ret < 0) {
1359 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1360 return ret;
1361 }
1362
1363 ret = sgtl5000_enable_regulators(codec); 1355 ret = sgtl5000_enable_regulators(codec);
1364 if (ret) 1356 if (ret)
1365 return ret; 1357 return ret;
diff --git a/sound/soc/codecs/si476x.c b/sound/soc/codecs/si476x.c
index fa2b8e07f420..244c097cd905 100644
--- a/sound/soc/codecs/si476x.c
+++ b/sound/soc/codecs/si476x.c
@@ -21,6 +21,7 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <sound/pcm.h> 22#include <sound/pcm.h>
23#include <sound/pcm_params.h> 23#include <sound/pcm_params.h>
24#include <linux/regmap.h>
24#include <sound/soc.h> 25#include <sound/soc.h>
25#include <sound/initval.h> 26#include <sound/initval.h>
26 27
@@ -209,8 +210,9 @@ out:
209 210
210static int si476x_codec_probe(struct snd_soc_codec *codec) 211static int si476x_codec_probe(struct snd_soc_codec *codec)
211{ 212{
212 codec->control_data = dev_get_regmap(codec->dev->parent, NULL); 213 struct regmap *regmap = dev_get_regmap(codec->dev->parent, NULL);
213 return snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP); 214
215 return snd_soc_codec_set_cache_io(codec, regmap);
214} 216}
215 217
216static struct snd_soc_dai_ops si476x_dai_ops = { 218static struct snd_soc_dai_ops si476x_dai_ops = {
diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c
index bca7d02b362a..42dff26b3a2a 100644
--- a/sound/soc/codecs/sn95031.c
+++ b/sound/soc/codecs/sn95031.c
@@ -825,8 +825,6 @@ static int sn95031_codec_probe(struct snd_soc_codec *codec)
825{ 825{
826 pr_debug("codec_probe called\n"); 826 pr_debug("codec_probe called\n");
827 827
828 snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
829
830 /* PCM interface config 828 /* PCM interface config
831 * This sets the pcm rx slot conguration to max 6 slots 829 * This sets the pcm rx slot conguration to max 6 slots
832 * for max 4 dais (2 stereo and 2 mono) 830 * for max 4 dais (2 stereo and 2 mono)
diff --git a/sound/soc/codecs/ssm2518.c b/sound/soc/codecs/ssm2518.c
index 806f3d826ffb..56adb3e2def9 100644
--- a/sound/soc/codecs/ssm2518.c
+++ b/sound/soc/codecs/ssm2518.c
@@ -648,16 +648,6 @@ static struct snd_soc_dai_driver ssm2518_dai = {
648 648
649static int ssm2518_probe(struct snd_soc_codec *codec) 649static int ssm2518_probe(struct snd_soc_codec *codec)
650{ 650{
651 struct ssm2518 *ssm2518 = snd_soc_codec_get_drvdata(codec);
652 int ret;
653
654 codec->control_data = ssm2518->regmap;
655 ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
656 if (ret < 0) {
657 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
658 return ret;
659 }
660
661 return ssm2518_set_bias_level(codec, SND_SOC_BIAS_OFF); 651 return ssm2518_set_bias_level(codec, SND_SOC_BIAS_OFF);
662} 652}
663 653
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index 12947096897c..97b0454eb346 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -562,13 +562,6 @@ static int ssm260x_codec_probe(struct snd_soc_codec *codec)
562 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); 562 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
563 int ret; 563 int ret;
564 564
565 codec->control_data = ssm2602->regmap;
566 ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
567 if (ret < 0) {
568 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
569 return ret;
570 }
571
572 ret = regmap_write(ssm2602->regmap, SSM2602_RESET, 0); 565 ret = regmap_write(ssm2602->regmap, SSM2602_RESET, 0);
573 if (ret < 0) { 566 if (ret < 0) {
574 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); 567 dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 2735361a4c3c..12577749b17b 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -872,16 +872,6 @@ static int sta32x_probe(struct snd_soc_codec *codec)
872 return ret; 872 return ret;
873 } 873 }
874 874
875 /* Tell ASoC what kind of I/O to use to read the registers. ASoC will
876 * then do the I2C transactions itself.
877 */
878 codec->control_data = sta32x->regmap;
879 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
880 if (ret < 0) {
881 dev_err(codec->dev, "failed to set cache I/O (ret=%i)\n", ret);
882 goto err;
883 }
884
885 /* Chip documentation explicitly requires that the reset values 875 /* Chip documentation explicitly requires that the reset values
886 * of reserved register bits are left untouched. 876 * of reserved register bits are left untouched.
887 * Write the register default value to cache for reserved registers, 877 * Write the register default value to cache for reserved registers,
@@ -946,10 +936,6 @@ static int sta32x_probe(struct snd_soc_codec *codec)
946 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); 936 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
947 937
948 return 0; 938 return 0;
949
950err:
951 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
952 return ret;
953} 939}
954 940
955static int sta32x_remove(struct snd_soc_codec *codec) 941static int sta32x_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c
index f15b0e37274c..a3c61d308bb0 100644
--- a/sound/soc/codecs/sta529.c
+++ b/sound/soc/codecs/sta529.c
@@ -322,16 +322,6 @@ static struct snd_soc_dai_driver sta529_dai = {
322 322
323static int sta529_probe(struct snd_soc_codec *codec) 323static int sta529_probe(struct snd_soc_codec *codec)
324{ 324{
325 struct sta529 *sta529 = snd_soc_codec_get_drvdata(codec);
326 int ret;
327
328 codec->control_data = sta529->regmap;
329 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
330
331 if (ret < 0) {
332 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
333 return ret;
334 }
335 sta529_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 325 sta529_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
336 326
337 return 0; 327 return 0;
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index dc9a52fcb39a..20864ee8793b 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -559,14 +559,6 @@ static int tlv320aic23_resume(struct snd_soc_codec *codec)
559 559
560static int tlv320aic23_codec_probe(struct snd_soc_codec *codec) 560static int tlv320aic23_codec_probe(struct snd_soc_codec *codec)
561{ 561{
562 int ret;
563
564 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
565 if (ret < 0) {
566 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
567 return ret;
568 }
569
570 /* Reset codec */ 562 /* Reset codec */
571 snd_soc_write(codec, TLV320AIC23_RESET, 0); 563 snd_soc_write(codec, TLV320AIC23_RESET, 0);
572 564
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c
index ff5f23d482b7..43069de3d56a 100644
--- a/sound/soc/codecs/tlv320aic26.c
+++ b/sound/soc/codecs/tlv320aic26.c
@@ -296,8 +296,6 @@ static int aic26_probe(struct snd_soc_codec *codec)
296 struct aic26 *aic26 = dev_get_drvdata(codec->dev); 296 struct aic26 *aic26 = dev_get_drvdata(codec->dev);
297 int ret, reg; 297 int ret, reg;
298 298
299 snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
300
301 aic26->codec = codec; 299 aic26->codec = codec;
302 300
303 /* Reset the codec to power on defaults */ 301 /* Reset the codec to power on defaults */
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index c6bd7e75352d..1d9b117345a3 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -614,8 +614,6 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
614 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); 614 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
615 u32 tmp_reg; 615 u32 tmp_reg;
616 616
617 snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
618
619 if (gpio_is_valid(aic32x4->rstn_gpio)) { 617 if (gpio_is_valid(aic32x4->rstn_gpio)) {
620 ndelay(10); 618 ndelay(10);
621 gpio_set_value(aic32x4->rstn_gpio, 1); 619 gpio_set_value(aic32x4->rstn_gpio, 1);
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 470fbfb4b386..b1835103e9b4 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1344,12 +1344,6 @@ static int aic3x_probe(struct snd_soc_codec *codec)
1344 INIT_LIST_HEAD(&aic3x->list); 1344 INIT_LIST_HEAD(&aic3x->list);
1345 aic3x->codec = codec; 1345 aic3x->codec = codec;
1346 1346
1347 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1348 if (ret != 0) {
1349 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1350 return ret;
1351 }
1352
1353 for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) { 1347 for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) {
1354 aic3x->disable_nb[i].nb.notifier_call = aic3x_regulator_event; 1348 aic3x->disable_nb[i].nb.notifier_call = aic3x_regulator_event;
1355 aic3x->disable_nb[i].aic3x = aic3x; 1349 aic3x->disable_nb[i].aic3x = aic3x;
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 793516146670..6bfc8a17331b 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -122,7 +122,6 @@ struct tlv320dac33_priv {
122 unsigned int uthr; 122 unsigned int uthr;
123 123
124 enum dac33_state state; 124 enum dac33_state state;
125 enum snd_soc_control_type control_type;
126 void *control_data; 125 void *control_data;
127}; 126};
128 127
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 8ae50274ea8f..83a2c872925c 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -786,8 +786,6 @@ static int wm2000_probe(struct snd_soc_codec *codec)
786{ 786{
787 struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); 787 struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
788 788
789 snd_soc_codec_set_cache_io(codec, 16, 8, SND_SOC_REGMAP);
790
791 /* This will trigger a transition to standby mode by default */ 789 /* This will trigger a transition to standby mode by default */
792 wm2000_anc_set_mode(wm2000); 790 wm2000_anc_set_mode(wm2000);
793 791
diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c
index 1e0a083d8345..2e721e06671b 100644
--- a/sound/soc/codecs/wm2200.c
+++ b/sound/soc/codecs/wm2200.c
@@ -1554,15 +1554,8 @@ static int wm2200_probe(struct snd_soc_codec *codec)
1554 int ret; 1554 int ret;
1555 1555
1556 wm2200->codec = codec; 1556 wm2200->codec = codec;
1557 codec->control_data = wm2200->regmap;
1558 codec->dapm.bias_level = SND_SOC_BIAS_OFF; 1557 codec->dapm.bias_level = SND_SOC_BIAS_OFF;
1559 1558
1560 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
1561 if (ret != 0) {
1562 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1563 return ret;
1564 }
1565
1566 ret = snd_soc_add_codec_controls(codec, wm_adsp1_fw_controls, 2); 1559 ret = snd_soc_add_codec_controls(codec, wm_adsp1_fw_controls, 2);
1567 if (ret != 0) 1560 if (ret != 0)
1568 return ret; 1561 return ret;
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index d3fa65fd9e85..eca983fad891 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -2343,13 +2343,6 @@ static int wm5100_probe(struct snd_soc_codec *codec)
2343 int ret, i; 2343 int ret, i;
2344 2344
2345 wm5100->codec = codec; 2345 wm5100->codec = codec;
2346 codec->control_data = wm5100->regmap;
2347
2348 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
2349 if (ret != 0) {
2350 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
2351 return ret;
2352 }
2353 2346
2354 for (i = 0; i < ARRAY_SIZE(wm5100_dig_vu); i++) 2347 for (i = 0; i < ARRAY_SIZE(wm5100_dig_vu); i++)
2355 snd_soc_update_bits(codec, wm5100_dig_vu[i], WM5100_OUT_VU, 2348 snd_soc_update_bits(codec, wm5100_dig_vu[i], WM5100_OUT_VU,
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 34109050ceed..dcf1d12cfef8 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -1760,9 +1760,7 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec)
1760 struct wm5102_priv *priv = snd_soc_codec_get_drvdata(codec); 1760 struct wm5102_priv *priv = snd_soc_codec_get_drvdata(codec);
1761 int ret; 1761 int ret;
1762 1762
1763 codec->control_data = priv->core.arizona->regmap; 1763 ret = snd_soc_codec_set_cache_io(codec, priv->core.arizona->regmap);
1764
1765 ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
1766 if (ret != 0) 1764 if (ret != 0)
1767 return ret; 1765 return ret;
1768 1766
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index d7bf8848174a..df5a38dd8328 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -1587,10 +1587,9 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec)
1587 struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); 1587 struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);
1588 int ret; 1588 int ret;
1589 1589
1590 codec->control_data = priv->core.arizona->regmap;
1591 priv->core.arizona->dapm = &codec->dapm; 1590 priv->core.arizona->dapm = &codec->dapm;
1592 1591
1593 ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP); 1592 ret = snd_soc_codec_set_cache_io(codec, priv->core.arizona->regmap);
1594 if (ret != 0) 1593 if (ret != 0)
1595 return ret; 1594 return ret;
1596 1595
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index a183dcf3d5c1..757256bf7672 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -1505,9 +1505,7 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
1505 if (ret != 0) 1505 if (ret != 0)
1506 return ret; 1506 return ret;
1507 1507
1508 codec->control_data = wm8350->regmap; 1508 snd_soc_codec_set_cache_io(codec, wm8350->regmap);
1509
1510 snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1511 1509
1512 /* Put the codec into reset if it wasn't already */ 1510 /* Put the codec into reset if it wasn't already */
1513 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); 1511 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 6d684d934f4d..146564feaea0 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -1316,10 +1316,9 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
1316 1316
1317 snd_soc_codec_set_drvdata(codec, priv); 1317 snd_soc_codec_set_drvdata(codec, priv);
1318 priv->wm8400 = wm8400; 1318 priv->wm8400 = wm8400;
1319 codec->control_data = wm8400->regmap;
1320 priv->codec = codec; 1319 priv->codec = codec;
1321 1320
1322 snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP); 1321 snd_soc_codec_set_cache_io(codec, wm8400->regmap);
1323 1322
1324 ret = devm_regulator_bulk_get(wm8400->dev, 1323 ret = devm_regulator_bulk_get(wm8400->dev,
1325 ARRAY_SIZE(power), &power[0]); 1324 ARRAY_SIZE(power), &power[0]);
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c
index 7df7d4572755..1c1e328feeb8 100644
--- a/sound/soc/codecs/wm8510.c
+++ b/sound/soc/codecs/wm8510.c
@@ -589,20 +589,12 @@ static int wm8510_resume(struct snd_soc_codec *codec)
589 589
590static int wm8510_probe(struct snd_soc_codec *codec) 590static int wm8510_probe(struct snd_soc_codec *codec)
591{ 591{
592 int ret;
593
594 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
595 if (ret < 0) {
596 printk(KERN_ERR "wm8510: failed to set cache I/O: %d\n", ret);
597 return ret;
598 }
599
600 wm8510_reset(codec); 592 wm8510_reset(codec);
601 593
602 /* power on device */ 594 /* power on device */
603 wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 595 wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
604 596
605 return ret; 597 return 0;
606} 598}
607 599
608/* power down chip */ 600/* power down chip */
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c
index 5dfd571b1a03..601ee8178af1 100644
--- a/sound/soc/codecs/wm8523.c
+++ b/sound/soc/codecs/wm8523.c
@@ -392,18 +392,11 @@ static int wm8523_resume(struct snd_soc_codec *codec)
392static int wm8523_probe(struct snd_soc_codec *codec) 392static int wm8523_probe(struct snd_soc_codec *codec)
393{ 393{
394 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec); 394 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
395 int ret;
396 395
397 wm8523->rate_constraint.list = &wm8523->rate_constraint_list[0]; 396 wm8523->rate_constraint.list = &wm8523->rate_constraint_list[0];
398 wm8523->rate_constraint.count = 397 wm8523->rate_constraint.count =
399 ARRAY_SIZE(wm8523->rate_constraint_list); 398 ARRAY_SIZE(wm8523->rate_constraint_list);
400 399
401 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
402 if (ret != 0) {
403 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
404 return ret;
405 }
406
407 /* Change some default settings - latch VU and enable ZC */ 400 /* Change some default settings - latch VU and enable ZC */
408 snd_soc_update_bits(codec, WM8523_DAC_GAINR, 401 snd_soc_update_bits(codec, WM8523_DAC_GAINR,
409 WM8523_DACR_VU, WM8523_DACR_VU); 402 WM8523_DACR_VU, WM8523_DACR_VU);
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 318989acbbe5..7558c838193d 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -869,12 +869,6 @@ static int wm8580_probe(struct snd_soc_codec *codec)
869 struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); 869 struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
870 int ret = 0; 870 int ret = 0;
871 871
872 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
873 if (ret < 0) {
874 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
875 return ret;
876 }
877
878 ret = regulator_bulk_enable(ARRAY_SIZE(wm8580->supplies), 872 ret = regulator_bulk_enable(ARRAY_SIZE(wm8580->supplies),
879 wm8580->supplies); 873 wm8580->supplies);
880 if (ret != 0) { 874 if (ret != 0) {
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c
index 6efcc40a7cb3..b0fbcb377baf 100644
--- a/sound/soc/codecs/wm8711.c
+++ b/sound/soc/codecs/wm8711.c
@@ -367,12 +367,6 @@ static int wm8711_probe(struct snd_soc_codec *codec)
367{ 367{
368 int ret; 368 int ret;
369 369
370 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
371 if (ret < 0) {
372 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
373 return ret;
374 }
375
376 ret = wm8711_reset(codec); 370 ret = wm8711_reset(codec);
377 if (ret < 0) { 371 if (ret < 0) {
378 dev_err(codec->dev, "Failed to issue reset\n"); 372 dev_err(codec->dev, "Failed to issue reset\n");
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c
index cd89033e84c0..bac7fc28fe71 100644
--- a/sound/soc/codecs/wm8728.c
+++ b/sound/soc/codecs/wm8728.c
@@ -228,19 +228,10 @@ static int wm8728_resume(struct snd_soc_codec *codec)
228 228
229static int wm8728_probe(struct snd_soc_codec *codec) 229static int wm8728_probe(struct snd_soc_codec *codec)
230{ 230{
231 int ret;
232
233 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
234 if (ret < 0) {
235 printk(KERN_ERR "wm8728: failed to configure cache I/O: %d\n",
236 ret);
237 return ret;
238 }
239
240 /* power on device */ 231 /* power on device */
241 wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 232 wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
242 233
243 return ret; 234 return 0;
244} 235}
245 236
246static int wm8728_remove(struct snd_soc_codec *codec) 237static int wm8728_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index d9655f981df1..d74f43975b90 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -583,13 +583,6 @@ static int wm8731_probe(struct snd_soc_codec *codec)
583 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); 583 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
584 int ret = 0, i; 584 int ret = 0, i;
585 585
586 codec->control_data = wm8731->regmap;
587 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
588 if (ret < 0) {
589 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
590 return ret;
591 }
592
593 for (i = 0; i < ARRAY_SIZE(wm8731->supplies); i++) 586 for (i = 0; i < ARRAY_SIZE(wm8731->supplies); i++)
594 wm8731->supplies[i].supply = wm8731_supply_names[i]; 587 wm8731->supplies[i].supply = wm8731_supply_names[i];
595 588
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c
index ecc4e8725d5b..b27f26cdc049 100644
--- a/sound/soc/codecs/wm8737.c
+++ b/sound/soc/codecs/wm8737.c
@@ -570,12 +570,6 @@ static int wm8737_probe(struct snd_soc_codec *codec)
570 struct wm8737_priv *wm8737 = snd_soc_codec_get_drvdata(codec); 570 struct wm8737_priv *wm8737 = snd_soc_codec_get_drvdata(codec);
571 int ret; 571 int ret;
572 572
573 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
574 if (ret != 0) {
575 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
576 return ret;
577 }
578
579 ret = regulator_bulk_enable(ARRAY_SIZE(wm8737->supplies), 573 ret = regulator_bulk_enable(ARRAY_SIZE(wm8737->supplies),
580 wm8737->supplies); 574 wm8737->supplies);
581 if (ret != 0) { 575 if (ret != 0) {
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index dd02ebf88015..b33542a04607 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -429,12 +429,6 @@ static int wm8741_probe(struct snd_soc_codec *codec)
429 goto err_get; 429 goto err_get;
430 } 430 }
431 431
432 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
433 if (ret != 0) {
434 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
435 goto err_enable;
436 }
437
438 ret = wm8741_reset(codec); 432 ret = wm8741_reset(codec);
439 if (ret < 0) { 433 if (ret < 0) {
440 dev_err(codec->dev, "Failed to issue reset\n"); 434 dev_err(codec->dev, "Failed to issue reset\n");
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index 78616a638a55..33990b63d214 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -702,12 +702,6 @@ static int wm8750_probe(struct snd_soc_codec *codec)
702{ 702{
703 int ret; 703 int ret;
704 704
705 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
706 if (ret < 0) {
707 printk(KERN_ERR "wm8750: failed to set cache I/O: %d\n", ret);
708 return ret;
709 }
710
711 ret = wm8750_reset(codec); 705 ret = wm8750_reset(codec);
712 if (ret < 0) { 706 if (ret < 0) {
713 printk(KERN_ERR "wm8750: failed to reset: %d\n", ret); 707 printk(KERN_ERR "wm8750: failed to reset: %d\n", ret);
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 6a6855d8b8ea..cbb8d55052a4 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1470,13 +1470,6 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1470 1470
1471 INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8753_work); 1471 INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8753_work);
1472 1472
1473 codec->control_data = wm8753->regmap;
1474 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
1475 if (ret < 0) {
1476 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1477 return ret;
1478 }
1479
1480 ret = wm8753_reset(codec); 1473 ret = wm8753_reset(codec);
1481 if (ret < 0) { 1474 if (ret < 0) {
1482 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); 1475 dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c
index 5bce21013485..c61aeb38efb8 100644
--- a/sound/soc/codecs/wm8770.c
+++ b/sound/soc/codecs/wm8770.c
@@ -580,12 +580,6 @@ static int wm8770_probe(struct snd_soc_codec *codec)
580 wm8770 = snd_soc_codec_get_drvdata(codec); 580 wm8770 = snd_soc_codec_get_drvdata(codec);
581 wm8770->codec = codec; 581 wm8770->codec = codec;
582 582
583 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
584 if (ret < 0) {
585 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
586 return ret;
587 }
588
589 ret = regulator_bulk_enable(ARRAY_SIZE(wm8770->supplies), 583 ret = regulator_bulk_enable(ARRAY_SIZE(wm8770->supplies),
590 wm8770->supplies); 584 wm8770->supplies);
591 if (ret) { 585 if (ret) {
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c
index ef8246725232..70952ceb278b 100644
--- a/sound/soc/codecs/wm8776.c
+++ b/sound/soc/codecs/wm8776.c
@@ -430,12 +430,6 @@ static int wm8776_probe(struct snd_soc_codec *codec)
430{ 430{
431 int ret = 0; 431 int ret = 0;
432 432
433 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
434 if (ret < 0) {
435 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
436 return ret;
437 }
438
439 ret = wm8776_reset(codec); 433 ret = wm8776_reset(codec);
440 if (ret < 0) { 434 if (ret < 0) {
441 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); 435 dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c
index 72d12bbe1a56..ee76f0fb4299 100644
--- a/sound/soc/codecs/wm8804.c
+++ b/sound/soc/codecs/wm8804.c
@@ -546,14 +546,6 @@ static int wm8804_probe(struct snd_soc_codec *codec)
546 546
547 wm8804 = snd_soc_codec_get_drvdata(codec); 547 wm8804 = snd_soc_codec_get_drvdata(codec);
548 548
549 codec->control_data = wm8804->regmap;
550
551 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
552 if (ret < 0) {
553 dev_err(codec->dev, "Failed to set cache i/o: %d\n", ret);
554 return ret;
555 }
556
557 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) 549 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++)
558 wm8804->supplies[i].supply = wm8804_supply_names[i]; 550 wm8804->supplies[i].supply = wm8804_supply_names[i];
559 551
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c
index 43c2201cb901..d09fdce57f5a 100644
--- a/sound/soc/codecs/wm8900.c
+++ b/sound/soc/codecs/wm8900.c
@@ -1178,13 +1178,7 @@ static int wm8900_resume(struct snd_soc_codec *codec)
1178 1178
1179static int wm8900_probe(struct snd_soc_codec *codec) 1179static int wm8900_probe(struct snd_soc_codec *codec)
1180{ 1180{
1181 int ret = 0, reg; 1181 int reg;
1182
1183 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1184 if (ret != 0) {
1185 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1186 return ret;
1187 }
1188 1182
1189 reg = snd_soc_read(codec, WM8900_REG_ID); 1183 reg = snd_soc_read(codec, WM8900_REG_ID);
1190 if (reg != 0x8900) { 1184 if (reg != 0x8900) {
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index b82b70a3b3d3..b0084a127d18 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1897,21 +1897,13 @@ static void wm8903_free_gpio(struct wm8903_priv *wm8903)
1897static int wm8903_probe(struct snd_soc_codec *codec) 1897static int wm8903_probe(struct snd_soc_codec *codec)
1898{ 1898{
1899 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); 1899 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
1900 int ret;
1901 1900
1902 wm8903->codec = codec; 1901 wm8903->codec = codec;
1903 codec->control_data = wm8903->regmap;
1904
1905 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1906 if (ret != 0) {
1907 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1908 return ret;
1909 }
1910 1902
1911 /* power on device */ 1903 /* power on device */
1912 wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1904 wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1913 1905
1914 return ret; 1906 return 0;
1915} 1907}
1916 1908
1917/* power down chip */ 1909/* power down chip */
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 27299cda0e99..49c35c36935e 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -2048,9 +2048,6 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
2048static int wm8904_probe(struct snd_soc_codec *codec) 2048static int wm8904_probe(struct snd_soc_codec *codec)
2049{ 2049{
2050 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 2050 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
2051 int ret;
2052
2053 codec->control_data = wm8904->regmap;
2054 2051
2055 switch (wm8904->devtype) { 2052 switch (wm8904->devtype) {
2056 case WM8904: 2053 case WM8904:
@@ -2064,12 +2061,6 @@ static int wm8904_probe(struct snd_soc_codec *codec)
2064 return -EINVAL; 2061 return -EINVAL;
2065 } 2062 }
2066 2063
2067 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
2068 if (ret != 0) {
2069 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
2070 return ret;
2071 }
2072
2073 wm8904_handle_pdata(codec); 2064 wm8904_handle_pdata(codec);
2074 2065
2075 wm8904_add_widgets(codec); 2066 wm8904_add_widgets(codec);
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index 87f032d0d19f..fc6eec9ad66b 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -712,12 +712,6 @@ static int wm8940_probe(struct snd_soc_codec *codec)
712 int ret; 712 int ret;
713 u16 reg; 713 u16 reg;
714 714
715 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
716 if (ret < 0) {
717 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
718 return ret;
719 }
720
721 ret = wm8940_reset(codec); 715 ret = wm8940_reset(codec);
722 if (ret < 0) { 716 if (ret < 0) {
723 dev_err(codec->dev, "Failed to issue reset\n"); 717 dev_err(codec->dev, "Failed to issue reset\n");
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
index d4dcaecc8a5f..fecd4e4f4c57 100644
--- a/sound/soc/codecs/wm8955.c
+++ b/sound/soc/codecs/wm8955.c
@@ -895,14 +895,6 @@ static int wm8955_probe(struct snd_soc_codec *codec)
895 struct wm8955_pdata *pdata = dev_get_platdata(codec->dev); 895 struct wm8955_pdata *pdata = dev_get_platdata(codec->dev);
896 int ret, i; 896 int ret, i;
897 897
898 codec->control_data = wm8955->regmap;
899
900 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
901 if (ret != 0) {
902 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
903 return ret;
904 }
905
906 for (i = 0; i < ARRAY_SIZE(wm8955->supplies); i++) 898 for (i = 0; i < ARRAY_SIZE(wm8955->supplies); i++)
907 wm8955->supplies[i].supply = wm8955_supply_names[i]; 899 wm8955->supplies[i].supply = wm8955_supply_names[i];
908 900
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index f156010e52bc..d04e9cad445c 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -976,12 +976,6 @@ static int wm8960_probe(struct snd_soc_codec *codec)
976 wm8960->set_bias_level = wm8960_set_bias_level_capless; 976 wm8960->set_bias_level = wm8960_set_bias_level_capless;
977 } 977 }
978 978
979 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
980 if (ret < 0) {
981 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
982 return ret;
983 }
984
985 ret = wm8960_reset(codec); 979 ret = wm8960_reset(codec);
986 if (ret < 0) { 980 if (ret < 0) {
987 dev_err(codec->dev, "Failed to issue reset\n"); 981 dev_err(codec->dev, "Failed to issue reset\n");
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c
index ce8fa6e01cb4..9c88f04442b3 100644
--- a/sound/soc/codecs/wm8961.c
+++ b/sound/soc/codecs/wm8961.c
@@ -836,15 +836,8 @@ static struct snd_soc_dai_driver wm8961_dai = {
836static int wm8961_probe(struct snd_soc_codec *codec) 836static int wm8961_probe(struct snd_soc_codec *codec)
837{ 837{
838 struct snd_soc_dapm_context *dapm = &codec->dapm; 838 struct snd_soc_dapm_context *dapm = &codec->dapm;
839 int ret = 0;
840 u16 reg; 839 u16 reg;
841 840
842 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
843 if (ret != 0) {
844 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
845 return ret;
846 }
847
848 /* Enable class W */ 841 /* Enable class W */
849 reg = snd_soc_read(codec, WM8961_CHARGE_PUMP_B); 842 reg = snd_soc_read(codec, WM8961_CHARGE_PUMP_B);
850 reg |= WM8961_CP_DYN_PWR_MASK; 843 reg |= WM8961_CP_DYN_PWR_MASK;
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 62af9dc59fc5..5522d2566c67 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3424,13 +3424,6 @@ static int wm8962_probe(struct snd_soc_codec *codec)
3424 bool dmicclk, dmicdat; 3424 bool dmicclk, dmicdat;
3425 3425
3426 wm8962->codec = codec; 3426 wm8962->codec = codec;
3427 codec->control_data = wm8962->regmap;
3428
3429 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
3430 if (ret != 0) {
3431 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
3432 return ret;
3433 }
3434 3427
3435 wm8962->disable_nb[0].notifier_call = wm8962_regulator_event_0; 3428 wm8962->disable_nb[0].notifier_call = wm8962_regulator_event_0;
3436 wm8962->disable_nb[1].notifier_call = wm8962_regulator_event_1; 3429 wm8962->disable_nb[1].notifier_call = wm8962_regulator_event_1;
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c
index 67aba78a7ca5..09b7b4200221 100644
--- a/sound/soc/codecs/wm8971.c
+++ b/sound/soc/codecs/wm8971.c
@@ -648,12 +648,6 @@ static int wm8971_probe(struct snd_soc_codec *codec)
648 int ret = 0; 648 int ret = 0;
649 u16 reg; 649 u16 reg;
650 650
651 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
652 if (ret < 0) {
653 printk(KERN_ERR "wm8971: failed to set cache I/O: %d\n", ret);
654 return ret;
655 }
656
657 INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8971_work); 651 INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8971_work);
658 wm8971_workq = create_workqueue("wm8971"); 652 wm8971_workq = create_workqueue("wm8971");
659 if (wm8971_workq == NULL) 653 if (wm8971_workq == NULL)
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c
index 6e16c4306461..0627c56fa44e 100644
--- a/sound/soc/codecs/wm8974.c
+++ b/sound/soc/codecs/wm8974.c
@@ -593,12 +593,6 @@ static int wm8974_probe(struct snd_soc_codec *codec)
593{ 593{
594 int ret = 0; 594 int ret = 0;
595 595
596 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
597 if (ret < 0) {
598 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
599 return ret;
600 }
601
602 ret = wm8974_reset(codec); 596 ret = wm8974_reset(codec);
603 if (ret < 0) { 597 if (ret < 0) {
604 dev_err(codec->dev, "Failed to issue reset\n"); 598 dev_err(codec->dev, "Failed to issue reset\n");
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index a9e2f465c331..28ef46c91f62 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -975,19 +975,13 @@ static const int update_reg[] = {
975static int wm8978_probe(struct snd_soc_codec *codec) 975static int wm8978_probe(struct snd_soc_codec *codec)
976{ 976{
977 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec); 977 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
978 int ret = 0, i; 978 int i;
979 979
980 /* 980 /*
981 * Set default system clock to PLL, it is more precise, this is also the 981 * Set default system clock to PLL, it is more precise, this is also the
982 * default hardware setting 982 * default hardware setting
983 */ 983 */
984 wm8978->sysclk = WM8978_PLL; 984 wm8978->sysclk = WM8978_PLL;
985 codec->control_data = wm8978->regmap;
986 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
987 if (ret < 0) {
988 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
989 return ret;
990 }
991 985
992 /* 986 /*
993 * Set the update bit in all registers, that have one. This way all 987 * Set the update bit in all registers, that have one. This way all
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c
index 58f0551eed2d..2b9bfa53efbf 100644
--- a/sound/soc/codecs/wm8983.c
+++ b/sound/soc/codecs/wm8983.c
@@ -995,12 +995,6 @@ static int wm8983_probe(struct snd_soc_codec *codec)
995 int ret; 995 int ret;
996 int i; 996 int i;
997 997
998 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
999 if (ret < 0) {
1000 dev_err(codec->dev, "Failed to set cache i/o: %d\n", ret);
1001 return ret;
1002 }
1003
1004 ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0); 998 ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);
1005 if (ret < 0) { 999 if (ret < 0) {
1006 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); 1000 dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c
index d786f2b39764..5473dc969585 100644
--- a/sound/soc/codecs/wm8985.c
+++ b/sound/soc/codecs/wm8985.c
@@ -995,13 +995,6 @@ static int wm8985_probe(struct snd_soc_codec *codec)
995 int ret; 995 int ret;
996 996
997 wm8985 = snd_soc_codec_get_drvdata(codec); 997 wm8985 = snd_soc_codec_get_drvdata(codec);
998 codec->control_data = wm8985->regmap;
999
1000 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
1001 if (ret < 0) {
1002 dev_err(codec->dev, "Failed to set cache i/o: %d\n", ret);
1003 return ret;
1004 }
1005 998
1006 for (i = 0; i < ARRAY_SIZE(wm8985->supplies); i++) 999 for (i = 0; i < ARRAY_SIZE(wm8985->supplies); i++)
1007 wm8985->supplies[i].supply = wm8985_supply_names[i]; 1000 wm8985->supplies[i].supply = wm8985_supply_names[i];
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index 0277a76c6bef..3a1ae4f5164d 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -810,16 +810,8 @@ static int wm8988_resume(struct snd_soc_codec *codec)
810 810
811static int wm8988_probe(struct snd_soc_codec *codec) 811static int wm8988_probe(struct snd_soc_codec *codec)
812{ 812{
813 struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
814 int ret = 0; 813 int ret = 0;
815 814
816 codec->control_data = wm8988->regmap;
817 ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
818 if (ret < 0) {
819 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
820 return ret;
821 }
822
823 ret = wm8988_reset(codec); 815 ret = wm8988_reset(codec);
824 if (ret < 0) { 816 if (ret < 0) {
825 dev_err(codec->dev, "Failed to issue reset\n"); 817 dev_err(codec->dev, "Failed to issue reset\n");
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 33f53ab1e7b0..c413c1991453 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -1289,14 +1289,6 @@ static int wm8990_resume(struct snd_soc_codec *codec)
1289 */ 1289 */
1290static int wm8990_probe(struct snd_soc_codec *codec) 1290static int wm8990_probe(struct snd_soc_codec *codec)
1291{ 1291{
1292 int ret;
1293
1294 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1295 if (ret < 0) {
1296 printk(KERN_ERR "wm8990: failed to set cache I/O: %d\n", ret);
1297 return ret;
1298 }
1299
1300 wm8990_reset(codec); 1292 wm8990_reset(codec);
1301 1293
1302 /* charge output caps */ 1294 /* charge output caps */
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 32d219570cca..844cc4a60d66 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -1248,14 +1248,6 @@ static int wm8991_remove(struct snd_soc_codec *codec)
1248 1248
1249static int wm8991_probe(struct snd_soc_codec *codec) 1249static int wm8991_probe(struct snd_soc_codec *codec)
1250{ 1250{
1251 int ret;
1252
1253 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1254 if (ret < 0) {
1255 dev_err(codec->dev, "Failed to set cache i/o: %d\n", ret);
1256 return ret;
1257 }
1258
1259 wm8991_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1251 wm8991_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1260 1252
1261 return 0; 1253 return 0;
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c
index 7b0630a076fa..f825dc04ebe1 100644
--- a/sound/soc/codecs/wm8993.c
+++ b/sound/soc/codecs/wm8993.c
@@ -1493,13 +1493,6 @@ static int wm8993_probe(struct snd_soc_codec *codec)
1493 wm8993->hubs_data.dcs_codes_r = -2; 1493 wm8993->hubs_data.dcs_codes_r = -2;
1494 wm8993->hubs_data.series_startup = 1; 1494 wm8993->hubs_data.series_startup = 1;
1495 1495
1496 codec->control_data = wm8993->regmap;
1497 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1498 if (ret != 0) {
1499 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1500 return ret;
1501 }
1502
1503 /* Latch volume update bits and default ZC on */ 1496 /* Latch volume update bits and default ZC on */
1504 snd_soc_update_bits(codec, WM8993_RIGHT_DAC_DIGITAL_VOLUME, 1497 snd_soc_update_bits(codec, WM8993_RIGHT_DAC_DIGITAL_VOLUME,
1505 WM8993_DAC_VU, WM8993_DAC_VU); 1498 WM8993_DAC_VU, WM8993_DAC_VU);
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 79854cb7feb6..6303537f54c6 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3998,9 +3998,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3998 int ret, i; 3998 int ret, i;
3999 3999
4000 wm8994->hubs.codec = codec; 4000 wm8994->hubs.codec = codec;
4001 codec->control_data = control->regmap;
4002 4001
4003 snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP); 4002 snd_soc_codec_set_cache_io(codec, control->regmap);
4004 4003
4005 mutex_init(&wm8994->accdet_lock); 4004 mutex_init(&wm8994->accdet_lock);
4006 INIT_DELAYED_WORK(&wm8994->jackdet_bootstrap, 4005 INIT_DELAYED_WORK(&wm8994->jackdet_bootstrap,
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c
index ddb197dc1d53..d3152cf5bd56 100644
--- a/sound/soc/codecs/wm8995.c
+++ b/sound/soc/codecs/wm8995.c
@@ -2042,13 +2042,6 @@ static int wm8995_probe(struct snd_soc_codec *codec)
2042 wm8995 = snd_soc_codec_get_drvdata(codec); 2042 wm8995 = snd_soc_codec_get_drvdata(codec);
2043 wm8995->codec = codec; 2043 wm8995->codec = codec;
2044 2044
2045 codec->control_data = wm8995->regmap;
2046 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
2047 if (ret < 0) {
2048 dev_err(codec->dev, "Failed to set cache i/o: %d\n", ret);
2049 return ret;
2050 }
2051
2052 for (i = 0; i < ARRAY_SIZE(wm8995->supplies); i++) 2045 for (i = 0; i < ARRAY_SIZE(wm8995->supplies); i++)
2053 wm8995->supplies[i].supply = wm8995_supply_names[i]; 2046 wm8995->supplies[i].supply = wm8995_supply_names[i];
2054 2047
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index c8244af7d56a..c6cbb3b8ace9 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2633,14 +2633,6 @@ static int wm8996_probe(struct snd_soc_codec *codec)
2633 init_completion(&wm8996->dcs_done); 2633 init_completion(&wm8996->dcs_done);
2634 init_completion(&wm8996->fll_lock); 2634 init_completion(&wm8996->fll_lock);
2635 2635
2636 codec->control_data = wm8996->regmap;
2637
2638 ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
2639 if (ret != 0) {
2640 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
2641 goto err;
2642 }
2643
2644 if (wm8996->pdata.num_retune_mobile_cfgs) 2636 if (wm8996->pdata.num_retune_mobile_cfgs)
2645 wm8996_retune_mobile_pdata(codec); 2637 wm8996_retune_mobile_pdata(codec);
2646 else 2638 else
@@ -2679,13 +2671,11 @@ static int wm8996_probe(struct snd_soc_codec *codec)
2679 } else { 2671 } else {
2680 dev_err(codec->dev, "Failed to request IRQ: %d\n", 2672 dev_err(codec->dev, "Failed to request IRQ: %d\n",
2681 ret); 2673 ret);
2674 return ret;
2682 } 2675 }
2683 } 2676 }
2684 2677
2685 return 0; 2678 return 0;
2686
2687err:
2688 return ret;
2689} 2679}
2690 2680
2691static int wm8996_remove(struct snd_soc_codec *codec) 2681static int wm8996_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index e10f44d7fdb7..004186b6bd48 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1053,9 +1053,7 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec)
1053 struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec); 1053 struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
1054 int ret; 1054 int ret;
1055 1055
1056 codec->control_data = priv->core.arizona->regmap; 1056 ret = snd_soc_codec_set_cache_io(codec, priv->core.arizona->regmap);
1057
1058 ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
1059 if (ret != 0) 1057 if (ret != 0)
1060 return ret; 1058 return ret;
1061 1059
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index 721cee71d5fc..d18eff31fbbc 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -1260,15 +1260,6 @@ static struct snd_soc_dai_driver wm9081_dai = {
1260static int wm9081_probe(struct snd_soc_codec *codec) 1260static int wm9081_probe(struct snd_soc_codec *codec)
1261{ 1261{
1262 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); 1262 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec);
1263 int ret;
1264
1265 codec->control_data = wm9081->regmap;
1266
1267 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
1268 if (ret != 0) {
1269 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
1270 return ret;
1271 }
1272 1263
1273 /* Enable zero cross by default */ 1264 /* Enable zero cross by default */
1274 snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT, 1265 snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT,
@@ -1283,7 +1274,7 @@ static int wm9081_probe(struct snd_soc_codec *codec)
1283 ARRAY_SIZE(wm9081_eq_controls)); 1274 ARRAY_SIZE(wm9081_eq_controls));
1284 } 1275 }
1285 1276
1286 return ret; 1277 return 0;
1287} 1278}
1288 1279
1289static int wm9081_remove(struct snd_soc_codec *codec) 1280static int wm9081_remove(struct snd_soc_codec *codec)
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c
index a07fe1618eec..87934171f063 100644
--- a/sound/soc/codecs/wm9090.c
+++ b/sound/soc/codecs/wm9090.c
@@ -522,16 +522,6 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec,
522 522
523static int wm9090_probe(struct snd_soc_codec *codec) 523static int wm9090_probe(struct snd_soc_codec *codec)
524{ 524{
525 struct wm9090_priv *wm9090 = dev_get_drvdata(codec->dev);
526 int ret;
527
528 codec->control_data = wm9090->regmap;
529 ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
530 if (ret != 0) {
531 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
532 return ret;
533 }
534
535 /* Configure some defaults; they will be written out when we 525 /* Configure some defaults; they will be written out when we
536 * bring the bias up. 526 * bring the bias up.
537 */ 527 */
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 359c2849b364..b322cf294d06 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1137,6 +1137,16 @@ static int soc_probe_codec(struct snd_soc_card *card,
1137 1137
1138 codec->dapm.idle_bias_off = driver->idle_bias_off; 1138 codec->dapm.idle_bias_off = driver->idle_bias_off;
1139 1139
1140 if (!codec->write && dev_get_regmap(codec->dev, NULL)) {
1141 /* Set the default I/O up try regmap */
1142 ret = snd_soc_codec_set_cache_io(codec, NULL);
1143 if (ret < 0) {
1144 dev_err(codec->dev,
1145 "Failed to set cache I/O: %d\n", ret);
1146 goto err_probe;
1147 }
1148 }
1149
1140 if (driver->probe) { 1150 if (driver->probe) {
1141 ret = driver->probe(codec); 1151 ret = driver->probe(codec);
1142 if (ret < 0) { 1152 if (ret < 0) {
@@ -1150,10 +1160,6 @@ static int soc_probe_codec(struct snd_soc_card *card,
1150 codec->name); 1160 codec->name);
1151 } 1161 }
1152 1162
1153 /* If the driver didn't set I/O up try regmap */
1154 if (!codec->write && dev_get_regmap(codec->dev, NULL))
1155 snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
1156
1157 if (driver->controls) 1163 if (driver->controls)
1158 snd_soc_add_codec_controls(codec, driver->controls, 1164 snd_soc_add_codec_controls(codec, driver->controls,
1159 driver->num_controls); 1165 driver->num_controls);
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index aa886cca3ecf..8aa086996866 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -69,9 +69,7 @@ static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg)
69 * snd_soc_codec_set_cache_io: Set up standard I/O functions. 69 * snd_soc_codec_set_cache_io: Set up standard I/O functions.
70 * 70 *
71 * @codec: CODEC to configure. 71 * @codec: CODEC to configure.
72 * @addr_bits: Number of bits of register address data. 72 * @map: Register map to write to
73 * @data_bits: Number of bits of data per register.
74 * @control: Control bus used.
75 * 73 *
76 * Register formats are frequently shared between many I2C and SPI 74 * Register formats are frequently shared between many I2C and SPI
77 * devices. In order to promote code reuse the ASoC core provides 75 * devices. In order to promote code reuse the ASoC core provides
@@ -85,60 +83,36 @@ static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg)
85 * volatile registers. 83 * volatile registers.
86 */ 84 */
87int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 85int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
88 int addr_bits, int data_bits, 86 struct regmap *regmap)
89 enum snd_soc_control_type control)
90{ 87{
91 struct regmap_config config;
92 int ret; 88 int ret;
93 89
94 memset(&config, 0, sizeof(config)); 90 /* Device has made its own regmap arrangements */
95 codec->write = hw_write; 91 if (!regmap)
96 codec->read = hw_read; 92 codec->control_data = dev_get_regmap(codec->dev, NULL);
93 else
94 codec->control_data = regmap;
97 95
98 config.reg_bits = addr_bits; 96 if (IS_ERR(codec->control_data))
99 config.val_bits = data_bits; 97 return PTR_ERR(codec->control_data);
100 98
101 switch (control) { 99 codec->write = hw_write;
102#if IS_ENABLED(CONFIG_REGMAP_I2C) 100 codec->read = hw_read;
103 case SND_SOC_I2C:
104 codec->control_data = regmap_init_i2c(to_i2c_client(codec->dev),
105 &config);
106 break;
107#endif
108 101
109#if IS_ENABLED(CONFIG_REGMAP_SPI) 102 ret = regmap_get_val_bytes(codec->control_data);
110 case SND_SOC_SPI: 103 /* Errors are legitimate for non-integer byte
111 codec->control_data = regmap_init_spi(to_spi_device(codec->dev), 104 * multiples */
112 &config); 105 if (ret > 0)
113 break; 106 codec->val_bytes = ret;
114#endif
115 107
116 case SND_SOC_REGMAP: 108 codec->using_regmap = true;
117 /* Device has made its own regmap arrangements */
118 codec->using_regmap = true;
119 if (!codec->control_data)
120 codec->control_data = dev_get_regmap(codec->dev, NULL);
121
122 if (codec->control_data) {
123 ret = regmap_get_val_bytes(codec->control_data);
124 /* Errors are legitimate for non-integer byte
125 * multiples */
126 if (ret > 0)
127 codec->val_bytes = ret;
128 }
129 break;
130
131 default:
132 return -EINVAL;
133 }
134 109
135 return PTR_ERR_OR_ZERO(codec->control_data); 110 return 0;
136} 111}
137EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io); 112EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io);
138#else 113#else
139int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 114int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
140 int addr_bits, int data_bits, 115 struct regmap *regmap)
141 enum snd_soc_control_type control)
142{ 116{
143 return -ENOTSUPP; 117 return -ENOTSUPP;
144} 118}