aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-18 17:11:38 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-21 09:12:10 -0500
commitdee89c4d94433520e4e3977ae203d4cfbfe385fb (patch)
treebdbe4c54cd9789b02a6d0bf5f75a47b8721e073e /sound/soc/pxa
parenta47cbe7263236691ee0bbc392f7fd4ec0da1159f (diff)
ASoC: Merge snd_soc_ops into snd_soc_dai_ops
Liam Girdwood's ASoC v2 work avoids having two different ops structures for DAIs by merging the members of struct snd_soc_ops into struct snd_soc_dai_ops, allowing per DAI configuration for everything. Backport this change. This paves the way for future work allowing any combination of DAIs to be connected rather than having fixed purpose CODEC and CPU DAIs and only allowing CODEC<->CPU interconnections. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/pxa-ssp.c20
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c9
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c15
3 files changed, 23 insertions, 21 deletions
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index e2b54b88c380..d0dd6245a20a 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -212,7 +212,8 @@ static struct pxa2xx_pcm_dma_params *ssp_dma_params[4][4] = {
212 }, 212 },
213}; 213};
214 214
215static int pxa_ssp_startup(struct snd_pcm_substream *substream) 215static int pxa_ssp_startup(struct snd_pcm_substream *substream,
216 struct snd_soc_dai *dai)
216{ 217{
217 struct snd_soc_pcm_runtime *rtd = substream->private_data; 218 struct snd_soc_pcm_runtime *rtd = substream->private_data;
218 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 219 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -228,7 +229,8 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream)
228 return ret; 229 return ret;
229} 230}
230 231
231static void pxa_ssp_shutdown(struct snd_pcm_substream *substream) 232static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
233 struct snd_soc_dai *dai)
232{ 234{
233 struct snd_soc_pcm_runtime *rtd = substream->private_data; 235 struct snd_soc_pcm_runtime *rtd = substream->private_data;
234 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 236 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -604,7 +606,8 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
604 * Can be called multiple times by oss emulation. 606 * Can be called multiple times by oss emulation.
605 */ 607 */
606static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, 608static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
607 struct snd_pcm_hw_params *params) 609 struct snd_pcm_hw_params *params,
610 struct snd_soc_dai *dai)
608{ 611{
609 struct snd_soc_pcm_runtime *rtd = substream->private_data; 612 struct snd_soc_pcm_runtime *rtd = substream->private_data;
610 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 613 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -678,7 +681,8 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
678 return 0; 681 return 0;
679} 682}
680 683
681static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd) 684static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd,
685 struct snd_soc_dai *dai)
682{ 686{
683 struct snd_soc_pcm_runtime *rtd = substream->private_data; 687 struct snd_soc_pcm_runtime *rtd = substream->private_data;
684 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 688 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -806,8 +810,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
806 .shutdown = pxa_ssp_shutdown, 810 .shutdown = pxa_ssp_shutdown,
807 .trigger = pxa_ssp_trigger, 811 .trigger = pxa_ssp_trigger,
808 .hw_params = pxa_ssp_hw_params, 812 .hw_params = pxa_ssp_hw_params,
809 },
810 .dai_ops = {
811 .set_sysclk = pxa_ssp_set_dai_sysclk, 813 .set_sysclk = pxa_ssp_set_dai_sysclk,
812 .set_clkdiv = pxa_ssp_set_dai_clkdiv, 814 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
813 .set_pll = pxa_ssp_set_dai_pll, 815 .set_pll = pxa_ssp_set_dai_pll,
@@ -840,8 +842,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
840 .shutdown = pxa_ssp_shutdown, 842 .shutdown = pxa_ssp_shutdown,
841 .trigger = pxa_ssp_trigger, 843 .trigger = pxa_ssp_trigger,
842 .hw_params = pxa_ssp_hw_params, 844 .hw_params = pxa_ssp_hw_params,
843 },
844 .dai_ops = {
845 .set_sysclk = pxa_ssp_set_dai_sysclk, 845 .set_sysclk = pxa_ssp_set_dai_sysclk,
846 .set_clkdiv = pxa_ssp_set_dai_clkdiv, 846 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
847 .set_pll = pxa_ssp_set_dai_pll, 847 .set_pll = pxa_ssp_set_dai_pll,
@@ -875,8 +875,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
875 .shutdown = pxa_ssp_shutdown, 875 .shutdown = pxa_ssp_shutdown,
876 .trigger = pxa_ssp_trigger, 876 .trigger = pxa_ssp_trigger,
877 .hw_params = pxa_ssp_hw_params, 877 .hw_params = pxa_ssp_hw_params,
878 },
879 .dai_ops = {
880 .set_sysclk = pxa_ssp_set_dai_sysclk, 878 .set_sysclk = pxa_ssp_set_dai_sysclk,
881 .set_clkdiv = pxa_ssp_set_dai_clkdiv, 879 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
882 .set_pll = pxa_ssp_set_dai_pll, 880 .set_pll = pxa_ssp_set_dai_pll,
@@ -910,8 +908,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
910 .shutdown = pxa_ssp_shutdown, 908 .shutdown = pxa_ssp_shutdown,
911 .trigger = pxa_ssp_trigger, 909 .trigger = pxa_ssp_trigger,
912 .hw_params = pxa_ssp_hw_params, 910 .hw_params = pxa_ssp_hw_params,
913 },
914 .dai_ops = {
915 .set_sysclk = pxa_ssp_set_dai_sysclk, 911 .set_sysclk = pxa_ssp_set_dai_sysclk,
916 .set_clkdiv = pxa_ssp_set_dai_clkdiv, 912 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
917 .set_pll = pxa_ssp_set_dai_pll, 913 .set_pll = pxa_ssp_set_dai_pll,
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index a7a3a9c5c6ff..86667d2f1b75 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -117,7 +117,8 @@ static void pxa2xx_ac97_remove(struct platform_device *pdev,
117} 117}
118 118
119static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, 119static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
120 struct snd_pcm_hw_params *params) 120 struct snd_pcm_hw_params *params,
121 struct snd_soc_dai *dai)
121{ 122{
122 struct snd_soc_pcm_runtime *rtd = substream->private_data; 123 struct snd_soc_pcm_runtime *rtd = substream->private_data;
123 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 124 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -131,7 +132,8 @@ static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
131} 132}
132 133
133static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream, 134static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream,
134 struct snd_pcm_hw_params *params) 135 struct snd_pcm_hw_params *params,
136 struct snd_soc_dai *dai)
135{ 137{
136 struct snd_soc_pcm_runtime *rtd = substream->private_data; 138 struct snd_soc_pcm_runtime *rtd = substream->private_data;
137 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 139 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -145,7 +147,8 @@ static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream,
145} 147}
146 148
147static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream, 149static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream,
148 struct snd_pcm_hw_params *params) 150 struct snd_pcm_hw_params *params,
151 struct snd_soc_dai *dai)
149{ 152{
150 struct snd_soc_pcm_runtime *rtd = substream->private_data; 153 struct snd_soc_pcm_runtime *rtd = substream->private_data;
151 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 154 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index e758034db5c3..9a3e55b48129 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -121,7 +121,8 @@ static struct pxa2xx_gpio gpio_bus[] = {
121 }, 121 },
122}; 122};
123 123
124static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream) 124static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,
125 struct snd_soc_dai *dai)
125{ 126{
126 struct snd_soc_pcm_runtime *rtd = substream->private_data; 127 struct snd_soc_pcm_runtime *rtd = substream->private_data;
127 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 128 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -187,7 +188,8 @@ static int pxa2xx_i2s_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
187} 188}
188 189
189static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, 190static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
190 struct snd_pcm_hw_params *params) 191 struct snd_pcm_hw_params *params,
192 struct snd_soc_dai *dai)
191{ 193{
192 struct snd_soc_pcm_runtime *rtd = substream->private_data; 194 struct snd_soc_pcm_runtime *rtd = substream->private_data;
193 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 195 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -248,7 +250,8 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
248 return 0; 250 return 0;
249} 251}
250 252
251static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd) 253static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
254 struct snd_soc_dai *dai)
252{ 255{
253 int ret = 0; 256 int ret = 0;
254 257
@@ -269,7 +272,8 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
269 return ret; 272 return ret;
270} 273}
271 274
272static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream) 275static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
276 struct snd_soc_dai *dai)
273{ 277{
274 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 278 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
275 SACR1 |= SACR1_DRPL; 279 SACR1 |= SACR1_DRPL;
@@ -353,8 +357,7 @@ struct snd_soc_dai pxa_i2s_dai = {
353 .startup = pxa2xx_i2s_startup, 357 .startup = pxa2xx_i2s_startup,
354 .shutdown = pxa2xx_i2s_shutdown, 358 .shutdown = pxa2xx_i2s_shutdown,
355 .trigger = pxa2xx_i2s_trigger, 359 .trigger = pxa2xx_i2s_trigger,
356 .hw_params = pxa2xx_i2s_hw_params,}, 360 .hw_params = pxa2xx_i2s_hw_params,
357 .dai_ops = {
358 .set_fmt = pxa2xx_i2s_set_dai_fmt, 361 .set_fmt = pxa2xx_i2s_set_dai_fmt,
359 .set_sysclk = pxa2xx_i2s_set_dai_sysclk, 362 .set_sysclk = pxa2xx_i2s_set_dai_sysclk,
360 }, 363 },