diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-03-13 16:24:54 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-18 08:47:49 -0400 |
commit | ab64246cf8c31f70a390dcabd134097c3aec45ab (patch) | |
tree | 5b339a01f4a9e50b3547c3fd64dd66c3680d2127 | |
parent | dac7e40404a6b1e7442c01ef4c2e7e149b9627e5 (diff) |
ASoC: codecs: Replace instances of rtd->codec with dai->codec
With CODEC to CODEC links rtd->codec does not necessarily point to the driver's
CODEC. CODEC drivers should always use dai->codec and never even look at the PCM
runtime.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/isabelle.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/mc13783.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/rt5640.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/sta529.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic31xx.c | 5 | ||||
-rw-r--r-- | sound/soc/codecs/uda134x.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/uda1380.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm8580.c | 3 |
8 files changed, 10 insertions, 19 deletions
diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c index 5839048ec467..7c8ba02a6d1b 100644 --- a/sound/soc/codecs/isabelle.c +++ b/sound/soc/codecs/isabelle.c | |||
@@ -910,8 +910,7 @@ static int isabelle_hw_params(struct snd_pcm_substream *substream, | |||
910 | struct snd_pcm_hw_params *params, | 910 | struct snd_pcm_hw_params *params, |
911 | struct snd_soc_dai *dai) | 911 | struct snd_soc_dai *dai) |
912 | { | 912 | { |
913 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 913 | struct snd_soc_codec *codec = dai->codec; |
914 | struct snd_soc_codec *codec = rtd->codec; | ||
915 | u16 aif = 0; | 914 | u16 aif = 0; |
916 | unsigned int fs_val = 0; | 915 | unsigned int fs_val = 0; |
917 | 916 | ||
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index 582c2bbd42cb..bebba7fb8819 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c | |||
@@ -106,8 +106,7 @@ static int mc13783_pcm_hw_params_dac(struct snd_pcm_substream *substream, | |||
106 | struct snd_pcm_hw_params *params, | 106 | struct snd_pcm_hw_params *params, |
107 | struct snd_soc_dai *dai) | 107 | struct snd_soc_dai *dai) |
108 | { | 108 | { |
109 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 109 | struct snd_soc_codec *codec = dai->codec; |
110 | struct snd_soc_codec *codec = rtd->codec; | ||
111 | unsigned int rate = params_rate(params); | 110 | unsigned int rate = params_rate(params); |
112 | int i; | 111 | int i; |
113 | 112 | ||
@@ -126,8 +125,7 @@ static int mc13783_pcm_hw_params_codec(struct snd_pcm_substream *substream, | |||
126 | struct snd_pcm_hw_params *params, | 125 | struct snd_pcm_hw_params *params, |
127 | struct snd_soc_dai *dai) | 126 | struct snd_soc_dai *dai) |
128 | { | 127 | { |
129 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 128 | struct snd_soc_codec *codec = dai->codec; |
130 | struct snd_soc_codec *codec = rtd->codec; | ||
131 | unsigned int rate = params_rate(params); | 129 | unsigned int rate = params_rate(params); |
132 | unsigned int val; | 130 | unsigned int val; |
133 | 131 | ||
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index a3fb41179636..7877a5e14c54 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c | |||
@@ -1601,8 +1601,7 @@ static int get_clk_info(int sclk, int rate) | |||
1601 | static int rt5640_hw_params(struct snd_pcm_substream *substream, | 1601 | static int rt5640_hw_params(struct snd_pcm_substream *substream, |
1602 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) | 1602 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) |
1603 | { | 1603 | { |
1604 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 1604 | struct snd_soc_codec *codec = dai->codec; |
1605 | struct snd_soc_codec *codec = rtd->codec; | ||
1606 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); | 1605 | struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); |
1607 | unsigned int val_len = 0, val_clk, mask_clk; | 1606 | unsigned int val_len = 0, val_clk, mask_clk; |
1608 | int dai_sel, pre_div, bclk_ms, frame_size; | 1607 | int dai_sel, pre_div, bclk_ms, frame_size; |
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index 40c07be9b581..fa4b050fe6e6 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c | |||
@@ -193,8 +193,7 @@ static int sta529_hw_params(struct snd_pcm_substream *substream, | |||
193 | struct snd_pcm_hw_params *params, | 193 | struct snd_pcm_hw_params *params, |
194 | struct snd_soc_dai *dai) | 194 | struct snd_soc_dai *dai) |
195 | { | 195 | { |
196 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 196 | struct snd_soc_codec *codec = dai->codec; |
197 | struct snd_soc_codec *codec = rtd->codec; | ||
198 | int pdata, play_freq_val, record_freq_val; | 197 | int pdata, play_freq_val, record_freq_val; |
199 | int bclk_to_fs_ratio; | 198 | int bclk_to_fs_ratio; |
200 | 199 | ||
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index e463ae7fe1f4..fa158cfe9b32 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c | |||
@@ -753,10 +753,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, | |||
753 | 753 | ||
754 | static int aic31xx_hw_params(struct snd_pcm_substream *substream, | 754 | static int aic31xx_hw_params(struct snd_pcm_substream *substream, |
755 | struct snd_pcm_hw_params *params, | 755 | struct snd_pcm_hw_params *params, |
756 | struct snd_soc_dai *tmp) | 756 | struct snd_soc_dai *dai) |
757 | { | 757 | { |
758 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 758 | struct snd_soc_codec *codec = dai->codec; |
759 | struct snd_soc_codec *codec = rtd->codec; | ||
760 | u8 data = 0; | 759 | u8 data = 0; |
761 | 760 | ||
762 | dev_dbg(codec->dev, "## %s: format %d width %d rate %d\n", | 761 | dev_dbg(codec->dev, "## %s: format %d width %d rate %d\n", |
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index c94d4c1e3dac..edf27acc1d77 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c | |||
@@ -203,8 +203,7 @@ static int uda134x_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 uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); | 207 | struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); |
209 | u8 hw_params; | 208 | u8 hw_params; |
210 | 209 | ||
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 726df6d43c2b..dc47f6f5cd83 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -564,8 +564,7 @@ static int uda1380_pcm_hw_params(struct snd_pcm_substream *substream, | |||
564 | static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream, | 564 | static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream, |
565 | struct snd_soc_dai *dai) | 565 | struct snd_soc_dai *dai) |
566 | { | 566 | { |
567 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 567 | struct snd_soc_codec *codec = dai->codec; |
568 | struct snd_soc_codec *codec = rtd->codec; | ||
569 | u16 clk = uda1380_read_reg_cache(codec, UDA1380_CLK); | 568 | u16 clk = uda1380_read_reg_cache(codec, UDA1380_CLK); |
570 | 569 | ||
571 | /* shut down WSPLL power if running from this clock */ | 570 | /* shut down WSPLL power if running from this clock */ |
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 318989acbbe5..49c2869b681c 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -504,8 +504,7 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, | |||
504 | struct snd_pcm_hw_params *params, | 504 | struct snd_pcm_hw_params *params, |
505 | struct snd_soc_dai *dai) | 505 | struct snd_soc_dai *dai) |
506 | { | 506 | { |
507 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 507 | struct snd_soc_codec *codec = dai->codec; |
508 | struct snd_soc_codec *codec = rtd->codec; | ||
509 | struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); | 508 | struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); |
510 | u16 paifa = 0; | 509 | u16 paifa = 0; |
511 | u16 paifb = 0; | 510 | u16 paifb = 0; |