aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/at32/playpaq_wm8510.c
diff options
context:
space:
mode:
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>2008-07-08 08:19:18 -0400
committerJaroslav Kysela <perex@perex.cz>2008-07-10 03:32:51 -0400
commit64105cfd65df74fdf82c1d053b2c9953304a94ea (patch)
treeaf420baafa02afd0a6292dbe93e2c5fff65850b2 /sound/soc/at32/playpaq_wm8510.c
parent8c6529dbf881303920a415c2d14a500218661949 (diff)
ALSA: asoc: machines - add Digital Audio Interface (DAI) control functions.
This patch adds several functions for DAI control and config and replaces the current method of calling function pointers within the DAI struct within the machine drivers. Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc/at32/playpaq_wm8510.c')
-rw-r--r--sound/soc/at32/playpaq_wm8510.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/soc/at32/playpaq_wm8510.c b/sound/soc/at32/playpaq_wm8510.c
index 18ac7d7391c..fd62f256975 100644
--- a/sound/soc/at32/playpaq_wm8510.c
+++ b/sound/soc/at32/playpaq_wm8510.c
@@ -210,14 +210,14 @@ static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream,
210 /* 210 /*
211 * set CPU and CODEC DAI configuration 211 * set CPU and CODEC DAI configuration
212 */ 212 */
213 ret = codec_dai->dai_ops.set_fmt(codec_dai, fmt); 213 ret = snd_soc_dai_set_fmt(codec_dai, fmt);
214 if (ret < 0) { 214 if (ret < 0) {
215 pr_warning("playpaq_wm8510: " 215 pr_warning("playpaq_wm8510: "
216 "Failed to set CODEC DAI format (%d)\n", 216 "Failed to set CODEC DAI format (%d)\n",
217 ret); 217 ret);
218 return ret; 218 return ret;
219 } 219 }
220 ret = cpu_dai->dai_ops.set_fmt(cpu_dai, fmt); 220 ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
221 if (ret < 0) { 221 if (ret < 0) {
222 pr_warning("playpaq_wm8510: " 222 pr_warning("playpaq_wm8510: "
223 "Failed to set CPU DAI format (%d)\n", 223 "Failed to set CPU DAI format (%d)\n",
@@ -233,14 +233,13 @@ static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream,
233 cd = playpaq_wm8510_calc_ssc_clock(params, cpu_dai); 233 cd = playpaq_wm8510_calc_ssc_clock(params, cpu_dai);
234 pr_debug("playpaq_wm8510: cmr_div = %d, period = %d\n", 234 pr_debug("playpaq_wm8510: cmr_div = %d, period = %d\n",
235 cd.cmr_div, cd.period); 235 cd.cmr_div, cd.period);
236 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, 236 ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_CMR_DIV, cd.cmr_div);
237 AT32_SSC_CMR_DIV, cd.cmr_div);
238 if (ret < 0) { 237 if (ret < 0) {
239 pr_warning("playpaq_wm8510: Failed to set CPU CMR_DIV (%d)\n", 238 pr_warning("playpaq_wm8510: Failed to set CPU CMR_DIV (%d)\n",
240 ret); 239 ret);
241 return ret; 240 return ret;
242 } 241 }
243 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, AT32_SSC_TCMR_PERIOD, 242 ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_TCMR_PERIOD,
244 cd.period); 243 cd.period);
245 if (ret < 0) { 244 if (ret < 0) {
246 pr_warning("playpaq_wm8510: " 245 pr_warning("playpaq_wm8510: "
@@ -260,7 +259,7 @@ static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream,
260 259
261 260
262#if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE 261#if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
263 ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8510_BCLKDIV, bclk); 262 ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_BCLKDIV, bclk);
264 if (ret < 0) { 263 if (ret < 0) {
265 pr_warning 264 pr_warning
266 ("playpaq_wm8510: Failed to set CODEC DAI BCLKDIV (%d)\n", 265 ("playpaq_wm8510: Failed to set CODEC DAI BCLKDIV (%d)\n",
@@ -270,7 +269,7 @@ static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream,
270#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */ 269#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */
271 270
272 271
273 ret = codec_dai->dai_ops.set_pll(codec_dai, 0, 272 ret = snd_soc_dai_set_pll(codec_dai, 0,
274 clk_get_rate(CODEC_CLK), pll_out); 273 clk_get_rate(CODEC_CLK), pll_out);
275 if (ret < 0) { 274 if (ret < 0) {
276 pr_warning("playpaq_wm8510: Failed to set CODEC DAI PLL (%d)\n", 275 pr_warning("playpaq_wm8510: Failed to set CODEC DAI PLL (%d)\n",
@@ -279,8 +278,7 @@ static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream,
279 } 278 }
280 279
281 280
282 ret = codec_dai->dai_ops.set_clkdiv(codec_dai, 281 ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_MCLKDIV, mclk_div);
283 WM8510_MCLKDIV, mclk_div);
284 if (ret < 0) { 282 if (ret < 0) {
285 pr_warning("playpaq_wm8510: Failed to set CODEC MCLKDIV (%d)\n", 283 pr_warning("playpaq_wm8510: Failed to set CODEC MCLKDIV (%d)\n",
286 ret); 284 ret);