diff options
author | Liam Girdwood <lg@opensource.wolfsonmicro.com> | 2008-07-08 08:19:18 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-07-10 03:32:51 -0400 |
commit | 64105cfd65df74fdf82c1d053b2c9953304a94ea (patch) | |
tree | af420baafa02afd0a6292dbe93e2c5fff65850b2 /sound | |
parent | 8c6529dbf881303920a415c2d14a500218661949 (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')
-rw-r--r-- | sound/soc/at32/playpaq_wm8510.c | 16 | ||||
-rw-r--r-- | sound/soc/at91/eti_b1_wm8731.c | 18 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-evm.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/mpc8610_hpcd.c | 58 | ||||
-rw-r--r-- | sound/soc/omap/n810.c | 6 | ||||
-rw-r--r-- | sound/soc/pxa/corgi.c | 8 | ||||
-rw-r--r-- | sound/soc/pxa/poodle.c | 8 | ||||
-rw-r--r-- | sound/soc/pxa/spitz.c | 8 | ||||
-rw-r--r-- | sound/soc/s3c24xx/neo1973_wm8753.c | 26 |
9 files changed, 71 insertions, 83 deletions
diff --git a/sound/soc/at32/playpaq_wm8510.c b/sound/soc/at32/playpaq_wm8510.c index 18ac7d7391c1..fd62f2569758 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); |
diff --git a/sound/soc/at91/eti_b1_wm8731.c b/sound/soc/at91/eti_b1_wm8731.c index 9d4213963c26..d532de954241 100644 --- a/sound/soc/at91/eti_b1_wm8731.c +++ b/sound/soc/at91/eti_b1_wm8731.c | |||
@@ -58,13 +58,13 @@ static int eti_b1_startup(struct snd_pcm_substream *substream) | |||
58 | int ret; | 58 | int ret; |
59 | 59 | ||
60 | /* cpu clock is the AT91 master clock sent to the SSC */ | 60 | /* cpu clock is the AT91 master clock sent to the SSC */ |
61 | ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, AT91_SYSCLK_MCK, | 61 | ret = snd_soc_dai_set_sysclk(cpu_dai, AT91_SYSCLK_MCK, |
62 | 60000000, SND_SOC_CLOCK_IN); | 62 | 60000000, SND_SOC_CLOCK_IN); |
63 | if (ret < 0) | 63 | if (ret < 0) |
64 | return ret; | 64 | return ret; |
65 | 65 | ||
66 | /* codec system clock is supplied by PCK1, set to 12MHz */ | 66 | /* codec system clock is supplied by PCK1, set to 12MHz */ |
67 | ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8731_SYSCLK, | 67 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK, |
68 | 12000000, SND_SOC_CLOCK_IN); | 68 | 12000000, SND_SOC_CLOCK_IN); |
69 | if (ret < 0) | 69 | if (ret < 0) |
70 | return ret; | 70 | return ret; |
@@ -96,13 +96,13 @@ static int eti_b1_hw_params(struct snd_pcm_substream *substream, | |||
96 | int cmr_div, period; | 96 | int cmr_div, period; |
97 | 97 | ||
98 | /* set codec DAI configuration */ | 98 | /* set codec DAI configuration */ |
99 | ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | 99 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | |
100 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 100 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
101 | if (ret < 0) | 101 | if (ret < 0) |
102 | return ret; | 102 | return ret; |
103 | 103 | ||
104 | /* set cpu DAI configuration */ | 104 | /* set cpu DAI configuration */ |
105 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | 105 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | |
106 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 106 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
107 | if (ret < 0) | 107 | if (ret < 0) |
108 | return ret; | 108 | return ret; |
@@ -141,17 +141,17 @@ static int eti_b1_hw_params(struct snd_pcm_substream *substream, | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /* set the MCK divider for BCLK */ | 143 | /* set the MCK divider for BCLK */ |
144 | ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, AT91SSC_CMR_DIV, cmr_div); | 144 | ret = snd_soc_dai_set_clkdiv(cpu_dai, AT91SSC_CMR_DIV, cmr_div); |
145 | if (ret < 0) | 145 | if (ret < 0) |
146 | return ret; | 146 | return ret; |
147 | 147 | ||
148 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 148 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
149 | /* set the BCLK divider for DACLRC */ | 149 | /* set the BCLK divider for DACLRC */ |
150 | ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, | 150 | ret = snd_soc_dai_set_clkdiv(cpu_dai, |
151 | AT91SSC_TCMR_PERIOD, period); | 151 | AT91SSC_TCMR_PERIOD, period); |
152 | } else { | 152 | } else { |
153 | /* set the BCLK divider for ADCLRC */ | 153 | /* set the BCLK divider for ADCLRC */ |
154 | ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, | 154 | ret = snd_soc_dai_set_clkdiv(cpu_dai, |
155 | AT91SSC_RCMR_PERIOD, period); | 155 | AT91SSC_RCMR_PERIOD, period); |
156 | } | 156 | } |
157 | if (ret < 0) | 157 | if (ret < 0) |
@@ -163,13 +163,13 @@ static int eti_b1_hw_params(struct snd_pcm_substream *substream, | |||
163 | */ | 163 | */ |
164 | 164 | ||
165 | /* set codec DAI configuration */ | 165 | /* set codec DAI configuration */ |
166 | ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | 166 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | |
167 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | 167 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); |
168 | if (ret < 0) | 168 | if (ret < 0) |
169 | return ret; | 169 | return ret; |
170 | 170 | ||
171 | /* set cpu DAI configuration */ | 171 | /* set cpu DAI configuration */ |
172 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | 172 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | |
173 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | 173 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); |
174 | if (ret < 0) | 174 | if (ret < 0) |
175 | return ret; | 175 | return ret; |
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 4249e6a85743..5e2c306399ed 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c | |||
@@ -38,19 +38,19 @@ static int evm_hw_params(struct snd_pcm_substream *substream, | |||
38 | int ret = 0; | 38 | int ret = 0; |
39 | 39 | ||
40 | /* set codec DAI configuration */ | 40 | /* set codec DAI configuration */ |
41 | ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | 41 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | |
42 | SND_SOC_DAIFMT_CBM_CFM); | 42 | SND_SOC_DAIFMT_CBM_CFM); |
43 | if (ret < 0) | 43 | if (ret < 0) |
44 | return ret; | 44 | return ret; |
45 | 45 | ||
46 | /* set cpu DAI configuration */ | 46 | /* set cpu DAI configuration */ |
47 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_CBM_CFM | | 47 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_CBM_CFM | |
48 | SND_SOC_DAIFMT_IB_NF); | 48 | SND_SOC_DAIFMT_IB_NF); |
49 | if (ret < 0) | 49 | if (ret < 0) |
50 | return ret; | 50 | return ret; |
51 | 51 | ||
52 | /* set the codec system clock */ | 52 | /* set the codec system clock */ |
53 | ret = codec_dai->dai_ops.set_sysclk(codec_dai, 0, EVM_CODEC_CLOCK, | 53 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, EVM_CODEC_CLOCK, |
54 | SND_SOC_CLOCK_OUT); | 54 | SND_SOC_CLOCK_OUT); |
55 | if (ret < 0) | 55 | if (ret < 0) |
56 | return ret; | 56 | return ret; |
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 59d7e49bd661..4bdc9d8fc90e 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -103,55 +103,45 @@ static int mpc8610_hpcd_startup(struct snd_pcm_substream *substream) | |||
103 | int ret = 0; | 103 | int ret = 0; |
104 | 104 | ||
105 | /* Tell the CPU driver what the serial protocol is. */ | 105 | /* Tell the CPU driver what the serial protocol is. */ |
106 | if (cpu_dai->dai_ops.set_fmt) { | 106 | ret = snd_soc_dai_set_fmt(cpu_dai, machine_data->dai_format); |
107 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, | 107 | if (ret < 0) { |
108 | machine_data->dai_format); | 108 | dev_err(substream->pcm->card->dev, |
109 | if (ret < 0) { | 109 | "could not set CPU driver audio format\n"); |
110 | dev_err(substream->pcm->card->dev, | 110 | return ret; |
111 | "could not set CPU driver audio format\n"); | ||
112 | return ret; | ||
113 | } | ||
114 | } | 111 | } |
115 | 112 | ||
116 | /* Tell the codec driver what the serial protocol is. */ | 113 | /* Tell the codec driver what the serial protocol is. */ |
117 | if (codec_dai->dai_ops.set_fmt) { | 114 | ret = snd_soc_dai_set_fmt(codec_dai, machine_data->dai_format); |
118 | ret = codec_dai->dai_ops.set_fmt(codec_dai, | 115 | if (ret < 0) { |
119 | machine_data->dai_format); | 116 | dev_err(substream->pcm->card->dev, |
120 | if (ret < 0) { | 117 | "could not set codec driver audio format\n"); |
121 | dev_err(substream->pcm->card->dev, | 118 | return ret; |
122 | "could not set codec driver audio format\n"); | ||
123 | return ret; | ||
124 | } | ||
125 | } | 119 | } |
126 | 120 | ||
127 | /* | 121 | /* |
128 | * Tell the CPU driver what the clock frequency is, and whether it's a | 122 | * Tell the CPU driver what the clock frequency is, and whether it's a |
129 | * slave or master. | 123 | * slave or master. |
130 | */ | 124 | */ |
131 | if (cpu_dai->dai_ops.set_sysclk) { | 125 | ret = snd_soc_dai_set_sysclk(cpu_dai, 0, |
132 | ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, 0, | 126 | machine_data->clk_frequency, |
133 | machine_data->clk_frequency, | 127 | machine_data->cpu_clk_direction); |
134 | machine_data->cpu_clk_direction); | 128 | if (ret < 0) { |
135 | if (ret < 0) { | 129 | dev_err(substream->pcm->card->dev, |
136 | dev_err(substream->pcm->card->dev, | 130 | "could not set CPU driver clock parameters\n"); |
137 | "could not set CPU driver clock parameters\n"); | 131 | return ret; |
138 | return ret; | ||
139 | } | ||
140 | } | 132 | } |
141 | 133 | ||
142 | /* | 134 | /* |
143 | * Tell the codec driver what the MCLK frequency is, and whether it's | 135 | * Tell the codec driver what the MCLK frequency is, and whether it's |
144 | * a slave or master. | 136 | * a slave or master. |
145 | */ | 137 | */ |
146 | if (codec_dai->dai_ops.set_sysclk) { | 138 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, |
147 | ret = codec_dai->dai_ops.set_sysclk(codec_dai, 0, | 139 | machine_data->clk_frequency, |
148 | machine_data->clk_frequency, | 140 | machine_data->codec_clk_direction); |
149 | machine_data->codec_clk_direction); | 141 | if (ret < 0) { |
150 | if (ret < 0) { | 142 | dev_err(substream->pcm->card->dev, |
151 | dev_err(substream->pcm->card->dev, | 143 | "could not set codec driver clock params\n"); |
152 | "could not set codec driver clock params\n"); | 144 | return ret; |
153 | return ret; | ||
154 | } | ||
155 | } | 145 | } |
156 | 146 | ||
157 | return 0; | 147 | return 0; |
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index d1233c01398f..e53c055412c7 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c | |||
@@ -91,7 +91,7 @@ static int n810_hw_params(struct snd_pcm_substream *substream, | |||
91 | int err; | 91 | int err; |
92 | 92 | ||
93 | /* Set codec DAI configuration */ | 93 | /* Set codec DAI configuration */ |
94 | err = codec_dai->dai_ops.set_fmt(codec_dai, | 94 | err = snd_soc_dai_set_fmt(codec_dai, |
95 | SND_SOC_DAIFMT_I2S | | 95 | SND_SOC_DAIFMT_I2S | |
96 | SND_SOC_DAIFMT_NB_NF | | 96 | SND_SOC_DAIFMT_NB_NF | |
97 | SND_SOC_DAIFMT_CBM_CFM); | 97 | SND_SOC_DAIFMT_CBM_CFM); |
@@ -99,7 +99,7 @@ static int n810_hw_params(struct snd_pcm_substream *substream, | |||
99 | return err; | 99 | return err; |
100 | 100 | ||
101 | /* Set cpu DAI configuration */ | 101 | /* Set cpu DAI configuration */ |
102 | err = cpu_dai->dai_ops.set_fmt(cpu_dai, | 102 | err = snd_soc_dai_set_fmt(cpu_dai, |
103 | SND_SOC_DAIFMT_I2S | | 103 | SND_SOC_DAIFMT_I2S | |
104 | SND_SOC_DAIFMT_NB_NF | | 104 | SND_SOC_DAIFMT_NB_NF | |
105 | SND_SOC_DAIFMT_CBM_CFM); | 105 | SND_SOC_DAIFMT_CBM_CFM); |
@@ -107,7 +107,7 @@ static int n810_hw_params(struct snd_pcm_substream *substream, | |||
107 | return err; | 107 | return err; |
108 | 108 | ||
109 | /* Set the codec system clock for DAC and ADC */ | 109 | /* Set the codec system clock for DAC and ADC */ |
110 | err = codec_dai->dai_ops.set_sysclk(codec_dai, 0, 12000000, | 110 | err = snd_soc_dai_set_sysclk(codec_dai, 0, 12000000, |
111 | SND_SOC_CLOCK_IN); | 111 | SND_SOC_CLOCK_IN); |
112 | 112 | ||
113 | return err; | 113 | return err; |
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index 782afbf7ada5..c0294464a23a 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c | |||
@@ -143,25 +143,25 @@ static int corgi_hw_params(struct snd_pcm_substream *substream, | |||
143 | } | 143 | } |
144 | 144 | ||
145 | /* set codec DAI configuration */ | 145 | /* set codec DAI configuration */ |
146 | ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | 146 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | |
147 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 147 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
148 | if (ret < 0) | 148 | if (ret < 0) |
149 | return ret; | 149 | return ret; |
150 | 150 | ||
151 | /* set cpu DAI configuration */ | 151 | /* set cpu DAI configuration */ |
152 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | 152 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | |
153 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 153 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
154 | if (ret < 0) | 154 | if (ret < 0) |
155 | return ret; | 155 | return ret; |
156 | 156 | ||
157 | /* set the codec system clock for DAC and ADC */ | 157 | /* set the codec system clock for DAC and ADC */ |
158 | ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8731_SYSCLK, clk, | 158 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK, clk, |
159 | SND_SOC_CLOCK_IN); | 159 | SND_SOC_CLOCK_IN); |
160 | if (ret < 0) | 160 | if (ret < 0) |
161 | return ret; | 161 | return ret; |
162 | 162 | ||
163 | /* set the I2S system clock as input (unused) */ | 163 | /* set the I2S system clock as input (unused) */ |
164 | ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, | 164 | ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, |
165 | SND_SOC_CLOCK_IN); | 165 | SND_SOC_CLOCK_IN); |
166 | if (ret < 0) | 166 | if (ret < 0) |
167 | return ret; | 167 | return ret; |
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index ce25b6bf340d..65a4e9a8c39e 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c | |||
@@ -122,25 +122,25 @@ static int poodle_hw_params(struct snd_pcm_substream *substream, | |||
122 | } | 122 | } |
123 | 123 | ||
124 | /* set codec DAI configuration */ | 124 | /* set codec DAI configuration */ |
125 | ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | 125 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | |
126 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 126 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
127 | if (ret < 0) | 127 | if (ret < 0) |
128 | return ret; | 128 | return ret; |
129 | 129 | ||
130 | /* set cpu DAI configuration */ | 130 | /* set cpu DAI configuration */ |
131 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | 131 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | |
132 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 132 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
133 | if (ret < 0) | 133 | if (ret < 0) |
134 | return ret; | 134 | return ret; |
135 | 135 | ||
136 | /* set the codec system clock for DAC and ADC */ | 136 | /* set the codec system clock for DAC and ADC */ |
137 | ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8731_SYSCLK, clk, | 137 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK, clk, |
138 | SND_SOC_CLOCK_IN); | 138 | SND_SOC_CLOCK_IN); |
139 | if (ret < 0) | 139 | if (ret < 0) |
140 | return ret; | 140 | return ret; |
141 | 141 | ||
142 | /* set the I2S system clock as input (unused) */ | 142 | /* set the I2S system clock as input (unused) */ |
143 | ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, | 143 | ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, |
144 | SND_SOC_CLOCK_IN); | 144 | SND_SOC_CLOCK_IN); |
145 | if (ret < 0) | 145 | if (ret < 0) |
146 | return ret; | 146 | return ret; |
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index fd1abc7b08d8..64385797da5d 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -141,25 +141,25 @@ static int spitz_hw_params(struct snd_pcm_substream *substream, | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /* set codec DAI configuration */ | 143 | /* set codec DAI configuration */ |
144 | ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | 144 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | |
145 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 145 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
146 | if (ret < 0) | 146 | if (ret < 0) |
147 | return ret; | 147 | return ret; |
148 | 148 | ||
149 | /* set cpu DAI configuration */ | 149 | /* set cpu DAI configuration */ |
150 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | 150 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | |
151 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | 151 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); |
152 | if (ret < 0) | 152 | if (ret < 0) |
153 | return ret; | 153 | return ret; |
154 | 154 | ||
155 | /* set the codec system clock for DAC and ADC */ | 155 | /* set the codec system clock for DAC and ADC */ |
156 | ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8750_SYSCLK, clk, | 156 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, |
157 | SND_SOC_CLOCK_IN); | 157 | SND_SOC_CLOCK_IN); |
158 | if (ret < 0) | 158 | if (ret < 0) |
159 | return ret; | 159 | return ret; |
160 | 160 | ||
161 | /* set the I2S system clock as input (unused) */ | 161 | /* set the I2S system clock as input (unused) */ |
162 | ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, | 162 | ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, |
163 | SND_SOC_CLOCK_IN); | 163 | SND_SOC_CLOCK_IN); |
164 | if (ret < 0) | 164 | if (ret < 0) |
165 | return ret; | 165 | return ret; |
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 | ||
233 | static struct snd_soc_ops neo1973_voice_ops = { | 233 | static struct snd_soc_ops neo1973_voice_ops = { |