aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-04 10:58:16 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-04 10:59:12 -0400
commite6968a1719a88afa4708ff43696d6615f0be90be (patch)
tree9255c90aa7617da716d56d00d116bab7da2b3da7 /sound/soc/codecs
parentfc9a30e85e4a9df7e692eda45b8484fc028238f0 (diff)
ASoC: codecs: Remove rtd->codec usage from CODEC drivers
In order to support CODEC<->CODEC links remove the assumption that there is only a single CODEC on a DAI link by removing the use of the CODEC pointer in the rtd from the CODEC drivers. They are already being passed their DAI whenever they are passed an rtd and can get the CODEC from there. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/ac97.c4
-rw-r--r--sound/soc/codecs/ad1836.c4
-rw-r--r--sound/soc/codecs/ad193x.c4
-rw-r--r--sound/soc/codecs/adau1701.c3
-rw-r--r--sound/soc/codecs/ak4104.c3
-rw-r--r--sound/soc/codecs/ak4535.c3
-rw-r--r--sound/soc/codecs/ak4641.c3
-rw-r--r--sound/soc/codecs/alc5623.c3
-rw-r--r--sound/soc/codecs/alc5632.c3
-rw-r--r--sound/soc/codecs/cs4270.c3
-rw-r--r--sound/soc/codecs/cs4271.c3
-rw-r--r--sound/soc/codecs/cs42l51.c3
-rw-r--r--sound/soc/codecs/cs42l73.c3
-rw-r--r--sound/soc/codecs/da7210.c3
-rw-r--r--sound/soc/codecs/jz4740.c3
-rw-r--r--sound/soc/codecs/lm49453.c3
-rw-r--r--sound/soc/codecs/rt5631.c3
-rw-r--r--sound/soc/codecs/sgtl5000.c3
-rw-r--r--sound/soc/codecs/ssm2602.c9
-rw-r--r--sound/soc/codecs/sta32x.c3
-rw-r--r--sound/soc/codecs/tlv320aic23.c9
-rw-r--r--sound/soc/codecs/tlv320aic26.c3
-rw-r--r--sound/soc/codecs/tlv320aic3x.c3
-rw-r--r--sound/soc/codecs/tlv320dac33.c35
-rw-r--r--sound/soc/codecs/twl4030.c18
-rw-r--r--sound/soc/codecs/twl6040.c9
-rw-r--r--sound/soc/codecs/uda134x.c6
-rw-r--r--sound/soc/codecs/uda1380.c6
-rw-r--r--sound/soc/codecs/wl1273.c6
-rw-r--r--sound/soc/codecs/wm8400.c3
-rw-r--r--sound/soc/codecs/wm8510.c3
-rw-r--r--sound/soc/codecs/wm8523.c3
-rw-r--r--sound/soc/codecs/wm8728.c3
-rw-r--r--sound/soc/codecs/wm8737.c3
-rw-r--r--sound/soc/codecs/wm8741.c3
-rw-r--r--sound/soc/codecs/wm8750.c3
-rw-r--r--sound/soc/codecs/wm8753.c6
-rw-r--r--sound/soc/codecs/wm8900.c3
-rw-r--r--sound/soc/codecs/wm8903.c3
-rw-r--r--sound/soc/codecs/wm8940.c3
-rw-r--r--sound/soc/codecs/wm8960.c3
-rw-r--r--sound/soc/codecs/wm8962.c3
-rw-r--r--sound/soc/codecs/wm8971.c3
-rw-r--r--sound/soc/codecs/wm8978.c3
-rw-r--r--sound/soc/codecs/wm8988.c3
-rw-r--r--sound/soc/codecs/wm8990.c3
-rw-r--r--sound/soc/codecs/wm9705.c4
-rw-r--r--sound/soc/codecs/wm9712.c8
48 files changed, 78 insertions, 152 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index 1bbad4c16d28..a99a1b304e1c 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -26,9 +26,7 @@
26static int ac97_prepare(struct snd_pcm_substream *substream, 26static int ac97_prepare(struct snd_pcm_substream *substream,
27 struct snd_soc_dai *dai) 27 struct snd_soc_dai *dai)
28{ 28{
29 struct snd_pcm_runtime *runtime = substream->runtime; 29 struct snd_soc_codec *codec = dai->codec;
30 struct snd_soc_pcm_runtime *rtd = substream->private_data;
31 struct snd_soc_codec *codec = rtd->codec;
32 30
33 int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 31 int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
34 AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE; 32 AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE;
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c
index 12e3b4118557..c67b50d8b317 100644
--- a/sound/soc/codecs/ad1836.c
+++ b/sound/soc/codecs/ad1836.c
@@ -162,9 +162,7 @@ static int ad1836_hw_params(struct snd_pcm_substream *substream,
162 struct snd_soc_dai *dai) 162 struct snd_soc_dai *dai)
163{ 163{
164 int word_len = 0; 164 int word_len = 0;
165 165 struct snd_soc_codec *codec = dai->codec;
166 struct snd_soc_pcm_runtime *rtd = substream->private_data;
167 struct snd_soc_codec *codec = rtd->codec;
168 166
169 /* bit size */ 167 /* bit size */
170 switch (params_format(params)) { 168 switch (params_format(params)) {
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index a4a6bef2c0bb..13e62be4f990 100644
--- a/sound/soc/codecs/ad193x.c
+++ b/sound/soc/codecs/ad193x.c
@@ -245,9 +245,7 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream,
245 struct snd_soc_dai *dai) 245 struct snd_soc_dai *dai)
246{ 246{
247 int word_len = 0, master_rate = 0; 247 int word_len = 0, master_rate = 0;
248 248 struct snd_soc_codec *codec = dai->codec;
249 struct snd_soc_pcm_runtime *rtd = substream->private_data;
250 struct snd_soc_codec *codec = rtd->codec;
251 struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); 249 struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec);
252 250
253 /* bit size */ 251 /* bit size */
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 78e9ce48bb99..3d50fc8646b6 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -258,8 +258,7 @@ static int adau1701_set_playback_pcm_format(struct snd_soc_codec *codec,
258static int adau1701_hw_params(struct snd_pcm_substream *substream, 258static int adau1701_hw_params(struct snd_pcm_substream *substream,
259 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) 259 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
260{ 260{
261 struct snd_soc_pcm_runtime *rtd = substream->private_data; 261 struct snd_soc_codec *codec = dai->codec;
262 struct snd_soc_codec *codec = rtd->codec;
263 snd_pcm_format_t format; 262 snd_pcm_format_t format;
264 unsigned int val; 263 unsigned int val;
265 264
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
index ceb96ecf5588..31d4483245d0 100644
--- a/sound/soc/codecs/ak4104.c
+++ b/sound/soc/codecs/ak4104.c
@@ -88,8 +88,7 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream,
88 struct snd_pcm_hw_params *params, 88 struct snd_pcm_hw_params *params,
89 struct snd_soc_dai *dai) 89 struct snd_soc_dai *dai)
90{ 90{
91 struct snd_soc_pcm_runtime *rtd = substream->private_data; 91 struct snd_soc_codec *codec = dai->codec;
92 struct snd_soc_codec *codec = rtd->codec;
93 int val = 0; 92 int val = 0;
94 93
95 /* set the IEC958 bits: consumer mode, no copyright bit */ 94 /* set the IEC958 bits: consumer mode, no copyright bit */
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 838ae8b22b50..618fdc30f73e 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -262,8 +262,7 @@ static int ak4535_hw_params(struct snd_pcm_substream *substream,
262 struct snd_pcm_hw_params *params, 262 struct snd_pcm_hw_params *params,
263 struct snd_soc_dai *dai) 263 struct snd_soc_dai *dai)
264{ 264{
265 struct snd_soc_pcm_runtime *rtd = substream->private_data; 265 struct snd_soc_codec *codec = dai->codec;
266 struct snd_soc_codec *codec = rtd->codec;
267 struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec); 266 struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec);
268 u8 mode2 = snd_soc_read(codec, AK4535_MODE2) & ~(0x3 << 5); 267 u8 mode2 = snd_soc_read(codec, AK4535_MODE2) & ~(0x3 << 5);
269 int rate = params_rate(params), fs = 256; 268 int rate = params_rate(params), fs = 256;
diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c
index 7f42d4a673e3..543a12f471be 100644
--- a/sound/soc/codecs/ak4641.c
+++ b/sound/soc/codecs/ak4641.c
@@ -296,8 +296,7 @@ static int ak4641_i2s_hw_params(struct snd_pcm_substream *substream,
296 struct snd_pcm_hw_params *params, 296 struct snd_pcm_hw_params *params,
297 struct snd_soc_dai *dai) 297 struct snd_soc_dai *dai)
298{ 298{
299 struct snd_soc_pcm_runtime *rtd = substream->private_data; 299 struct snd_soc_codec *codec = dai->codec;
300 struct snd_soc_codec *codec = rtd->codec;
301 struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec); 300 struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
302 int rate = params_rate(params), fs = 256; 301 int rate = params_rate(params), fs = 256;
303 u8 mode2; 302 u8 mode2;
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c
index d47b62ddb210..3061d35e9f5c 100644
--- a/sound/soc/codecs/alc5623.c
+++ b/sound/soc/codecs/alc5623.c
@@ -705,8 +705,7 @@ static int alc5623_set_dai_fmt(struct snd_soc_dai *codec_dai,
705static int alc5623_pcm_hw_params(struct snd_pcm_substream *substream, 705static int alc5623_pcm_hw_params(struct snd_pcm_substream *substream,
706 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) 706 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
707{ 707{
708 struct snd_soc_pcm_runtime *rtd = substream->private_data; 708 struct snd_soc_codec *codec = dai->codec;
709 struct snd_soc_codec *codec = rtd->codec;
710 struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); 709 struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec);
711 int coeff, rate; 710 int coeff, rate;
712 u16 iface; 711 u16 iface;
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index e2111e0ccad7..93a5909fcc49 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -861,8 +861,7 @@ static int alc5632_set_dai_fmt(struct snd_soc_dai *codec_dai,
861static int alc5632_pcm_hw_params(struct snd_pcm_substream *substream, 861static int alc5632_pcm_hw_params(struct snd_pcm_substream *substream,
862 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) 862 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
863{ 863{
864 struct snd_soc_pcm_runtime *rtd = substream->private_data; 864 struct snd_soc_codec *codec = dai->codec;
865 struct snd_soc_codec *codec = rtd->codec;
866 int coeff, rate; 865 int coeff, rate;
867 u16 iface; 866 u16 iface;
868 867
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index df8fe387a66f..047917f0b8ae 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -307,8 +307,7 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,
307 struct snd_pcm_hw_params *params, 307 struct snd_pcm_hw_params *params,
308 struct snd_soc_dai *dai) 308 struct snd_soc_dai *dai)
309{ 309{
310 struct snd_soc_pcm_runtime *rtd = substream->private_data; 310 struct snd_soc_codec *codec = dai->codec;
311 struct snd_soc_codec *codec = rtd->codec;
312 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); 311 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
313 int ret; 312 int ret;
314 unsigned int i; 313 unsigned int i;
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index bf7141280a74..9eb01d7d58a3 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -318,8 +318,7 @@ static int cs4271_hw_params(struct snd_pcm_substream *substream,
318 struct snd_pcm_hw_params *params, 318 struct snd_pcm_hw_params *params,
319 struct snd_soc_dai *dai) 319 struct snd_soc_dai *dai)
320{ 320{
321 struct snd_soc_pcm_runtime *rtd = substream->private_data; 321 struct snd_soc_codec *codec = dai->codec;
322 struct snd_soc_codec *codec = rtd->codec;
323 struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec); 322 struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
324 int i, ret; 323 int i, ret;
325 unsigned int ratio, val; 324 unsigned int ratio, val;
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
index 85d60695c210..091d0193f507 100644
--- a/sound/soc/codecs/cs42l51.c
+++ b/sound/soc/codecs/cs42l51.c
@@ -356,8 +356,7 @@ static int cs42l51_hw_params(struct snd_pcm_substream *substream,
356 struct snd_pcm_hw_params *params, 356 struct snd_pcm_hw_params *params,
357 struct snd_soc_dai *dai) 357 struct snd_soc_dai *dai)
358{ 358{
359 struct snd_soc_pcm_runtime *rtd = substream->private_data; 359 struct snd_soc_codec *codec = dai->codec;
360 struct snd_soc_codec *codec = rtd->codec;
361 struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec); 360 struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
362 int ret; 361 int ret;
363 unsigned int i; 362 unsigned int i;
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index d39b3e78703b..2cc50b379a0e 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -1089,8 +1089,7 @@ static int cs42l73_pcm_hw_params(struct snd_pcm_substream *substream,
1089 struct snd_pcm_hw_params *params, 1089 struct snd_pcm_hw_params *params,
1090 struct snd_soc_dai *dai) 1090 struct snd_soc_dai *dai)
1091{ 1091{
1092 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1092 struct snd_soc_codec *codec = dai->codec;
1093 struct snd_soc_codec *codec = rtd->codec;
1094 struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec); 1093 struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec);
1095 int id = dai->id; 1094 int id = dai->id;
1096 int mclk_coeff; 1095 int mclk_coeff;
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c
index 8e45aa9cb7b7..5dfdf6e7a39a 100644
--- a/sound/soc/codecs/da7210.c
+++ b/sound/soc/codecs/da7210.c
@@ -716,8 +716,7 @@ static int da7210_hw_params(struct snd_pcm_substream *substream,
716 struct snd_pcm_hw_params *params, 716 struct snd_pcm_hw_params *params,
717 struct snd_soc_dai *dai) 717 struct snd_soc_dai *dai)
718{ 718{
719 struct snd_soc_pcm_runtime *rtd = substream->private_data; 719 struct snd_soc_codec *codec = dai->codec;
720 struct snd_soc_codec *codec = rtd->codec;
721 u32 dai_cfg1; 720 u32 dai_cfg1;
722 u32 fs, bypass; 721 u32 fs, bypass;
723 722
diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c
index 4624e752a188..85d9cabe6d55 100644
--- a/sound/soc/codecs/jz4740.c
+++ b/sound/soc/codecs/jz4740.c
@@ -164,8 +164,7 @@ static int jz4740_codec_hw_params(struct snd_pcm_substream *substream,
164 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) 164 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
165{ 165{
166 uint32_t val; 166 uint32_t val;
167 struct snd_soc_pcm_runtime *rtd = substream->private_data; 167 struct snd_soc_codec *codec = dai->codec;
168 struct snd_soc_codec *codec =rtd->codec;
169 168
170 switch (params_rate(params)) { 169 switch (params_rate(params)) {
171 case 8000: 170 case 8000:
diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c
index 744063da40d5..89bbe037f81f 100644
--- a/sound/soc/codecs/lm49453.c
+++ b/sound/soc/codecs/lm49453.c
@@ -1140,8 +1140,7 @@ static int lm49453_hw_params(struct snd_pcm_substream *substream,
1140 struct snd_pcm_hw_params *params, 1140 struct snd_pcm_hw_params *params,
1141 struct snd_soc_dai *dai) 1141 struct snd_soc_dai *dai)
1142{ 1142{
1143 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1143 struct snd_soc_codec *codec = dai->codec;
1144 struct snd_soc_codec *codec = rtd->codec;
1145 struct lm49453_priv *lm49453 = snd_soc_codec_get_drvdata(codec); 1144 struct lm49453_priv *lm49453 = snd_soc_codec_get_drvdata(codec);
1146 u16 clk_div = 0; 1145 u16 clk_div = 0;
1147 1146
diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
index 20c324c7c349..95147e451982 100644
--- a/sound/soc/codecs/rt5631.c
+++ b/sound/soc/codecs/rt5631.c
@@ -1361,8 +1361,7 @@ static int get_coeff(int mclk, int rate, int timesofbclk)
1361static int rt5631_hifi_pcm_params(struct snd_pcm_substream *substream, 1361static int rt5631_hifi_pcm_params(struct snd_pcm_substream *substream,
1362 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) 1362 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
1363{ 1363{
1364 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1364 struct snd_soc_codec *codec = dai->codec;
1365 struct snd_soc_codec *codec = rtd->codec;
1366 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec); 1365 struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
1367 int timesofbclk = 32, coeff; 1366 int timesofbclk = 32, coeff;
1368 unsigned int iface = 0; 1367 unsigned int iface = 0;
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 84077aae7c4a..9538d41c1e5c 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -664,8 +664,7 @@ static int sgtl5000_pcm_hw_params(struct snd_pcm_substream *substream,
664 struct snd_pcm_hw_params *params, 664 struct snd_pcm_hw_params *params,
665 struct snd_soc_dai *dai) 665 struct snd_soc_dai *dai)
666{ 666{
667 struct snd_soc_pcm_runtime *rtd = substream->private_data; 667 struct snd_soc_codec *codec = dai->codec;
668 struct snd_soc_codec *codec = rtd->codec;
669 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); 668 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
670 int channels = params_channels(params); 669 int channels = params_channels(params);
671 int i2s_ctl = 0; 670 int i2s_ctl = 0;
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index de2b20544ceb..4c94fd211fb0 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -254,8 +254,7 @@ static int ssm2602_hw_params(struct snd_pcm_substream *substream,
254 struct snd_pcm_hw_params *params, 254 struct snd_pcm_hw_params *params,
255 struct snd_soc_dai *dai) 255 struct snd_soc_dai *dai)
256{ 256{
257 struct snd_soc_pcm_runtime *rtd = substream->private_data; 257 struct snd_soc_codec *codec = dai->codec;
258 struct snd_soc_codec *codec = rtd->codec;
259 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); 258 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
260 u16 iface = snd_soc_read(codec, SSM2602_IFACE) & 0xfff3; 259 u16 iface = snd_soc_read(codec, SSM2602_IFACE) & 0xfff3;
261 int srate = ssm2602_get_coeff(ssm2602->sysclk, params_rate(params)); 260 int srate = ssm2602_get_coeff(ssm2602->sysclk, params_rate(params));
@@ -291,8 +290,7 @@ static int ssm2602_hw_params(struct snd_pcm_substream *substream,
291static int ssm2602_startup(struct snd_pcm_substream *substream, 290static int ssm2602_startup(struct snd_pcm_substream *substream,
292 struct snd_soc_dai *dai) 291 struct snd_soc_dai *dai)
293{ 292{
294 struct snd_soc_pcm_runtime *rtd = substream->private_data; 293 struct snd_soc_codec *codec = dai->codec;
295 struct snd_soc_codec *codec = rtd->codec;
296 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); 294 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
297 struct snd_pcm_runtime *master_runtime; 295 struct snd_pcm_runtime *master_runtime;
298 296
@@ -328,8 +326,7 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
328static void ssm2602_shutdown(struct snd_pcm_substream *substream, 326static void ssm2602_shutdown(struct snd_pcm_substream *substream,
329 struct snd_soc_dai *dai) 327 struct snd_soc_dai *dai)
330{ 328{
331 struct snd_soc_pcm_runtime *rtd = substream->private_data; 329 struct snd_soc_codec *codec = dai->codec;
332 struct snd_soc_codec *codec = rtd->codec;
333 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); 330 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
334 331
335 if (ssm2602->master_substream == substream) 332 if (ssm2602->master_substream == substream)
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 7db6fa515028..8d717f4b5a87 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -609,8 +609,7 @@ static int sta32x_hw_params(struct snd_pcm_substream *substream,
609 struct snd_pcm_hw_params *params, 609 struct snd_pcm_hw_params *params,
610 struct snd_soc_dai *dai) 610 struct snd_soc_dai *dai)
611{ 611{
612 struct snd_soc_pcm_runtime *rtd = substream->private_data; 612 struct snd_soc_codec *codec = dai->codec;
613 struct snd_soc_codec *codec = rtd->codec;
614 struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); 613 struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec);
615 unsigned int rate; 614 unsigned int rate;
616 int i, mcs = -1, ir = -1; 615 int i, mcs = -1, ir = -1;
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index b0cafd32c684..8c758b214a25 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -323,8 +323,7 @@ static int tlv320aic23_hw_params(struct snd_pcm_substream *substream,
323 struct snd_pcm_hw_params *params, 323 struct snd_pcm_hw_params *params,
324 struct snd_soc_dai *dai) 324 struct snd_soc_dai *dai)
325{ 325{
326 struct snd_soc_pcm_runtime *rtd = substream->private_data; 326 struct snd_soc_codec *codec = dai->codec;
327 struct snd_soc_codec *codec = rtd->codec;
328 u16 iface_reg; 327 u16 iface_reg;
329 int ret; 328 int ret;
330 struct aic23 *aic23 = snd_soc_codec_get_drvdata(codec); 329 struct aic23 *aic23 = snd_soc_codec_get_drvdata(codec);
@@ -369,8 +368,7 @@ static int tlv320aic23_hw_params(struct snd_pcm_substream *substream,
369static int tlv320aic23_pcm_prepare(struct snd_pcm_substream *substream, 368static int tlv320aic23_pcm_prepare(struct snd_pcm_substream *substream,
370 struct snd_soc_dai *dai) 369 struct snd_soc_dai *dai)
371{ 370{
372 struct snd_soc_pcm_runtime *rtd = substream->private_data; 371 struct snd_soc_codec *codec = dai->codec;
373 struct snd_soc_codec *codec = rtd->codec;
374 372
375 /* set active */ 373 /* set active */
376 snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0001); 374 snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0001);
@@ -381,8 +379,7 @@ static int tlv320aic23_pcm_prepare(struct snd_pcm_substream *substream,
381static void tlv320aic23_shutdown(struct snd_pcm_substream *substream, 379static void tlv320aic23_shutdown(struct snd_pcm_substream *substream,
382 struct snd_soc_dai *dai) 380 struct snd_soc_dai *dai)
383{ 381{
384 struct snd_soc_pcm_runtime *rtd = substream->private_data; 382 struct snd_soc_codec *codec = dai->codec;
385 struct snd_soc_codec *codec = rtd->codec;
386 struct aic23 *aic23 = snd_soc_codec_get_drvdata(codec); 383 struct aic23 *aic23 = snd_soc_codec_get_drvdata(codec);
387 384
388 /* deactivate */ 385 /* deactivate */
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c
index 802064b5030d..85944e953578 100644
--- a/sound/soc/codecs/tlv320aic26.c
+++ b/sound/soc/codecs/tlv320aic26.c
@@ -126,8 +126,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
126 struct snd_pcm_hw_params *params, 126 struct snd_pcm_hw_params *params,
127 struct snd_soc_dai *dai) 127 struct snd_soc_dai *dai)
128{ 128{
129 struct snd_soc_pcm_runtime *rtd = substream->private_data; 129 struct snd_soc_codec *codec = dai->codec;
130 struct snd_soc_codec *codec = rtd->codec;
131 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec); 130 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
132 int fsref, divisor, wlen, pval, jval, dval, qval; 131 int fsref, divisor, wlen, pval, jval, dval, qval;
133 u16 reg; 132 u16 reg;
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 8d20f6ec20f3..bde2d1ade0c6 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -802,8 +802,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
802 struct snd_pcm_hw_params *params, 802 struct snd_pcm_hw_params *params,
803 struct snd_soc_dai *dai) 803 struct snd_soc_dai *dai)
804{ 804{
805 struct snd_soc_pcm_runtime *rtd = substream->private_data; 805 struct snd_soc_codec *codec = dai->codec;
806 struct snd_soc_codec *codec =rtd->codec;
807 struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec); 806 struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
808 int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; 807 int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0;
809 u8 data, j, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; 808 u8 data, j, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1;
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 4587ddd0fbf8..0dd41077ab79 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -62,8 +62,10 @@
62#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \ 62#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \
63 (((samples)*5000) / (((burstrate)*5000) / ((burstrate) - (playrate)))) 63 (((samples)*5000) / (((burstrate)*5000) / ((burstrate) - (playrate))))
64 64
65static void dac33_calculate_times(struct snd_pcm_substream *substream); 65static void dac33_calculate_times(struct snd_pcm_substream *substream,
66static int dac33_prepare_chip(struct snd_pcm_substream *substream); 66 struct snd_soc_codec *codec);
67static int dac33_prepare_chip(struct snd_pcm_substream *substream,
68 struct snd_soc_codec *codec);
67 69
68enum dac33_state { 70enum dac33_state {
69 DAC33_IDLE = 0, 71 DAC33_IDLE = 0,
@@ -427,8 +429,8 @@ static int dac33_playback_event(struct snd_soc_dapm_widget *w,
427 switch (event) { 429 switch (event) {
428 case SND_SOC_DAPM_PRE_PMU: 430 case SND_SOC_DAPM_PRE_PMU:
429 if (likely(dac33->substream)) { 431 if (likely(dac33->substream)) {
430 dac33_calculate_times(dac33->substream); 432 dac33_calculate_times(dac33->substream, w->codec);
431 dac33_prepare_chip(dac33->substream); 433 dac33_prepare_chip(dac33->substream, w->codec);
432 } 434 }
433 break; 435 break;
434 case SND_SOC_DAPM_POST_PMD: 436 case SND_SOC_DAPM_POST_PMD:
@@ -799,8 +801,7 @@ static void dac33_oscwait(struct snd_soc_codec *codec)
799static int dac33_startup(struct snd_pcm_substream *substream, 801static int dac33_startup(struct snd_pcm_substream *substream,
800 struct snd_soc_dai *dai) 802 struct snd_soc_dai *dai)
801{ 803{
802 struct snd_soc_pcm_runtime *rtd = substream->private_data; 804 struct snd_soc_codec *codec = dai->codec;
803 struct snd_soc_codec *codec = rtd->codec;
804 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 805 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
805 806
806 /* Stream started, save the substream pointer */ 807 /* Stream started, save the substream pointer */
@@ -812,8 +813,7 @@ static int dac33_startup(struct snd_pcm_substream *substream,
812static void dac33_shutdown(struct snd_pcm_substream *substream, 813static void dac33_shutdown(struct snd_pcm_substream *substream,
813 struct snd_soc_dai *dai) 814 struct snd_soc_dai *dai)
814{ 815{
815 struct snd_soc_pcm_runtime *rtd = substream->private_data; 816 struct snd_soc_codec *codec = dai->codec;
816 struct snd_soc_codec *codec = rtd->codec;
817 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 817 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
818 818
819 dac33->substream = NULL; 819 dac33->substream = NULL;
@@ -825,8 +825,7 @@ static int dac33_hw_params(struct snd_pcm_substream *substream,
825 struct snd_pcm_hw_params *params, 825 struct snd_pcm_hw_params *params,
826 struct snd_soc_dai *dai) 826 struct snd_soc_dai *dai)
827{ 827{
828 struct snd_soc_pcm_runtime *rtd = substream->private_data; 828 struct snd_soc_codec *codec = dai->codec;
829 struct snd_soc_codec *codec = rtd->codec;
830 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 829 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
831 830
832 /* Check parameters for validity */ 831 /* Check parameters for validity */
@@ -868,10 +867,9 @@ static int dac33_hw_params(struct snd_pcm_substream *substream,
868 * writes happens in different order, than dac33 might end up in unknown state. 867 * writes happens in different order, than dac33 might end up in unknown state.
869 * Use the known, working sequence of register writes to initialize the dac33. 868 * Use the known, working sequence of register writes to initialize the dac33.
870 */ 869 */
871static int dac33_prepare_chip(struct snd_pcm_substream *substream) 870static int dac33_prepare_chip(struct snd_pcm_substream *substream,
871 struct snd_soc_codec *codec)
872{ 872{
873 struct snd_soc_pcm_runtime *rtd = substream->private_data;
874 struct snd_soc_codec *codec = rtd->codec;
875 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 873 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
876 unsigned int oscset, ratioset, pwr_ctrl, reg_tmp; 874 unsigned int oscset, ratioset, pwr_ctrl, reg_tmp;
877 u8 aictrl_a, aictrl_b, fifoctrl_a; 875 u8 aictrl_a, aictrl_b, fifoctrl_a;
@@ -1067,10 +1065,9 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
1067 return 0; 1065 return 0;
1068} 1066}
1069 1067
1070static void dac33_calculate_times(struct snd_pcm_substream *substream) 1068static void dac33_calculate_times(struct snd_pcm_substream *substream,
1069 struct snd_soc_codec *codec)
1071{ 1070{
1072 struct snd_soc_pcm_runtime *rtd = substream->private_data;
1073 struct snd_soc_codec *codec = rtd->codec;
1074 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 1071 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
1075 unsigned int period_size = substream->runtime->period_size; 1072 unsigned int period_size = substream->runtime->period_size;
1076 unsigned int rate = substream->runtime->rate; 1073 unsigned int rate = substream->runtime->rate;
@@ -1128,8 +1125,7 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
1128static int dac33_pcm_trigger(struct snd_pcm_substream *substream, int cmd, 1125static int dac33_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
1129 struct snd_soc_dai *dai) 1126 struct snd_soc_dai *dai)
1130{ 1127{
1131 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1128 struct snd_soc_codec *codec = dai->codec;
1132 struct snd_soc_codec *codec = rtd->codec;
1133 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 1129 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
1134 int ret = 0; 1130 int ret = 0;
1135 1131
@@ -1161,8 +1157,7 @@ static snd_pcm_sframes_t dac33_dai_delay(
1161 struct snd_pcm_substream *substream, 1157 struct snd_pcm_substream *substream,
1162 struct snd_soc_dai *dai) 1158 struct snd_soc_dai *dai)
1163{ 1159{
1164 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1160 struct snd_soc_codec *codec = dai->codec;
1165 struct snd_soc_codec *codec = rtd->codec;
1166 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 1161 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
1167 unsigned long long t0, t1, t_now; 1162 unsigned long long t0, t1, t_now;
1168 unsigned int time_delta, uthr; 1163 unsigned int time_delta, uthr;
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 170cf9a8fc79..391fcfc7b63b 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -1685,8 +1685,7 @@ static void twl4030_tdm_enable(struct snd_soc_codec *codec, int direction,
1685static int twl4030_startup(struct snd_pcm_substream *substream, 1685static int twl4030_startup(struct snd_pcm_substream *substream,
1686 struct snd_soc_dai *dai) 1686 struct snd_soc_dai *dai)
1687{ 1687{
1688 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1688 struct snd_soc_codec *codec = dai->codec;
1689 struct snd_soc_codec *codec = rtd->codec;
1690 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 1689 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1691 1690
1692 if (twl4030->master_substream) { 1691 if (twl4030->master_substream) {
@@ -1715,8 +1714,7 @@ static int twl4030_startup(struct snd_pcm_substream *substream,
1715static void twl4030_shutdown(struct snd_pcm_substream *substream, 1714static void twl4030_shutdown(struct snd_pcm_substream *substream,
1716 struct snd_soc_dai *dai) 1715 struct snd_soc_dai *dai)
1717{ 1716{
1718 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1717 struct snd_soc_codec *codec = dai->codec;
1719 struct snd_soc_codec *codec = rtd->codec;
1720 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 1718 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1721 1719
1722 if (twl4030->master_substream == substream) 1720 if (twl4030->master_substream == substream)
@@ -1740,8 +1738,7 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream,
1740 struct snd_pcm_hw_params *params, 1738 struct snd_pcm_hw_params *params,
1741 struct snd_soc_dai *dai) 1739 struct snd_soc_dai *dai)
1742{ 1740{
1743 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1741 struct snd_soc_codec *codec = dai->codec;
1744 struct snd_soc_codec *codec = rtd->codec;
1745 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 1742 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1746 u8 mode, old_mode, format, old_format; 1743 u8 mode, old_mode, format, old_format;
1747 1744
@@ -1974,8 +1971,7 @@ static void twl4030_voice_enable(struct snd_soc_codec *codec, int direction,
1974static int twl4030_voice_startup(struct snd_pcm_substream *substream, 1971static int twl4030_voice_startup(struct snd_pcm_substream *substream,
1975 struct snd_soc_dai *dai) 1972 struct snd_soc_dai *dai)
1976{ 1973{
1977 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1974 struct snd_soc_codec *codec = dai->codec;
1978 struct snd_soc_codec *codec = rtd->codec;
1979 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 1975 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1980 u8 mode; 1976 u8 mode;
1981 1977
@@ -2007,8 +2003,7 @@ static int twl4030_voice_startup(struct snd_pcm_substream *substream,
2007static void twl4030_voice_shutdown(struct snd_pcm_substream *substream, 2003static void twl4030_voice_shutdown(struct snd_pcm_substream *substream,
2008 struct snd_soc_dai *dai) 2004 struct snd_soc_dai *dai)
2009{ 2005{
2010 struct snd_soc_pcm_runtime *rtd = substream->private_data; 2006 struct snd_soc_codec *codec = dai->codec;
2011 struct snd_soc_codec *codec = rtd->codec;
2012 2007
2013 /* Enable voice digital filters */ 2008 /* Enable voice digital filters */
2014 twl4030_voice_enable(codec, substream->stream, 0); 2009 twl4030_voice_enable(codec, substream->stream, 0);
@@ -2017,8 +2012,7 @@ static void twl4030_voice_shutdown(struct snd_pcm_substream *substream,
2017static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, 2012static int twl4030_voice_hw_params(struct snd_pcm_substream *substream,
2018 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) 2013 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
2019{ 2014{
2020 struct snd_soc_pcm_runtime *rtd = substream->private_data; 2015 struct snd_soc_codec *codec = dai->codec;
2021 struct snd_soc_codec *codec = rtd->codec;
2022 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 2016 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
2023 u8 old_mode, mode; 2017 u8 old_mode, mode;
2024 2018
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 2d8c6b825e57..ccbc88aa8497 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1340,8 +1340,7 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec,
1340static int twl6040_startup(struct snd_pcm_substream *substream, 1340static int twl6040_startup(struct snd_pcm_substream *substream,
1341 struct snd_soc_dai *dai) 1341 struct snd_soc_dai *dai)
1342{ 1342{
1343 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1343 struct snd_soc_codec *codec = dai->codec;
1344 struct snd_soc_codec *codec = rtd->codec;
1345 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 1344 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
1346 1345
1347 snd_pcm_hw_constraint_list(substream->runtime, 0, 1346 snd_pcm_hw_constraint_list(substream->runtime, 0,
@@ -1355,8 +1354,7 @@ static int twl6040_hw_params(struct snd_pcm_substream *substream,
1355 struct snd_pcm_hw_params *params, 1354 struct snd_pcm_hw_params *params,
1356 struct snd_soc_dai *dai) 1355 struct snd_soc_dai *dai)
1357{ 1356{
1358 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1357 struct snd_soc_codec *codec = dai->codec;
1359 struct snd_soc_codec *codec = rtd->codec;
1360 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 1358 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
1361 int rate; 1359 int rate;
1362 1360
@@ -1392,8 +1390,7 @@ static int twl6040_hw_params(struct snd_pcm_substream *substream,
1392static int twl6040_prepare(struct snd_pcm_substream *substream, 1390static int twl6040_prepare(struct snd_pcm_substream *substream,
1393 struct snd_soc_dai *dai) 1391 struct snd_soc_dai *dai)
1394{ 1392{
1395 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1393 struct snd_soc_codec *codec = dai->codec;
1396 struct snd_soc_codec *codec = rtd->codec;
1397 struct twl6040 *twl6040 = codec->control_data; 1394 struct twl6040 *twl6040 = codec->control_data;
1398 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 1395 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
1399 int ret; 1396 int ret;
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c
index 797b0dde2c68..6c3d43b8ee85 100644
--- a/sound/soc/codecs/uda134x.c
+++ b/sound/soc/codecs/uda134x.c
@@ -159,8 +159,7 @@ static int uda134x_mute(struct snd_soc_dai *dai, int mute)
159static int uda134x_startup(struct snd_pcm_substream *substream, 159static int uda134x_startup(struct snd_pcm_substream *substream,
160 struct snd_soc_dai *dai) 160 struct snd_soc_dai *dai)
161{ 161{
162 struct snd_soc_pcm_runtime *rtd = substream->private_data; 162 struct snd_soc_codec *codec = dai->codec;
163 struct snd_soc_codec *codec =rtd->codec;
164 struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); 163 struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
165 struct snd_pcm_runtime *master_runtime; 164 struct snd_pcm_runtime *master_runtime;
166 165
@@ -191,8 +190,7 @@ static int uda134x_startup(struct snd_pcm_substream *substream,
191static void uda134x_shutdown(struct snd_pcm_substream *substream, 190static void uda134x_shutdown(struct snd_pcm_substream *substream,
192 struct snd_soc_dai *dai) 191 struct snd_soc_dai *dai)
193{ 192{
194 struct snd_soc_pcm_runtime *rtd = substream->private_data; 193 struct snd_soc_codec *codec = dai->codec;
195 struct snd_soc_codec *codec = rtd->codec;
196 struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); 194 struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
197 195
198 if (uda134x->master_substream == substream) 196 if (uda134x->master_substream == substream)
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 4f1b23d7e404..2502214b84ab 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -502,8 +502,7 @@ static int uda1380_set_dai_fmt_capture(struct snd_soc_dai *codec_dai,
502static int uda1380_trigger(struct snd_pcm_substream *substream, int cmd, 502static int uda1380_trigger(struct snd_pcm_substream *substream, int cmd,
503 struct snd_soc_dai *dai) 503 struct snd_soc_dai *dai)
504{ 504{
505 struct snd_soc_pcm_runtime *rtd = substream->private_data; 505 struct snd_soc_codec *codec = dai->codec;
506 struct snd_soc_codec *codec = rtd->codec;
507 struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec); 506 struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec);
508 int mixer = uda1380_read_reg_cache(codec, UDA1380_MIXER); 507 int mixer = uda1380_read_reg_cache(codec, UDA1380_MIXER);
509 508
@@ -528,8 +527,7 @@ static int uda1380_pcm_hw_params(struct snd_pcm_substream *substream,
528 struct snd_pcm_hw_params *params, 527 struct snd_pcm_hw_params *params,
529 struct snd_soc_dai *dai) 528 struct snd_soc_dai *dai)
530{ 529{
531 struct snd_soc_pcm_runtime *rtd = substream->private_data; 530 struct snd_soc_codec *codec = dai->codec;
532 struct snd_soc_codec *codec = rtd->codec;
533 u16 clk = uda1380_read_reg_cache(codec, UDA1380_CLK); 531 u16 clk = uda1380_read_reg_cache(codec, UDA1380_CLK);
534 532
535 /* set WSPLL power and divider if running from this clock */ 533 /* set WSPLL power and divider if running from this clock */
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index 3d868dc40092..7b24d6d192e1 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -293,8 +293,7 @@ static const struct snd_kcontrol_new wl1273_controls[] = {
293static int wl1273_startup(struct snd_pcm_substream *substream, 293static int wl1273_startup(struct snd_pcm_substream *substream,
294 struct snd_soc_dai *dai) 294 struct snd_soc_dai *dai)
295{ 295{
296 struct snd_soc_pcm_runtime *rtd = substream->private_data; 296 struct snd_soc_codec *codec = dai->codec;
297 struct snd_soc_codec *codec = rtd->codec;
298 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 297 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
299 298
300 switch (wl1273->mode) { 299 switch (wl1273->mode) {
@@ -329,8 +328,7 @@ static int wl1273_hw_params(struct snd_pcm_substream *substream,
329 struct snd_pcm_hw_params *params, 328 struct snd_pcm_hw_params *params,
330 struct snd_soc_dai *dai) 329 struct snd_soc_dai *dai)
331{ 330{
332 struct snd_soc_pcm_runtime *rtd = substream->private_data; 331 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(dai->codec);
333 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(rtd->codec);
334 struct wl1273_core *core = wl1273->core; 332 struct wl1273_core *core = wl1273->core;
335 unsigned int rate, width, r; 333 unsigned int rate, width, r;
336 334
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 898979d23010..fcc0cac9ccd4 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -1145,8 +1145,7 @@ static int wm8400_hw_params(struct snd_pcm_substream *substream,
1145 struct snd_pcm_hw_params *params, 1145 struct snd_pcm_hw_params *params,
1146 struct snd_soc_dai *dai) 1146 struct snd_soc_dai *dai)
1147{ 1147{
1148 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1148 struct snd_soc_codec *codec = dai->codec;
1149 struct snd_soc_codec *codec = rtd->codec;
1150 u16 audio1 = wm8400_read(codec, WM8400_AUDIO_INTERFACE_1); 1149 u16 audio1 = wm8400_read(codec, WM8400_AUDIO_INTERFACE_1);
1151 1150
1152 audio1 &= ~WM8400_AIF_WL_MASK; 1151 audio1 &= ~WM8400_AIF_WL_MASK;
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c
index 9166126bd312..56a049555e2c 100644
--- a/sound/soc/codecs/wm8510.c
+++ b/sound/soc/codecs/wm8510.c
@@ -392,8 +392,7 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream,
392 struct snd_pcm_hw_params *params, 392 struct snd_pcm_hw_params *params,
393 struct snd_soc_dai *dai) 393 struct snd_soc_dai *dai)
394{ 394{
395 struct snd_soc_pcm_runtime *rtd = substream->private_data; 395 struct snd_soc_codec *codec = dai->codec;
396 struct snd_soc_codec *codec = rtd->codec;
397 u16 iface = snd_soc_read(codec, WM8510_IFACE) & 0x19f; 396 u16 iface = snd_soc_read(codec, WM8510_IFACE) & 0x19f;
398 u16 adn = snd_soc_read(codec, WM8510_ADD) & 0x1f1; 397 u16 adn = snd_soc_read(codec, WM8510_ADD) & 0x1f1;
399 398
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c
index 7fea2c3bf7e7..1c3ffb290cdc 100644
--- a/sound/soc/codecs/wm8523.c
+++ b/sound/soc/codecs/wm8523.c
@@ -145,8 +145,7 @@ static int wm8523_hw_params(struct snd_pcm_substream *substream,
145 struct snd_pcm_hw_params *params, 145 struct snd_pcm_hw_params *params,
146 struct snd_soc_dai *dai) 146 struct snd_soc_dai *dai)
147{ 147{
148 struct snd_soc_pcm_runtime *rtd = substream->private_data; 148 struct snd_soc_codec *codec = dai->codec;
149 struct snd_soc_codec *codec = rtd->codec;
150 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec); 149 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
151 int i; 150 int i;
152 u16 aifctrl1 = snd_soc_read(codec, WM8523_AIF_CTRL1); 151 u16 aifctrl1 = snd_soc_read(codec, WM8523_AIF_CTRL1);
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c
index fc3d59e49084..1467f97dce21 100644
--- a/sound/soc/codecs/wm8728.c
+++ b/sound/soc/codecs/wm8728.c
@@ -88,8 +88,7 @@ static int wm8728_hw_params(struct snd_pcm_substream *substream,
88 struct snd_pcm_hw_params *params, 88 struct snd_pcm_hw_params *params,
89 struct snd_soc_dai *dai) 89 struct snd_soc_dai *dai)
90{ 90{
91 struct snd_soc_pcm_runtime *rtd = substream->private_data; 91 struct snd_soc_codec *codec = dai->codec;
92 struct snd_soc_codec *codec = rtd->codec;
93 u16 dac = snd_soc_read(codec, WM8728_DACCTL); 92 u16 dac = snd_soc_read(codec, WM8728_DACCTL);
94 93
95 dac &= ~0x18; 94 dac &= ~0x18;
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c
index 4fe9d191e277..d0520124616d 100644
--- a/sound/soc/codecs/wm8737.c
+++ b/sound/soc/codecs/wm8737.c
@@ -329,8 +329,7 @@ static int wm8737_hw_params(struct snd_pcm_substream *substream,
329 struct snd_pcm_hw_params *params, 329 struct snd_pcm_hw_params *params,
330 struct snd_soc_dai *dai) 330 struct snd_soc_dai *dai)
331{ 331{
332 struct snd_soc_pcm_runtime *rtd = substream->private_data; 332 struct snd_soc_codec *codec = dai->codec;
333 struct snd_soc_codec *codec = rtd->codec;
334 struct wm8737_priv *wm8737 = snd_soc_codec_get_drvdata(codec); 333 struct wm8737_priv *wm8737 = snd_soc_codec_get_drvdata(codec);
335 int i; 334 int i;
336 u16 clocking = 0; 335 u16 clocking = 0;
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index 3941f50bf187..6e849cb04243 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -203,8 +203,7 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
203 struct snd_pcm_hw_params *params, 203 struct snd_pcm_hw_params *params,
204 struct snd_soc_dai *dai) 204 struct snd_soc_dai *dai)
205{ 205{
206 struct snd_soc_pcm_runtime *rtd = substream->private_data; 206 struct snd_soc_codec *codec = dai->codec;
207 struct snd_soc_codec *codec = rtd->codec;
208 struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec); 207 struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
209 u16 iface = snd_soc_read(codec, WM8741_FORMAT_CONTROL) & 0x1FC; 208 u16 iface = snd_soc_read(codec, WM8741_FORMAT_CONTROL) & 0x1FC;
210 int i; 209 int i;
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index e4c50ce7d9c0..89151ca5e776 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -547,8 +547,7 @@ static int wm8750_pcm_hw_params(struct snd_pcm_substream *substream,
547 struct snd_pcm_hw_params *params, 547 struct snd_pcm_hw_params *params,
548 struct snd_soc_dai *dai) 548 struct snd_soc_dai *dai)
549{ 549{
550 struct snd_soc_pcm_runtime *rtd = substream->private_data; 550 struct snd_soc_codec *codec = dai->codec;
551 struct snd_soc_codec *codec = rtd->codec;
552 struct wm8750_priv *wm8750 = snd_soc_codec_get_drvdata(codec); 551 struct wm8750_priv *wm8750 = snd_soc_codec_get_drvdata(codec);
553 u16 iface = snd_soc_read(codec, WM8750_IFACE) & 0x1f3; 552 u16 iface = snd_soc_read(codec, WM8750_IFACE) & 0x1f3;
554 u16 srate = snd_soc_read(codec, WM8750_SRATE) & 0x1c0; 553 u16 srate = snd_soc_read(codec, WM8750_SRATE) & 0x1c0;
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index e27e7b62b365..a26482cd7654 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -931,8 +931,7 @@ static int wm8753_pcm_hw_params(struct snd_pcm_substream *substream,
931 struct snd_pcm_hw_params *params, 931 struct snd_pcm_hw_params *params,
932 struct snd_soc_dai *dai) 932 struct snd_soc_dai *dai)
933{ 933{
934 struct snd_soc_pcm_runtime *rtd = substream->private_data; 934 struct snd_soc_codec *codec = dai->codec;
935 struct snd_soc_codec *codec = rtd->codec;
936 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); 935 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
937 u16 voice = snd_soc_read(codec, WM8753_PCM) & 0x01f3; 936 u16 voice = snd_soc_read(codec, WM8753_PCM) & 0x01f3;
938 u16 srate = snd_soc_read(codec, WM8753_SRATE1) & 0x017f; 937 u16 srate = snd_soc_read(codec, WM8753_SRATE1) & 0x017f;
@@ -1161,8 +1160,7 @@ static int wm8753_i2s_hw_params(struct snd_pcm_substream *substream,
1161 struct snd_pcm_hw_params *params, 1160 struct snd_pcm_hw_params *params,
1162 struct snd_soc_dai *dai) 1161 struct snd_soc_dai *dai)
1163{ 1162{
1164 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1163 struct snd_soc_codec *codec = dai->codec;
1165 struct snd_soc_codec *codec = rtd->codec;
1166 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); 1164 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
1167 u16 srate = snd_soc_read(codec, WM8753_SRATE1) & 0x01c0; 1165 u16 srate = snd_soc_read(codec, WM8753_SRATE1) & 0x01c0;
1168 u16 hifi = snd_soc_read(codec, WM8753_HIFI) & 0x01f3; 1166 u16 hifi = snd_soc_read(codec, WM8753_HIFI) & 0x01f3;
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c
index f18c554efc98..077c9628c70d 100644
--- a/sound/soc/codecs/wm8900.c
+++ b/sound/soc/codecs/wm8900.c
@@ -610,8 +610,7 @@ static int wm8900_hw_params(struct snd_pcm_substream *substream,
610 struct snd_pcm_hw_params *params, 610 struct snd_pcm_hw_params *params,
611 struct snd_soc_dai *dai) 611 struct snd_soc_dai *dai)
612{ 612{
613 struct snd_soc_pcm_runtime *rtd = substream->private_data; 613 struct snd_soc_codec *codec = dai->codec;
614 struct snd_soc_codec *codec = rtd->codec;
615 u16 reg; 614 u16 reg;
616 615
617 reg = snd_soc_read(codec, WM8900_REG_AUDIO1) & ~0x60; 616 reg = snd_soc_read(codec, WM8900_REG_AUDIO1) & ~0x60;
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index c91fb2f99c13..86b8a2926591 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1432,8 +1432,7 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream,
1432 struct snd_pcm_hw_params *params, 1432 struct snd_pcm_hw_params *params,
1433 struct snd_soc_dai *dai) 1433 struct snd_soc_dai *dai)
1434{ 1434{
1435 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1435 struct snd_soc_codec *codec = dai->codec;
1436 struct snd_soc_codec *codec =rtd->codec;
1437 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); 1436 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
1438 int fs = params_rate(params); 1437 int fs = params_rate(params);
1439 int bclk; 1438 int bclk;
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index d2883affea3b..481a3d9cfe48 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -371,8 +371,7 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream,
371 struct snd_pcm_hw_params *params, 371 struct snd_pcm_hw_params *params,
372 struct snd_soc_dai *dai) 372 struct snd_soc_dai *dai)
373{ 373{
374 struct snd_soc_pcm_runtime *rtd = substream->private_data; 374 struct snd_soc_codec *codec = dai->codec;
375 struct snd_soc_codec *codec = rtd->codec;
376 u16 iface = snd_soc_read(codec, WM8940_IFACE) & 0xFD9F; 375 u16 iface = snd_soc_read(codec, WM8940_IFACE) & 0xFD9F;
377 u16 addcntrl = snd_soc_read(codec, WM8940_ADDCNTRL) & 0xFFF1; 376 u16 addcntrl = snd_soc_read(codec, WM8940_ADDCNTRL) & 0xFFF1;
378 u16 companding = snd_soc_read(codec, 377 u16 companding = snd_soc_read(codec,
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 840d72086d04..8bc659d8dd2e 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -505,8 +505,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
505 struct snd_pcm_hw_params *params, 505 struct snd_pcm_hw_params *params,
506 struct snd_soc_dai *dai) 506 struct snd_soc_dai *dai)
507{ 507{
508 struct snd_soc_pcm_runtime *rtd = substream->private_data; 508 struct snd_soc_codec *codec = dai->codec;
509 struct snd_soc_codec *codec = rtd->codec;
510 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); 509 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
511 u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3; 510 u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3;
512 int i; 511 int i;
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 507f479f4387..0cfce9999c89 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2532,8 +2532,7 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream,
2532 struct snd_pcm_hw_params *params, 2532 struct snd_pcm_hw_params *params,
2533 struct snd_soc_dai *dai) 2533 struct snd_soc_dai *dai)
2534{ 2534{
2535 struct snd_soc_pcm_runtime *rtd = substream->private_data; 2535 struct snd_soc_codec *codec = dai->codec;
2536 struct snd_soc_codec *codec = rtd->codec;
2537 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 2536 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
2538 int i; 2537 int i;
2539 int aif0 = 0; 2538 int aif0 = 0;
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c
index 28fe59e3ce01..eef783f6b6d6 100644
--- a/sound/soc/codecs/wm8971.c
+++ b/sound/soc/codecs/wm8971.c
@@ -478,8 +478,7 @@ static int wm8971_pcm_hw_params(struct snd_pcm_substream *substream,
478 struct snd_pcm_hw_params *params, 478 struct snd_pcm_hw_params *params,
479 struct snd_soc_dai *dai) 479 struct snd_soc_dai *dai)
480{ 480{
481 struct snd_soc_pcm_runtime *rtd = substream->private_data; 481 struct snd_soc_codec *codec = dai->codec;
482 struct snd_soc_codec *codec = rtd->codec;
483 struct wm8971_priv *wm8971 = snd_soc_codec_get_drvdata(codec); 482 struct wm8971_priv *wm8971 = snd_soc_codec_get_drvdata(codec);
484 u16 iface = snd_soc_read(codec, WM8971_IFACE) & 0x1f3; 483 u16 iface = snd_soc_read(codec, WM8971_IFACE) & 0x1f3;
485 u16 srate = snd_soc_read(codec, WM8971_SRATE) & 0x1c0; 484 u16 srate = snd_soc_read(codec, WM8971_SRATE) & 0x1c0;
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index 72d5fdcd3cc2..a5be3adecf75 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -723,8 +723,7 @@ static int wm8978_hw_params(struct snd_pcm_substream *substream,
723 struct snd_pcm_hw_params *params, 723 struct snd_pcm_hw_params *params,
724 struct snd_soc_dai *dai) 724 struct snd_soc_dai *dai)
725{ 725{
726 struct snd_soc_pcm_runtime *rtd = substream->private_data; 726 struct snd_soc_codec *codec = dai->codec;
727 struct snd_soc_codec *codec = rtd->codec;
728 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec); 727 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
729 /* Word length mask = 0x60 */ 728 /* Word length mask = 0x60 */
730 u16 iface_ctl = snd_soc_read(codec, WM8978_AUDIO_INTERFACE) & ~0x60; 729 u16 iface_ctl = snd_soc_read(codec, WM8978_AUDIO_INTERFACE) & ~0x60;
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index 6cdf6a2bc283..1d4c5cf47b06 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -668,8 +668,7 @@ static int wm8988_pcm_hw_params(struct snd_pcm_substream *substream,
668 struct snd_pcm_hw_params *params, 668 struct snd_pcm_hw_params *params,
669 struct snd_soc_dai *dai) 669 struct snd_soc_dai *dai)
670{ 670{
671 struct snd_soc_pcm_runtime *rtd = substream->private_data; 671 struct snd_soc_codec *codec = dai->codec;
672 struct snd_soc_codec *codec = rtd->codec;
673 struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec); 672 struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
674 u16 iface = snd_soc_read(codec, WM8988_IFACE) & 0x1f3; 673 u16 iface = snd_soc_read(codec, WM8988_IFACE) & 0x1f3;
675 u16 srate = snd_soc_read(codec, WM8988_SRATE) & 0x180; 674 u16 srate = snd_soc_read(codec, WM8988_SRATE) & 0x180;
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 9d242351e6e8..db63c97ddf51 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -1112,8 +1112,7 @@ static int wm8990_hw_params(struct snd_pcm_substream *substream,
1112 struct snd_pcm_hw_params *params, 1112 struct snd_pcm_hw_params *params,
1113 struct snd_soc_dai *dai) 1113 struct snd_soc_dai *dai)
1114{ 1114{
1115 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1115 struct snd_soc_codec *codec = dai->codec;
1116 struct snd_soc_codec *codec = rtd->codec;
1117 u16 audio1 = snd_soc_read(codec, WM8990_AUDIO_INTERFACE_1); 1116 u16 audio1 = snd_soc_read(codec, WM8990_AUDIO_INTERFACE_1);
1118 1117
1119 audio1 &= ~WM8990_AIF_WL_MASK; 1118 audio1 &= ~WM8990_AIF_WL_MASK;
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index cacc6a86b46f..7c095939c179 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -236,9 +236,7 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
236static int ac97_prepare(struct snd_pcm_substream *substream, 236static int ac97_prepare(struct snd_pcm_substream *substream,
237 struct snd_soc_dai *dai) 237 struct snd_soc_dai *dai)
238{ 238{
239 struct snd_pcm_runtime *runtime = substream->runtime; 239 struct snd_soc_codec *codec = dai->codec;
240 struct snd_soc_pcm_runtime *rtd = substream->private_data;
241 struct snd_soc_codec *codec = rtd->codec;
242 int reg; 240 int reg;
243 u16 vra; 241 u16 vra;
244 242
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index b342ae50bcd6..260386365d58 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -467,9 +467,7 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
467static int ac97_prepare(struct snd_pcm_substream *substream, 467static int ac97_prepare(struct snd_pcm_substream *substream,
468 struct snd_soc_dai *dai) 468 struct snd_soc_dai *dai)
469{ 469{
470 struct snd_pcm_runtime *runtime = substream->runtime; 470 struct snd_soc_codec *codec = dai->codec;
471 struct snd_soc_pcm_runtime *rtd = substream->private_data;
472 struct snd_soc_codec *codec =rtd->codec;
473 int reg; 471 int reg;
474 u16 vra; 472 u16 vra;
475 473
@@ -487,9 +485,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
487static int ac97_aux_prepare(struct snd_pcm_substream *substream, 485static int ac97_aux_prepare(struct snd_pcm_substream *substream,
488 struct snd_soc_dai *dai) 486 struct snd_soc_dai *dai)
489{ 487{
490 struct snd_pcm_runtime *runtime = substream->runtime; 488 struct snd_soc_codec *codec = dai->codec;
491 struct snd_soc_pcm_runtime *rtd = substream->private_data;
492 struct snd_soc_codec *codec = rtd->codec;
493 u16 vra, xsle; 489 u16 vra, xsle;
494 490
495 vra = ac97_read(codec, AC97_EXTENDED_STATUS); 491 vra = ac97_read(codec, AC97_EXTENDED_STATUS);