aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx
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/s3c24xx
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/s3c24xx')
-rw-r--r--sound/soc/s3c24xx/neo1973_wm8753.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
index 51a4ce3dbd19..4d7a9aa15f1a 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -108,44 +108,44 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
108 } 108 }
109 109
110 /* set codec DAI configuration */ 110 /* set codec DAI configuration */
111 ret = codec_dai->dai_ops.set_fmt(codec_dai, 111 ret = snd_soc_dai_set_fmt(codec_dai,
112 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 112 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
113 SND_SOC_DAIFMT_CBM_CFM); 113 SND_SOC_DAIFMT_CBM_CFM);
114 if (ret < 0) 114 if (ret < 0)
115 return ret; 115 return ret;
116 116
117 /* set cpu DAI configuration */ 117 /* set cpu DAI configuration */
118 ret = cpu_dai->dai_ops.set_fmt(cpu_dai, 118 ret = snd_soc_dai_set_fmt(cpu_dai,
119 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 119 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
120 SND_SOC_DAIFMT_CBM_CFM); 120 SND_SOC_DAIFMT_CBM_CFM);
121 if (ret < 0) 121 if (ret < 0)
122 return ret; 122 return ret;
123 123
124 /* set the codec system clock for DAC and ADC */ 124 /* set the codec system clock for DAC and ADC */
125 ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8753_MCLK, pll_out, 125 ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_MCLK, pll_out,
126 SND_SOC_CLOCK_IN); 126 SND_SOC_CLOCK_IN);
127 if (ret < 0) 127 if (ret < 0)
128 return ret; 128 return ret;
129 129
130 /* set MCLK division for sample rate */ 130 /* set MCLK division for sample rate */
131 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, 131 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK,
132 S3C2410_IISMOD_32FS); 132 S3C2410_IISMOD_32FS);
133 if (ret < 0) 133 if (ret < 0)
134 return ret; 134 return ret;
135 135
136 /* set codec BCLK division for sample rate */ 136 /* set codec BCLK division for sample rate */
137 ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8753_BCLKDIV, bclk); 137 ret = snd_soc_dai_set_clkdiv(codec_dai, WM8753_BCLKDIV, bclk);
138 if (ret < 0) 138 if (ret < 0)
139 return ret; 139 return ret;
140 140
141 /* set prescaler division for sample rate */ 141 /* set prescaler division for sample rate */
142 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER, 142 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER,
143 S3C24XX_PRESCALE(4, 4)); 143 S3C24XX_PRESCALE(4, 4));
144 if (ret < 0) 144 if (ret < 0)
145 return ret; 145 return ret;
146 146
147 /* codec PLL input is PCLK/4 */ 147 /* codec PLL input is PCLK/4 */
148 ret = codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, 148 ret = snd_soc_dai_set_pll(codec_dai, WM8753_PLL1,
149 iis_clkrate / 4, pll_out); 149 iis_clkrate / 4, pll_out);
150 if (ret < 0) 150 if (ret < 0)
151 return ret; 151 return ret;
@@ -161,7 +161,7 @@ static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream)
161 DBG("Entered %s\n", __func__); 161 DBG("Entered %s\n", __func__);
162 162
163 /* disable the PLL */ 163 /* disable the PLL */
164 return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, 0, 0); 164 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL1, 0, 0);
165} 165}
166 166
167/* 167/*
@@ -194,24 +194,24 @@ static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
194 194
195 /* todo: gg check mode (DSP_B) against CSR datasheet */ 195 /* todo: gg check mode (DSP_B) against CSR datasheet */
196 /* set codec DAI configuration */ 196 /* set codec DAI configuration */
197 ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | 197 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B |
198 SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); 198 SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
199 if (ret < 0) 199 if (ret < 0)
200 return ret; 200 return ret;
201 201
202 /* set the codec system clock for DAC and ADC */ 202 /* set the codec system clock for DAC and ADC */
203 ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8753_PCMCLK, 12288000, 203 ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_PCMCLK, 12288000,
204 SND_SOC_CLOCK_IN); 204 SND_SOC_CLOCK_IN);
205 if (ret < 0) 205 if (ret < 0)
206 return ret; 206 return ret;
207 207
208 /* set codec PCM division for sample rate */ 208 /* set codec PCM division for sample rate */
209 ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8753_PCMDIV, pcmdiv); 209 ret = snd_soc_dai_set_clkdiv(codec_dai, WM8753_PCMDIV, pcmdiv);
210 if (ret < 0) 210 if (ret < 0)
211 return ret; 211 return ret;
212 212
213 /* configue and enable PLL for 12.288MHz output */ 213 /* configue and enable PLL for 12.288MHz output */
214 ret = codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, 214 ret = snd_soc_dai_set_pll(codec_dai, WM8753_PLL2,
215 iis_clkrate / 4, 12288000); 215 iis_clkrate / 4, 12288000);
216 if (ret < 0) 216 if (ret < 0)
217 return ret; 217 return ret;
@@ -227,7 +227,7 @@ static int neo1973_voice_hw_free(struct snd_pcm_substream *substream)
227 DBG("Entered %s\n", __func__); 227 DBG("Entered %s\n", __func__);
228 228
229 /* disable the PLL */ 229 /* disable the PLL */
230 return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, 0, 0); 230 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0, 0);
231} 231}
232 232
233static struct snd_soc_ops neo1973_voice_ops = { 233static struct snd_soc_ops neo1973_voice_ops = {