diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2017-12-04 23:24:28 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-12-05 07:44:52 -0500 |
commit | f4a2be1c559e53e31545bdea2c246dbce6b70e1c (patch) | |
tree | f60cd798d7e424ae4f7414519a838803c283fa55 | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
ASoC: don't use rtd->codec on samsung/bells
rtd->codec will be removed soon.
rtd->codec = rtd->codec_dai->codec, thus,
we can use rtd->codec_dai->component instead of it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/samsung/bells.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c index 34deba461ae1..0e66cd8ef2f9 100644 --- a/sound/soc/samsung/bells.c +++ b/sound/soc/samsung/bells.c | |||
@@ -60,13 +60,13 @@ static int bells_set_bias_level(struct snd_soc_card *card, | |||
60 | { | 60 | { |
61 | struct snd_soc_pcm_runtime *rtd; | 61 | struct snd_soc_pcm_runtime *rtd; |
62 | struct snd_soc_dai *codec_dai; | 62 | struct snd_soc_dai *codec_dai; |
63 | struct snd_soc_codec *codec; | 63 | struct snd_soc_component *component; |
64 | struct bells_drvdata *bells = card->drvdata; | 64 | struct bells_drvdata *bells = card->drvdata; |
65 | int ret; | 65 | int ret; |
66 | 66 | ||
67 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); | 67 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); |
68 | codec_dai = rtd->codec_dai; | 68 | codec_dai = rtd->codec_dai; |
69 | codec = codec_dai->codec; | 69 | component = codec_dai->component; |
70 | 70 | ||
71 | if (dapm->dev != codec_dai->dev) | 71 | if (dapm->dev != codec_dai->dev) |
72 | return 0; | 72 | return 0; |
@@ -76,7 +76,7 @@ static int bells_set_bias_level(struct snd_soc_card *card, | |||
76 | if (dapm->bias_level != SND_SOC_BIAS_STANDBY) | 76 | if (dapm->bias_level != SND_SOC_BIAS_STANDBY) |
77 | break; | 77 | break; |
78 | 78 | ||
79 | ret = snd_soc_codec_set_pll(codec, WM5102_FLL1, | 79 | ret = snd_soc_component_set_pll(component, WM5102_FLL1, |
80 | ARIZONA_FLL_SRC_MCLK1, | 80 | ARIZONA_FLL_SRC_MCLK1, |
81 | MCLK_RATE, | 81 | MCLK_RATE, |
82 | bells->sysclk_rate); | 82 | bells->sysclk_rate); |
@@ -84,7 +84,7 @@ static int bells_set_bias_level(struct snd_soc_card *card, | |||
84 | pr_err("Failed to start FLL: %d\n", ret); | 84 | pr_err("Failed to start FLL: %d\n", ret); |
85 | 85 | ||
86 | if (bells->asyncclk_rate) { | 86 | if (bells->asyncclk_rate) { |
87 | ret = snd_soc_codec_set_pll(codec, WM5102_FLL2, | 87 | ret = snd_soc_component_set_pll(component, WM5102_FLL2, |
88 | ARIZONA_FLL_SRC_AIF2BCLK, | 88 | ARIZONA_FLL_SRC_AIF2BCLK, |
89 | BCLK2_RATE, | 89 | BCLK2_RATE, |
90 | bells->asyncclk_rate); | 90 | bells->asyncclk_rate); |
@@ -106,27 +106,27 @@ static int bells_set_bias_level_post(struct snd_soc_card *card, | |||
106 | { | 106 | { |
107 | struct snd_soc_pcm_runtime *rtd; | 107 | struct snd_soc_pcm_runtime *rtd; |
108 | struct snd_soc_dai *codec_dai; | 108 | struct snd_soc_dai *codec_dai; |
109 | struct snd_soc_codec *codec; | 109 | struct snd_soc_component *component; |
110 | struct bells_drvdata *bells = card->drvdata; | 110 | struct bells_drvdata *bells = card->drvdata; |
111 | int ret; | 111 | int ret; |
112 | 112 | ||
113 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); | 113 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); |
114 | codec_dai = rtd->codec_dai; | 114 | codec_dai = rtd->codec_dai; |
115 | codec = codec_dai->codec; | 115 | component = codec_dai->component; |
116 | 116 | ||
117 | if (dapm->dev != codec_dai->dev) | 117 | if (dapm->dev != codec_dai->dev) |
118 | return 0; | 118 | return 0; |
119 | 119 | ||
120 | switch (level) { | 120 | switch (level) { |
121 | case SND_SOC_BIAS_STANDBY: | 121 | case SND_SOC_BIAS_STANDBY: |
122 | ret = snd_soc_codec_set_pll(codec, WM5102_FLL1, 0, 0, 0); | 122 | ret = snd_soc_component_set_pll(component, WM5102_FLL1, 0, 0, 0); |
123 | if (ret < 0) { | 123 | if (ret < 0) { |
124 | pr_err("Failed to stop FLL: %d\n", ret); | 124 | pr_err("Failed to stop FLL: %d\n", ret); |
125 | return ret; | 125 | return ret; |
126 | } | 126 | } |
127 | 127 | ||
128 | if (bells->asyncclk_rate) { | 128 | if (bells->asyncclk_rate) { |
129 | ret = snd_soc_codec_set_pll(codec, WM5102_FLL2, | 129 | ret = snd_soc_component_set_pll(component, WM5102_FLL2, |
130 | 0, 0, 0); | 130 | 0, 0, 0); |
131 | if (ret < 0) { | 131 | if (ret < 0) { |
132 | pr_err("Failed to stop FLL: %d\n", ret); | 132 | pr_err("Failed to stop FLL: %d\n", ret); |
@@ -148,8 +148,8 @@ static int bells_late_probe(struct snd_soc_card *card) | |||
148 | { | 148 | { |
149 | struct bells_drvdata *bells = card->drvdata; | 149 | struct bells_drvdata *bells = card->drvdata; |
150 | struct snd_soc_pcm_runtime *rtd; | 150 | struct snd_soc_pcm_runtime *rtd; |
151 | struct snd_soc_codec *wm0010; | 151 | struct snd_soc_component *wm0010; |
152 | struct snd_soc_codec *codec; | 152 | struct snd_soc_component *component; |
153 | struct snd_soc_dai *aif1_dai; | 153 | struct snd_soc_dai *aif1_dai; |
154 | struct snd_soc_dai *aif2_dai; | 154 | struct snd_soc_dai *aif2_dai; |
155 | struct snd_soc_dai *aif3_dai; | 155 | struct snd_soc_dai *aif3_dai; |
@@ -157,22 +157,22 @@ static int bells_late_probe(struct snd_soc_card *card) | |||
157 | int ret; | 157 | int ret; |
158 | 158 | ||
159 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_AP_DSP].name); | 159 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_AP_DSP].name); |
160 | wm0010 = rtd->codec; | 160 | wm0010 = rtd->codec_dai->component; |
161 | 161 | ||
162 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); | 162 | rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); |
163 | codec = rtd->codec; | 163 | component = rtd->codec_dai->component; |
164 | aif1_dai = rtd->codec_dai; | 164 | aif1_dai = rtd->codec_dai; |
165 | 165 | ||
166 | ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_SYSCLK, | 166 | ret = snd_soc_component_set_sysclk(component, ARIZONA_CLK_SYSCLK, |
167 | ARIZONA_CLK_SRC_FLL1, | 167 | ARIZONA_CLK_SRC_FLL1, |
168 | bells->sysclk_rate, | 168 | bells->sysclk_rate, |
169 | SND_SOC_CLOCK_IN); | 169 | SND_SOC_CLOCK_IN); |
170 | if (ret != 0) { | 170 | if (ret != 0) { |
171 | dev_err(codec->dev, "Failed to set SYSCLK: %d\n", ret); | 171 | dev_err(component->dev, "Failed to set SYSCLK: %d\n", ret); |
172 | return ret; | 172 | return ret; |
173 | } | 173 | } |
174 | 174 | ||
175 | ret = snd_soc_codec_set_sysclk(wm0010, 0, 0, SYS_MCLK_RATE, 0); | 175 | ret = snd_soc_component_set_sysclk(wm0010, 0, 0, SYS_MCLK_RATE, 0); |
176 | if (ret != 0) { | 176 | if (ret != 0) { |
177 | dev_err(wm0010->dev, "Failed to set WM0010 clock: %d\n", ret); | 177 | dev_err(wm0010->dev, "Failed to set WM0010 clock: %d\n", ret); |
178 | return ret; | 178 | return ret; |
@@ -182,20 +182,20 @@ static int bells_late_probe(struct snd_soc_card *card) | |||
182 | if (ret != 0) | 182 | if (ret != 0) |
183 | dev_err(aif1_dai->dev, "Failed to set AIF1 clock: %d\n", ret); | 183 | dev_err(aif1_dai->dev, "Failed to set AIF1 clock: %d\n", ret); |
184 | 184 | ||
185 | ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_OPCLK, 0, | 185 | ret = snd_soc_component_set_sysclk(component, ARIZONA_CLK_OPCLK, 0, |
186 | SYS_MCLK_RATE, SND_SOC_CLOCK_OUT); | 186 | SYS_MCLK_RATE, SND_SOC_CLOCK_OUT); |
187 | if (ret != 0) | 187 | if (ret != 0) |
188 | dev_err(codec->dev, "Failed to set OPCLK: %d\n", ret); | 188 | dev_err(component->dev, "Failed to set OPCLK: %d\n", ret); |
189 | 189 | ||
190 | if (card->num_rtd == DAI_CODEC_CP) | 190 | if (card->num_rtd == DAI_CODEC_CP) |
191 | return 0; | 191 | return 0; |
192 | 192 | ||
193 | ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_ASYNCCLK, | 193 | ret = snd_soc_component_set_sysclk(component, ARIZONA_CLK_ASYNCCLK, |
194 | ARIZONA_CLK_SRC_FLL2, | 194 | ARIZONA_CLK_SRC_FLL2, |
195 | bells->asyncclk_rate, | 195 | bells->asyncclk_rate, |
196 | SND_SOC_CLOCK_IN); | 196 | SND_SOC_CLOCK_IN); |
197 | if (ret != 0) { | 197 | if (ret != 0) { |
198 | dev_err(codec->dev, "Failed to set ASYNCCLK: %d\n", ret); | 198 | dev_err(component->dev, "Failed to set ASYNCCLK: %d\n", ret); |
199 | return ret; | 199 | return ret; |
200 | } | 200 | } |
201 | 201 | ||
@@ -221,7 +221,7 @@ static int bells_late_probe(struct snd_soc_card *card) | |||
221 | return ret; | 221 | return ret; |
222 | } | 222 | } |
223 | 223 | ||
224 | ret = snd_soc_codec_set_sysclk(wm9081_dai->codec, WM9081_SYSCLK_MCLK, | 224 | ret = snd_soc_component_set_sysclk(wm9081_dai->component, WM9081_SYSCLK_MCLK, |
225 | 0, SYS_MCLK_RATE, 0); | 225 | 0, SYS_MCLK_RATE, 0); |
226 | if (ret != 0) { | 226 | if (ret != 0) { |
227 | dev_err(wm9081_dai->dev, "Failed to set MCLK: %d\n", ret); | 227 | dev_err(wm9081_dai->dev, "Failed to set MCLK: %d\n", ret); |