diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-11 12:51:31 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-11 12:51:31 -0400 |
commit | 65ec1cd1e2c6228752d2f167b01e6d291014d249 (patch) | |
tree | 8a54ef7d2a0d4770b49779114f9e1ac654363bdd | |
parent | 5314adc3612d893c7cc526b3312d124805e45bc3 (diff) | |
parent | 6335d05548eece40092000aa91b64a50310d69d5 (diff) |
ASoC: Merge dai_ops factor out
Merge Eric Maio's patch to merge snd_soc_dai_ops out of line. Fixed
merge issues and updated drivers, plus an issue with the ops for the two
s3c2443 AC97 DAIs having been merged.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
42 files changed, 495 insertions, 433 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 24247f763608..13676472ddfc 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -203,7 +203,7 @@ struct snd_soc_dai { | |||
203 | int (*resume)(struct snd_soc_dai *dai); | 203 | int (*resume)(struct snd_soc_dai *dai); |
204 | 204 | ||
205 | /* ops */ | 205 | /* ops */ |
206 | struct snd_soc_dai_ops ops; | 206 | struct snd_soc_dai_ops *ops; |
207 | 207 | ||
208 | /* DAI capabilities */ | 208 | /* DAI capabilities */ |
209 | struct snd_soc_pcm_stream capture; | 209 | struct snd_soc_pcm_stream capture; |
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index ff0054b76502..e588e63f18d2 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c | |||
@@ -697,6 +697,15 @@ static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai) | |||
697 | #define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\ | 697 | #define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\ |
698 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 698 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
699 | 699 | ||
700 | static struct snd_soc_dai_ops atmel_ssc_dai_ops = { | ||
701 | .startup = atmel_ssc_startup, | ||
702 | .shutdown = atmel_ssc_shutdown, | ||
703 | .prepare = atmel_ssc_prepare, | ||
704 | .hw_params = atmel_ssc_hw_params, | ||
705 | .set_fmt = atmel_ssc_set_dai_fmt, | ||
706 | .set_clkdiv = atmel_ssc_set_dai_clkdiv, | ||
707 | }; | ||
708 | |||
700 | struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { | 709 | struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { |
701 | { .name = "atmel-ssc0", | 710 | { .name = "atmel-ssc0", |
702 | .id = 0, | 711 | .id = 0, |
@@ -712,13 +721,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { | |||
712 | .channels_max = 2, | 721 | .channels_max = 2, |
713 | .rates = ATMEL_SSC_RATES, | 722 | .rates = ATMEL_SSC_RATES, |
714 | .formats = ATMEL_SSC_FORMATS,}, | 723 | .formats = ATMEL_SSC_FORMATS,}, |
715 | .ops = { | 724 | .ops = &atmel_ssc_dai_ops, |
716 | .startup = atmel_ssc_startup, | ||
717 | .shutdown = atmel_ssc_shutdown, | ||
718 | .prepare = atmel_ssc_prepare, | ||
719 | .hw_params = atmel_ssc_hw_params, | ||
720 | .set_fmt = atmel_ssc_set_dai_fmt, | ||
721 | .set_clkdiv = atmel_ssc_set_dai_clkdiv,}, | ||
722 | .private_data = &ssc_info[0], | 725 | .private_data = &ssc_info[0], |
723 | }, | 726 | }, |
724 | #if NUM_SSC_DEVICES == 3 | 727 | #if NUM_SSC_DEVICES == 3 |
@@ -736,13 +739,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { | |||
736 | .channels_max = 2, | 739 | .channels_max = 2, |
737 | .rates = ATMEL_SSC_RATES, | 740 | .rates = ATMEL_SSC_RATES, |
738 | .formats = ATMEL_SSC_FORMATS,}, | 741 | .formats = ATMEL_SSC_FORMATS,}, |
739 | .ops = { | 742 | .ops = &atmel_ssc_dai_ops, |
740 | .startup = atmel_ssc_startup, | ||
741 | .shutdown = atmel_ssc_shutdown, | ||
742 | .prepare = atmel_ssc_prepare, | ||
743 | .hw_params = atmel_ssc_hw_params, | ||
744 | .set_fmt = atmel_ssc_set_dai_fmt, | ||
745 | .set_clkdiv = atmel_ssc_set_dai_clkdiv,}, | ||
746 | .private_data = &ssc_info[1], | 743 | .private_data = &ssc_info[1], |
747 | }, | 744 | }, |
748 | { .name = "atmel-ssc2", | 745 | { .name = "atmel-ssc2", |
@@ -759,13 +756,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { | |||
759 | .channels_max = 2, | 756 | .channels_max = 2, |
760 | .rates = ATMEL_SSC_RATES, | 757 | .rates = ATMEL_SSC_RATES, |
761 | .formats = ATMEL_SSC_FORMATS,}, | 758 | .formats = ATMEL_SSC_FORMATS,}, |
762 | .ops = { | 759 | .ops = &atmel_ssc_dai_ops, |
763 | .startup = atmel_ssc_startup, | ||
764 | .shutdown = atmel_ssc_shutdown, | ||
765 | .prepare = atmel_ssc_prepare, | ||
766 | .hw_params = atmel_ssc_hw_params, | ||
767 | .set_fmt = atmel_ssc_set_dai_fmt, | ||
768 | .set_clkdiv = atmel_ssc_set_dai_clkdiv,}, | ||
769 | .private_data = &ssc_info[2], | 760 | .private_data = &ssc_info[2], |
770 | }, | 761 | }, |
771 | #endif | 762 | #endif |
diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c index f0e30aec7f23..479d7bdf1865 100644 --- a/sound/soc/au1x/psc-ac97.c +++ b/sound/soc/au1x/psc-ac97.c | |||
@@ -342,6 +342,11 @@ static int au1xpsc_ac97_resume(struct snd_soc_dai *dai) | |||
342 | return 0; | 342 | return 0; |
343 | } | 343 | } |
344 | 344 | ||
345 | static struct snd_soc_dai_ops au1xpsc_ac97_dai_ops = { | ||
346 | .trigger = au1xpsc_ac97_trigger, | ||
347 | .hw_params = au1xpsc_ac97_hw_params, | ||
348 | }; | ||
349 | |||
345 | struct snd_soc_dai au1xpsc_ac97_dai = { | 350 | struct snd_soc_dai au1xpsc_ac97_dai = { |
346 | .name = "au1xpsc_ac97", | 351 | .name = "au1xpsc_ac97", |
347 | .ac97_control = 1, | 352 | .ac97_control = 1, |
@@ -361,10 +366,7 @@ struct snd_soc_dai au1xpsc_ac97_dai = { | |||
361 | .channels_min = 2, | 366 | .channels_min = 2, |
362 | .channels_max = 2, | 367 | .channels_max = 2, |
363 | }, | 368 | }, |
364 | .ops = { | 369 | .ops = &au1xpsc_ac97_dai_ops, |
365 | .trigger = au1xpsc_ac97_trigger, | ||
366 | .hw_params = au1xpsc_ac97_hw_params, | ||
367 | }, | ||
368 | }; | 370 | }; |
369 | EXPORT_SYMBOL_GPL(au1xpsc_ac97_dai); | 371 | EXPORT_SYMBOL_GPL(au1xpsc_ac97_dai); |
370 | 372 | ||
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index f916de4400ed..bb589327ee32 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c | |||
@@ -367,6 +367,12 @@ static int au1xpsc_i2s_resume(struct snd_soc_dai *cpu_dai) | |||
367 | return 0; | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | static struct snd_soc_dai_ops au1xpsc_i2s_dai_ops = { | ||
371 | .trigger = au1xpsc_i2s_trigger, | ||
372 | .hw_params = au1xpsc_i2s_hw_params, | ||
373 | .set_fmt = au1xpsc_i2s_set_fmt, | ||
374 | }; | ||
375 | |||
370 | struct snd_soc_dai au1xpsc_i2s_dai = { | 376 | struct snd_soc_dai au1xpsc_i2s_dai = { |
371 | .name = "au1xpsc_i2s", | 377 | .name = "au1xpsc_i2s", |
372 | .probe = au1xpsc_i2s_probe, | 378 | .probe = au1xpsc_i2s_probe, |
@@ -385,11 +391,7 @@ struct snd_soc_dai au1xpsc_i2s_dai = { | |||
385 | .channels_min = 2, | 391 | .channels_min = 2, |
386 | .channels_max = 8, /* 2 without external help */ | 392 | .channels_max = 8, /* 2 without external help */ |
387 | }, | 393 | }, |
388 | .ops = { | 394 | .ops = &au1xpsc_i2s_dai_ops, |
389 | .trigger = au1xpsc_i2s_trigger, | ||
390 | .hw_params = au1xpsc_i2s_hw_params, | ||
391 | .set_fmt = au1xpsc_i2s_set_fmt, | ||
392 | }, | ||
393 | }; | 395 | }; |
394 | EXPORT_SYMBOL(au1xpsc_i2s_dai); | 396 | EXPORT_SYMBOL(au1xpsc_i2s_dai); |
395 | 397 | ||
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c index d1d95d2393fe..964824419678 100644 --- a/sound/soc/blackfin/bf5xx-i2s.c +++ b/sound/soc/blackfin/bf5xx-i2s.c | |||
@@ -287,6 +287,13 @@ static int bf5xx_i2s_resume(struct platform_device *pdev, | |||
287 | #define BF5XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |\ | 287 | #define BF5XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |\ |
288 | SNDRV_PCM_FMTBIT_S32_LE) | 288 | SNDRV_PCM_FMTBIT_S32_LE) |
289 | 289 | ||
290 | static struct snd_soc_dai_ops bf5xx_i2s_dai_ops = { | ||
291 | .startup = bf5xx_i2s_startup, | ||
292 | .shutdown = bf5xx_i2s_shutdown, | ||
293 | .hw_params = bf5xx_i2s_hw_params, | ||
294 | .set_fmt = bf5xx_i2s_set_dai_fmt, | ||
295 | }; | ||
296 | |||
290 | struct snd_soc_dai bf5xx_i2s_dai = { | 297 | struct snd_soc_dai bf5xx_i2s_dai = { |
291 | .name = "bf5xx-i2s", | 298 | .name = "bf5xx-i2s", |
292 | .id = 0, | 299 | .id = 0, |
@@ -304,12 +311,7 @@ struct snd_soc_dai bf5xx_i2s_dai = { | |||
304 | .channels_max = 2, | 311 | .channels_max = 2, |
305 | .rates = BF5XX_I2S_RATES, | 312 | .rates = BF5XX_I2S_RATES, |
306 | .formats = BF5XX_I2S_FORMATS,}, | 313 | .formats = BF5XX_I2S_FORMATS,}, |
307 | .ops = { | 314 | .ops = &bf5xx_i2s_dai_ops, |
308 | .startup = bf5xx_i2s_startup, | ||
309 | .shutdown = bf5xx_i2s_shutdown, | ||
310 | .hw_params = bf5xx_i2s_hw_params, | ||
311 | .set_fmt = bf5xx_i2s_set_dai_fmt, | ||
312 | }, | ||
313 | }; | 315 | }; |
314 | EXPORT_SYMBOL_GPL(bf5xx_i2s_dai); | 316 | EXPORT_SYMBOL_GPL(bf5xx_i2s_dai); |
315 | 317 | ||
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 11f84b6e5cb8..b0d4af145b87 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c | |||
@@ -41,6 +41,10 @@ static int ac97_prepare(struct snd_pcm_substream *substream, | |||
41 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ | 41 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ |
42 | SNDRV_PCM_RATE_48000) | 42 | SNDRV_PCM_RATE_48000) |
43 | 43 | ||
44 | static struct snd_soc_dai_ops ac97_dai_ops = { | ||
45 | .prepare = ac97_prepare, | ||
46 | }; | ||
47 | |||
44 | struct snd_soc_dai ac97_dai = { | 48 | struct snd_soc_dai ac97_dai = { |
45 | .name = "AC97 HiFi", | 49 | .name = "AC97 HiFi", |
46 | .ac97_control = 1, | 50 | .ac97_control = 1, |
@@ -56,8 +60,7 @@ struct snd_soc_dai ac97_dai = { | |||
56 | .channels_max = 2, | 60 | .channels_max = 2, |
57 | .rates = STD_AC97_RATES, | 61 | .rates = STD_AC97_RATES, |
58 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 62 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
59 | .ops = { | 63 | .ops = &ac97_dai_ops, |
60 | .prepare = ac97_prepare,}, | ||
61 | }; | 64 | }; |
62 | EXPORT_SYMBOL_GPL(ac97_dai); | 65 | EXPORT_SYMBOL_GPL(ac97_dai); |
63 | 66 | ||
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c index 338381f4fe1e..4d47bc4f7428 100644 --- a/sound/soc/codecs/ak4104.c +++ b/sound/soc/codecs/ak4104.c | |||
@@ -174,6 +174,11 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream, | |||
174 | return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val); | 174 | return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val); |
175 | } | 175 | } |
176 | 176 | ||
177 | static struct snd_soc_dai_ops ak4101_dai_ops = { | ||
178 | .hw_params = ak4104_hw_params, | ||
179 | .set_fmt = ak4104_set_dai_fmt, | ||
180 | }; | ||
181 | |||
177 | struct snd_soc_dai ak4104_dai = { | 182 | struct snd_soc_dai ak4104_dai = { |
178 | .name = DRV_NAME, | 183 | .name = DRV_NAME, |
179 | .playback = { | 184 | .playback = { |
@@ -187,10 +192,7 @@ struct snd_soc_dai ak4104_dai = { | |||
187 | SNDRV_PCM_FMTBIT_S24_3LE | | 192 | SNDRV_PCM_FMTBIT_S24_3LE | |
188 | SNDRV_PCM_FMTBIT_S24_LE | 193 | SNDRV_PCM_FMTBIT_S24_LE |
189 | }, | 194 | }, |
190 | .ops = { | 195 | .ops = &ak4101_dai_ops, |
191 | .hw_params = ak4104_hw_params, | ||
192 | .set_fmt = ak4104_set_dai_fmt, | ||
193 | } | ||
194 | }; | 196 | }; |
195 | 197 | ||
196 | static struct snd_soc_codec *ak4104_codec; | 198 | static struct snd_soc_codec *ak4104_codec; |
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index d56e6bb1fedb..1f63d387a2f4 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c | |||
@@ -421,6 +421,13 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec, | |||
421 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ | 421 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ |
422 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 422 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |
423 | 423 | ||
424 | static struct snd_soc_dai_ops ak4535_dai_ops = { | ||
425 | .hw_params = ak4535_hw_params, | ||
426 | .set_fmt = ak4535_set_dai_fmt, | ||
427 | .digital_mute = ak4535_mute, | ||
428 | .set_sysclk = ak4535_set_dai_sysclk, | ||
429 | }; | ||
430 | |||
424 | struct snd_soc_dai ak4535_dai = { | 431 | struct snd_soc_dai ak4535_dai = { |
425 | .name = "AK4535", | 432 | .name = "AK4535", |
426 | .playback = { | 433 | .playback = { |
@@ -435,12 +442,7 @@ struct snd_soc_dai ak4535_dai = { | |||
435 | .channels_max = 2, | 442 | .channels_max = 2, |
436 | .rates = AK4535_RATES, | 443 | .rates = AK4535_RATES, |
437 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 444 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
438 | .ops = { | 445 | .ops = &ak4535_dai_ops, |
439 | .hw_params = ak4535_hw_params, | ||
440 | .set_fmt = ak4535_set_dai_fmt, | ||
441 | .digital_mute = ak4535_mute, | ||
442 | .set_sysclk = ak4535_set_dai_sysclk, | ||
443 | }, | ||
444 | }; | 446 | }; |
445 | EXPORT_SYMBOL_GPL(ak4535_dai); | 447 | EXPORT_SYMBOL_GPL(ak4535_dai); |
446 | 448 | ||
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index 0e0c23ee6afc..2137670c9b78 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c | |||
@@ -502,6 +502,13 @@ static const struct snd_kcontrol_new cs4270_snd_controls[] = { | |||
502 | */ | 502 | */ |
503 | static struct snd_soc_codec *cs4270_codec; | 503 | static struct snd_soc_codec *cs4270_codec; |
504 | 504 | ||
505 | static struct snd_soc_dai_ops cs4270_dai_ops = { | ||
506 | .hw_params = cs4270_hw_params, | ||
507 | .set_sysclk = cs4270_set_dai_sysclk, | ||
508 | .set_fmt = cs4270_set_dai_fmt, | ||
509 | .digital_mute = cs4270_mute, | ||
510 | }; | ||
511 | |||
505 | struct snd_soc_dai cs4270_dai = { | 512 | struct snd_soc_dai cs4270_dai = { |
506 | .name = "cs4270", | 513 | .name = "cs4270", |
507 | .playback = { | 514 | .playback = { |
@@ -518,12 +525,7 @@ struct snd_soc_dai cs4270_dai = { | |||
518 | .rates = 0, | 525 | .rates = 0, |
519 | .formats = CS4270_FORMATS, | 526 | .formats = CS4270_FORMATS, |
520 | }, | 527 | }, |
521 | .ops = { | 528 | .ops = &cs4270_dai_ops, |
522 | .hw_params = cs4270_hw_params, | ||
523 | .set_sysclk = cs4270_set_dai_sysclk, | ||
524 | .set_fmt = cs4270_set_dai_fmt, | ||
525 | .digital_mute = cs4270_mute, | ||
526 | }, | ||
527 | }; | 529 | }; |
528 | EXPORT_SYMBOL_GPL(cs4270_dai); | 530 | EXPORT_SYMBOL_GPL(cs4270_dai); |
529 | 531 | ||
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c index 58e225dadc7e..87f606c76822 100644 --- a/sound/soc/codecs/ssm2602.c +++ b/sound/soc/codecs/ssm2602.c | |||
@@ -506,6 +506,16 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec, | |||
506 | #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 506 | #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
507 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 507 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
508 | 508 | ||
509 | static struct snd_soc_dai_ops ssm2602_dai_ops = { | ||
510 | .startup = ssm2602_startup, | ||
511 | .prepare = ssm2602_pcm_prepare, | ||
512 | .hw_params = ssm2602_hw_params, | ||
513 | .shutdown = ssm2602_shutdown, | ||
514 | .digital_mute = ssm2602_mute, | ||
515 | .set_sysclk = ssm2602_set_dai_sysclk, | ||
516 | .set_fmt = ssm2602_set_dai_fmt, | ||
517 | }; | ||
518 | |||
509 | struct snd_soc_dai ssm2602_dai = { | 519 | struct snd_soc_dai ssm2602_dai = { |
510 | .name = "SSM2602", | 520 | .name = "SSM2602", |
511 | .playback = { | 521 | .playback = { |
@@ -520,15 +530,7 @@ struct snd_soc_dai ssm2602_dai = { | |||
520 | .channels_max = 2, | 530 | .channels_max = 2, |
521 | .rates = SSM2602_RATES, | 531 | .rates = SSM2602_RATES, |
522 | .formats = SSM2602_FORMATS,}, | 532 | .formats = SSM2602_FORMATS,}, |
523 | .ops = { | 533 | .ops = &ssm2602_dai_ops, |
524 | .startup = ssm2602_startup, | ||
525 | .prepare = ssm2602_pcm_prepare, | ||
526 | .hw_params = ssm2602_hw_params, | ||
527 | .shutdown = ssm2602_shutdown, | ||
528 | .digital_mute = ssm2602_mute, | ||
529 | .set_sysclk = ssm2602_set_dai_sysclk, | ||
530 | .set_fmt = ssm2602_set_dai_fmt, | ||
531 | } | ||
532 | }; | 534 | }; |
533 | EXPORT_SYMBOL_GPL(ssm2602_dai); | 535 | EXPORT_SYMBOL_GPL(ssm2602_dai); |
534 | 536 | ||
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c index 8b20c360adf5..c3f4afb5d017 100644 --- a/sound/soc/codecs/tlv320aic23.c +++ b/sound/soc/codecs/tlv320aic23.c | |||
@@ -580,6 +580,15 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec, | |||
580 | #define AIC23_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 580 | #define AIC23_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
581 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) | 581 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) |
582 | 582 | ||
583 | static struct snd_soc_dai_ops tlv320aic23_dai_ops = { | ||
584 | .prepare = tlv320aic23_pcm_prepare, | ||
585 | .hw_params = tlv320aic23_hw_params, | ||
586 | .shutdown = tlv320aic23_shutdown, | ||
587 | .digital_mute = tlv320aic23_mute, | ||
588 | .set_fmt = tlv320aic23_set_dai_fmt, | ||
589 | .set_sysclk = tlv320aic23_set_dai_sysclk, | ||
590 | }; | ||
591 | |||
583 | struct snd_soc_dai tlv320aic23_dai = { | 592 | struct snd_soc_dai tlv320aic23_dai = { |
584 | .name = "tlv320aic23", | 593 | .name = "tlv320aic23", |
585 | .playback = { | 594 | .playback = { |
@@ -594,14 +603,7 @@ struct snd_soc_dai tlv320aic23_dai = { | |||
594 | .channels_max = 2, | 603 | .channels_max = 2, |
595 | .rates = AIC23_RATES, | 604 | .rates = AIC23_RATES, |
596 | .formats = AIC23_FORMATS,}, | 605 | .formats = AIC23_FORMATS,}, |
597 | .ops = { | 606 | .ops = &tlv320aic23_dai_ops, |
598 | .prepare = tlv320aic23_pcm_prepare, | ||
599 | .hw_params = tlv320aic23_hw_params, | ||
600 | .shutdown = tlv320aic23_shutdown, | ||
601 | .digital_mute = tlv320aic23_mute, | ||
602 | .set_fmt = tlv320aic23_set_dai_fmt, | ||
603 | .set_sysclk = tlv320aic23_set_dai_sysclk, | ||
604 | } | ||
605 | }; | 607 | }; |
606 | EXPORT_SYMBOL_GPL(tlv320aic23_dai); | 608 | EXPORT_SYMBOL_GPL(tlv320aic23_dai); |
607 | 609 | ||
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index 229e464cf713..a7f333fc579e 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c | |||
@@ -270,6 +270,13 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
270 | #define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ | 270 | #define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ |
271 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE) | 271 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE) |
272 | 272 | ||
273 | static struct snd_soc_dai_ops aic26_dai_ops = { | ||
274 | .hw_params = aic26_hw_params, | ||
275 | .digital_mute = aic26_mute, | ||
276 | .set_sysclk = aic26_set_sysclk, | ||
277 | .set_fmt = aic26_set_fmt, | ||
278 | }; | ||
279 | |||
273 | struct snd_soc_dai aic26_dai = { | 280 | struct snd_soc_dai aic26_dai = { |
274 | .name = "tlv320aic26", | 281 | .name = "tlv320aic26", |
275 | .playback = { | 282 | .playback = { |
@@ -286,12 +293,7 @@ struct snd_soc_dai aic26_dai = { | |||
286 | .rates = AIC26_RATES, | 293 | .rates = AIC26_RATES, |
287 | .formats = AIC26_FORMATS, | 294 | .formats = AIC26_FORMATS, |
288 | }, | 295 | }, |
289 | .ops = { | 296 | .ops = &aic26_dai_ops, |
290 | .hw_params = aic26_hw_params, | ||
291 | .digital_mute = aic26_mute, | ||
292 | .set_sysclk = aic26_set_sysclk, | ||
293 | .set_fmt = aic26_set_fmt, | ||
294 | }, | ||
295 | }; | 297 | }; |
296 | EXPORT_SYMBOL_GPL(aic26_dai); | 298 | EXPORT_SYMBOL_GPL(aic26_dai); |
297 | 299 | ||
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index d638e3f0728b..ab099f482487 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -1088,6 +1088,13 @@ EXPORT_SYMBOL_GPL(aic3x_button_pressed); | |||
1088 | #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 1088 | #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
1089 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) | 1089 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) |
1090 | 1090 | ||
1091 | static struct snd_soc_dai_ops aic3x_dai_ops = { | ||
1092 | .hw_params = aic3x_hw_params, | ||
1093 | .digital_mute = aic3x_mute, | ||
1094 | .set_sysclk = aic3x_set_dai_sysclk, | ||
1095 | .set_fmt = aic3x_set_dai_fmt, | ||
1096 | }; | ||
1097 | |||
1091 | struct snd_soc_dai aic3x_dai = { | 1098 | struct snd_soc_dai aic3x_dai = { |
1092 | .name = "tlv320aic3x", | 1099 | .name = "tlv320aic3x", |
1093 | .playback = { | 1100 | .playback = { |
@@ -1102,12 +1109,7 @@ struct snd_soc_dai aic3x_dai = { | |||
1102 | .channels_max = 2, | 1109 | .channels_max = 2, |
1103 | .rates = AIC3X_RATES, | 1110 | .rates = AIC3X_RATES, |
1104 | .formats = AIC3X_FORMATS,}, | 1111 | .formats = AIC3X_FORMATS,}, |
1105 | .ops = { | 1112 | .ops = &aic3x_dai_ops, |
1106 | .hw_params = aic3x_hw_params, | ||
1107 | .digital_mute = aic3x_mute, | ||
1108 | .set_sysclk = aic3x_set_dai_sysclk, | ||
1109 | .set_fmt = aic3x_set_dai_fmt, | ||
1110 | } | ||
1111 | }; | 1113 | }; |
1112 | EXPORT_SYMBOL_GPL(aic3x_dai); | 1114 | EXPORT_SYMBOL_GPL(aic3x_dai); |
1113 | 1115 | ||
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 661599295ca7..ddefb8f80145 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c | |||
@@ -431,6 +431,15 @@ SOC_ENUM("PCM Playback De-emphasis", uda134x_mixer_enum[1]), | |||
431 | SOC_SINGLE("DC Filter Enable Switch", UDA134X_STATUS0, 0, 1, 0), | 431 | SOC_SINGLE("DC Filter Enable Switch", UDA134X_STATUS0, 0, 1, 0), |
432 | }; | 432 | }; |
433 | 433 | ||
434 | static struct snd_soc_dai_ops uda134x_dai_ops = { | ||
435 | .startup = uda134x_startup, | ||
436 | .shutdown = uda134x_shutdown, | ||
437 | .hw_params = uda134x_hw_params, | ||
438 | .digital_mute = uda134x_mute, | ||
439 | .set_sysclk = uda134x_set_dai_sysclk, | ||
440 | .set_fmt = uda134x_set_dai_fmt, | ||
441 | }; | ||
442 | |||
434 | struct snd_soc_dai uda134x_dai = { | 443 | struct snd_soc_dai uda134x_dai = { |
435 | .name = "UDA134X", | 444 | .name = "UDA134X", |
436 | /* playback capabilities */ | 445 | /* playback capabilities */ |
@@ -450,14 +459,7 @@ struct snd_soc_dai uda134x_dai = { | |||
450 | .formats = UDA134X_FORMATS, | 459 | .formats = UDA134X_FORMATS, |
451 | }, | 460 | }, |
452 | /* pcm operations */ | 461 | /* pcm operations */ |
453 | .ops = { | 462 | .ops = &uda134x_dai_ops, |
454 | .startup = uda134x_startup, | ||
455 | .shutdown = uda134x_shutdown, | ||
456 | .hw_params = uda134x_hw_params, | ||
457 | .digital_mute = uda134x_mute, | ||
458 | .set_sysclk = uda134x_set_dai_sysclk, | ||
459 | .set_fmt = uda134x_set_dai_fmt, | ||
460 | } | ||
461 | }; | 463 | }; |
462 | EXPORT_SYMBOL(uda134x_dai); | 464 | EXPORT_SYMBOL(uda134x_dai); |
463 | 465 | ||
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 1b10f488328c..5b21594e0e58 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -579,6 +579,27 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec, | |||
579 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ | 579 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ |
580 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 580 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |
581 | 581 | ||
582 | static struct snd_soc_dai_ops uda1380_dai_ops = { | ||
583 | .hw_params = uda1380_pcm_hw_params, | ||
584 | .shutdown = uda1380_pcm_shutdown, | ||
585 | .trigger = uda1380_trigger, | ||
586 | .set_fmt = uda1380_set_dai_fmt_both, | ||
587 | }; | ||
588 | |||
589 | static struct snd_soc_dai_ops uda1380_dai_ops_playback = { | ||
590 | .hw_params = uda1380_pcm_hw_params, | ||
591 | .shutdown = uda1380_pcm_shutdown, | ||
592 | .trigger = uda1380_trigger, | ||
593 | .set_fmt = uda1380_set_dai_fmt_playback, | ||
594 | }; | ||
595 | |||
596 | static struct snd_soc_dai_ops uda1380_dai_ops_capture = { | ||
597 | .hw_params = uda1380_pcm_hw_params, | ||
598 | .shutdown = uda1380_pcm_shutdown, | ||
599 | .trigger = uda1380_trigger, | ||
600 | .set_fmt = uda1380_set_dai_fmt_capture, | ||
601 | }; | ||
602 | |||
582 | struct snd_soc_dai uda1380_dai[] = { | 603 | struct snd_soc_dai uda1380_dai[] = { |
583 | { | 604 | { |
584 | .name = "UDA1380", | 605 | .name = "UDA1380", |
@@ -594,12 +615,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
594 | .channels_max = 2, | 615 | .channels_max = 2, |
595 | .rates = UDA1380_RATES, | 616 | .rates = UDA1380_RATES, |
596 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 617 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
597 | .ops = { | 618 | .ops = &uda1380_dai_ops, |
598 | .trigger = uda1380_trigger, | ||
599 | .hw_params = uda1380_pcm_hw_params, | ||
600 | .shutdown = uda1380_pcm_shutdown, | ||
601 | .set_fmt = uda1380_set_dai_fmt_both, | ||
602 | }, | ||
603 | }, | 619 | }, |
604 | { /* playback only - dual interface */ | 620 | { /* playback only - dual interface */ |
605 | .name = "UDA1380", | 621 | .name = "UDA1380", |
@@ -610,12 +626,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
610 | .rates = UDA1380_RATES, | 626 | .rates = UDA1380_RATES, |
611 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 627 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
612 | }, | 628 | }, |
613 | .ops = { | 629 | .ops = &uda1380_dai_ops_playback, |
614 | .trigger = uda1380_trigger, | ||
615 | .hw_params = uda1380_pcm_hw_params, | ||
616 | .shutdown = uda1380_pcm_shutdown, | ||
617 | .set_fmt = uda1380_set_dai_fmt_playback, | ||
618 | }, | ||
619 | }, | 630 | }, |
620 | { /* capture only - dual interface*/ | 631 | { /* capture only - dual interface*/ |
621 | .name = "UDA1380", | 632 | .name = "UDA1380", |
@@ -626,12 +637,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
626 | .rates = UDA1380_RATES, | 637 | .rates = UDA1380_RATES, |
627 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 638 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
628 | }, | 639 | }, |
629 | .ops = { | 640 | .ops = &uda1380_dai_ops_capture, |
630 | .trigger = uda1380_trigger, | ||
631 | .hw_params = uda1380_pcm_hw_params, | ||
632 | .shutdown = uda1380_pcm_shutdown, | ||
633 | .set_fmt = uda1380_set_dai_fmt_capture, | ||
634 | }, | ||
635 | }, | 641 | }, |
636 | }; | 642 | }; |
637 | EXPORT_SYMBOL_GPL(uda1380_dai); | 643 | EXPORT_SYMBOL_GPL(uda1380_dai); |
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index 359e5cc86f34..3b1d0993bed9 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -1538,6 +1538,16 @@ static int wm8350_remove(struct platform_device *pdev) | |||
1538 | SNDRV_PCM_FMTBIT_S20_3LE |\ | 1538 | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1539 | SNDRV_PCM_FMTBIT_S24_LE) | 1539 | SNDRV_PCM_FMTBIT_S24_LE) |
1540 | 1540 | ||
1541 | static struct snd_soc_dai_ops wm8350_dai_ops = { | ||
1542 | .hw_params = wm8350_pcm_hw_params, | ||
1543 | .digital_mute = wm8350_mute, | ||
1544 | .trigger = wm8350_pcm_trigger, | ||
1545 | .set_fmt = wm8350_set_dai_fmt, | ||
1546 | .set_sysclk = wm8350_set_dai_sysclk, | ||
1547 | .set_pll = wm8350_set_fll, | ||
1548 | .set_clkdiv = wm8350_set_clkdiv, | ||
1549 | }; | ||
1550 | |||
1541 | struct snd_soc_dai wm8350_dai = { | 1551 | struct snd_soc_dai wm8350_dai = { |
1542 | .name = "WM8350", | 1552 | .name = "WM8350", |
1543 | .playback = { | 1553 | .playback = { |
@@ -1554,15 +1564,7 @@ struct snd_soc_dai wm8350_dai = { | |||
1554 | .rates = WM8350_RATES, | 1564 | .rates = WM8350_RATES, |
1555 | .formats = WM8350_FORMATS, | 1565 | .formats = WM8350_FORMATS, |
1556 | }, | 1566 | }, |
1557 | .ops = { | 1567 | .ops = &wm8350_dai_ops, |
1558 | .hw_params = wm8350_pcm_hw_params, | ||
1559 | .digital_mute = wm8350_mute, | ||
1560 | .trigger = wm8350_pcm_trigger, | ||
1561 | .set_fmt = wm8350_set_dai_fmt, | ||
1562 | .set_sysclk = wm8350_set_dai_sysclk, | ||
1563 | .set_pll = wm8350_set_fll, | ||
1564 | .set_clkdiv = wm8350_set_clkdiv, | ||
1565 | }, | ||
1566 | }; | 1568 | }; |
1567 | EXPORT_SYMBOL_GPL(wm8350_dai); | 1569 | EXPORT_SYMBOL_GPL(wm8350_dai); |
1568 | 1570 | ||
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c index 9cb73d9d023d..4e1cefff8483 100644 --- a/sound/soc/codecs/wm8400.c +++ b/sound/soc/codecs/wm8400.c | |||
@@ -1210,6 +1210,14 @@ static int wm8400_set_bias_level(struct snd_soc_codec *codec, | |||
1210 | #define WM8400_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 1210 | #define WM8400_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1211 | SNDRV_PCM_FMTBIT_S24_LE) | 1211 | SNDRV_PCM_FMTBIT_S24_LE) |
1212 | 1212 | ||
1213 | static struct snd_soc_dai_ops wm8400_dai_ops = { | ||
1214 | .hw_params = wm8400_hw_params, | ||
1215 | .digital_mute = wm8400_mute, | ||
1216 | .set_fmt = wm8400_set_dai_fmt, | ||
1217 | .set_clkdiv = wm8400_set_dai_clkdiv, | ||
1218 | .set_sysclk = wm8400_set_dai_sysclk, | ||
1219 | }; | ||
1220 | |||
1213 | /* | 1221 | /* |
1214 | * The WM8400 supports 2 different and mutually exclusive DAI | 1222 | * The WM8400 supports 2 different and mutually exclusive DAI |
1215 | * configurations. | 1223 | * configurations. |
@@ -1235,13 +1243,7 @@ struct snd_soc_dai wm8400_dai = { | |||
1235 | .rates = WM8400_RATES, | 1243 | .rates = WM8400_RATES, |
1236 | .formats = WM8400_FORMATS, | 1244 | .formats = WM8400_FORMATS, |
1237 | }, | 1245 | }, |
1238 | .ops = { | 1246 | .ops = &wm8400_dai_ops, |
1239 | .hw_params = wm8400_hw_params, | ||
1240 | .digital_mute = wm8400_mute, | ||
1241 | .set_fmt = wm8400_set_dai_fmt, | ||
1242 | .set_clkdiv = wm8400_set_dai_clkdiv, | ||
1243 | .set_sysclk = wm8400_set_dai_sysclk, | ||
1244 | }, | ||
1245 | }; | 1247 | }; |
1246 | EXPORT_SYMBOL_GPL(wm8400_dai); | 1248 | EXPORT_SYMBOL_GPL(wm8400_dai); |
1247 | 1249 | ||
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 6d4ef71e9195..6a4cea09c45d 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -554,6 +554,14 @@ static int wm8510_set_bias_level(struct snd_soc_codec *codec, | |||
554 | #define WM8510_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 554 | #define WM8510_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
555 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 555 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
556 | 556 | ||
557 | static struct snd_soc_dai_ops wm8510_dai_ops = { | ||
558 | .hw_params = wm8510_pcm_hw_params, | ||
559 | .digital_mute = wm8510_mute, | ||
560 | .set_fmt = wm8510_set_dai_fmt, | ||
561 | .set_clkdiv = wm8510_set_dai_clkdiv, | ||
562 | .set_pll = wm8510_set_dai_pll, | ||
563 | }; | ||
564 | |||
557 | struct snd_soc_dai wm8510_dai = { | 565 | struct snd_soc_dai wm8510_dai = { |
558 | .name = "WM8510 HiFi", | 566 | .name = "WM8510 HiFi", |
559 | .playback = { | 567 | .playback = { |
@@ -568,13 +576,7 @@ struct snd_soc_dai wm8510_dai = { | |||
568 | .channels_max = 2, | 576 | .channels_max = 2, |
569 | .rates = WM8510_RATES, | 577 | .rates = WM8510_RATES, |
570 | .formats = WM8510_FORMATS,}, | 578 | .formats = WM8510_FORMATS,}, |
571 | .ops = { | 579 | .ops = &wm8510_dai_ops, |
572 | .hw_params = wm8510_pcm_hw_params, | ||
573 | .digital_mute = wm8510_mute, | ||
574 | .set_fmt = wm8510_set_dai_fmt, | ||
575 | .set_clkdiv = wm8510_set_dai_clkdiv, | ||
576 | .set_pll = wm8510_set_dai_pll, | ||
577 | }, | ||
578 | }; | 580 | }; |
579 | EXPORT_SYMBOL_GPL(wm8510_dai); | 581 | EXPORT_SYMBOL_GPL(wm8510_dai); |
580 | 582 | ||
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 6cab82a9c9d7..27f9e231bf69 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -769,6 +769,21 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, | |||
769 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 769 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
770 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 770 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
771 | 771 | ||
772 | static struct snd_soc_dai_ops wm8580_dai_ops_playback = { | ||
773 | .hw_params = wm8580_paif_hw_params, | ||
774 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
775 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
776 | .set_pll = wm8580_set_dai_pll, | ||
777 | .digital_mute = wm8580_digital_mute, | ||
778 | }; | ||
779 | |||
780 | static struct snd_soc_dai_ops wm8580_dai_ops_capture = { | ||
781 | .hw_params = wm8580_paif_hw_params, | ||
782 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
783 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
784 | .set_pll = wm8580_set_dai_pll, | ||
785 | }; | ||
786 | |||
772 | struct snd_soc_dai wm8580_dai[] = { | 787 | struct snd_soc_dai wm8580_dai[] = { |
773 | { | 788 | { |
774 | .name = "WM8580 PAIFRX", | 789 | .name = "WM8580 PAIFRX", |
@@ -780,13 +795,7 @@ struct snd_soc_dai wm8580_dai[] = { | |||
780 | .rates = SNDRV_PCM_RATE_8000_192000, | 795 | .rates = SNDRV_PCM_RATE_8000_192000, |
781 | .formats = WM8580_FORMATS, | 796 | .formats = WM8580_FORMATS, |
782 | }, | 797 | }, |
783 | .ops = { | 798 | .ops = &wm8580_dai_ops_playback, |
784 | .hw_params = wm8580_paif_hw_params, | ||
785 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
786 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
787 | .set_pll = wm8580_set_dai_pll, | ||
788 | .digital_mute = wm8580_digital_mute, | ||
789 | }, | ||
790 | }, | 799 | }, |
791 | { | 800 | { |
792 | .name = "WM8580 PAIFTX", | 801 | .name = "WM8580 PAIFTX", |
@@ -798,12 +807,7 @@ struct snd_soc_dai wm8580_dai[] = { | |||
798 | .rates = SNDRV_PCM_RATE_8000_192000, | 807 | .rates = SNDRV_PCM_RATE_8000_192000, |
799 | .formats = WM8580_FORMATS, | 808 | .formats = WM8580_FORMATS, |
800 | }, | 809 | }, |
801 | .ops = { | 810 | .ops = &wm8580_dai_ops_capture, |
802 | .hw_params = wm8580_paif_hw_params, | ||
803 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
804 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
805 | .set_pll = wm8580_set_dai_pll, | ||
806 | }, | ||
807 | }, | 811 | }, |
808 | }; | 812 | }; |
809 | EXPORT_SYMBOL_GPL(wm8580_dai); | 813 | EXPORT_SYMBOL_GPL(wm8580_dai); |
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c index f8363b308895..e7ff2121ede9 100644 --- a/sound/soc/codecs/wm8728.c +++ b/sound/soc/codecs/wm8728.c | |||
@@ -244,6 +244,12 @@ static int wm8728_set_bias_level(struct snd_soc_codec *codec, | |||
244 | #define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 244 | #define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
245 | SNDRV_PCM_FMTBIT_S24_LE) | 245 | SNDRV_PCM_FMTBIT_S24_LE) |
246 | 246 | ||
247 | static struct snd_soc_dai_ops wm8728_dai_ops = { | ||
248 | .hw_params = wm8728_hw_params, | ||
249 | .digital_mute = wm8728_mute, | ||
250 | .set_fmt = wm8728_set_dai_fmt, | ||
251 | }; | ||
252 | |||
247 | struct snd_soc_dai wm8728_dai = { | 253 | struct snd_soc_dai wm8728_dai = { |
248 | .name = "WM8728", | 254 | .name = "WM8728", |
249 | .playback = { | 255 | .playback = { |
@@ -253,11 +259,7 @@ struct snd_soc_dai wm8728_dai = { | |||
253 | .rates = WM8728_RATES, | 259 | .rates = WM8728_RATES, |
254 | .formats = WM8728_FORMATS, | 260 | .formats = WM8728_FORMATS, |
255 | }, | 261 | }, |
256 | .ops = { | 262 | .ops = &wm8728_dai_ops, |
257 | .hw_params = wm8728_hw_params, | ||
258 | .digital_mute = wm8728_mute, | ||
259 | .set_fmt = wm8728_set_dai_fmt, | ||
260 | } | ||
261 | }; | 263 | }; |
262 | EXPORT_SYMBOL_GPL(wm8728_dai); | 264 | EXPORT_SYMBOL_GPL(wm8728_dai); |
263 | 265 | ||
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 9e7ebcc2c491..e043e3f60008 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -433,6 +433,15 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, | |||
433 | #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 433 | #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
434 | SNDRV_PCM_FMTBIT_S24_LE) | 434 | SNDRV_PCM_FMTBIT_S24_LE) |
435 | 435 | ||
436 | static struct snd_soc_dai_ops wm8731_dai_ops = { | ||
437 | .prepare = wm8731_pcm_prepare, | ||
438 | .hw_params = wm8731_hw_params, | ||
439 | .shutdown = wm8731_shutdown, | ||
440 | .digital_mute = wm8731_mute, | ||
441 | .set_sysclk = wm8731_set_dai_sysclk, | ||
442 | .set_fmt = wm8731_set_dai_fmt, | ||
443 | }; | ||
444 | |||
436 | struct snd_soc_dai wm8731_dai = { | 445 | struct snd_soc_dai wm8731_dai = { |
437 | .name = "WM8731", | 446 | .name = "WM8731", |
438 | .playback = { | 447 | .playback = { |
@@ -447,14 +456,7 @@ struct snd_soc_dai wm8731_dai = { | |||
447 | .channels_max = 2, | 456 | .channels_max = 2, |
448 | .rates = WM8731_RATES, | 457 | .rates = WM8731_RATES, |
449 | .formats = WM8731_FORMATS,}, | 458 | .formats = WM8731_FORMATS,}, |
450 | .ops = { | 459 | .ops = &wm8731_dai_ops, |
451 | .prepare = wm8731_pcm_prepare, | ||
452 | .hw_params = wm8731_hw_params, | ||
453 | .shutdown = wm8731_shutdown, | ||
454 | .digital_mute = wm8731_mute, | ||
455 | .set_sysclk = wm8731_set_dai_sysclk, | ||
456 | .set_fmt = wm8731_set_dai_fmt, | ||
457 | } | ||
458 | }; | 460 | }; |
459 | EXPORT_SYMBOL_GPL(wm8731_dai); | 461 | EXPORT_SYMBOL_GPL(wm8731_dai); |
460 | 462 | ||
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index 96afb86addc6..b64509b01a49 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c | |||
@@ -679,6 +679,13 @@ static int wm8750_set_bias_level(struct snd_soc_codec *codec, | |||
679 | #define WM8750_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 679 | #define WM8750_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
680 | SNDRV_PCM_FMTBIT_S24_LE) | 680 | SNDRV_PCM_FMTBIT_S24_LE) |
681 | 681 | ||
682 | static struct snd_soc_dai_ops wm8750_dai_ops = { | ||
683 | .hw_params = wm8750_pcm_hw_params, | ||
684 | .digital_mute = wm8750_mute, | ||
685 | .set_fmt = wm8750_set_dai_fmt, | ||
686 | .set_sysclk = wm8750_set_dai_sysclk, | ||
687 | }; | ||
688 | |||
682 | struct snd_soc_dai wm8750_dai = { | 689 | struct snd_soc_dai wm8750_dai = { |
683 | .name = "WM8750", | 690 | .name = "WM8750", |
684 | .playback = { | 691 | .playback = { |
@@ -693,12 +700,7 @@ struct snd_soc_dai wm8750_dai = { | |||
693 | .channels_max = 2, | 700 | .channels_max = 2, |
694 | .rates = WM8750_RATES, | 701 | .rates = WM8750_RATES, |
695 | .formats = WM8750_FORMATS,}, | 702 | .formats = WM8750_FORMATS,}, |
696 | .ops = { | 703 | .ops = &wm8750_dai_ops, |
697 | .hw_params = wm8750_pcm_hw_params, | ||
698 | .digital_mute = wm8750_mute, | ||
699 | .set_fmt = wm8750_set_dai_fmt, | ||
700 | .set_sysclk = wm8750_set_dai_sysclk, | ||
701 | }, | ||
702 | }; | 704 | }; |
703 | EXPORT_SYMBOL_GPL(wm8750_dai); | 705 | EXPORT_SYMBOL_GPL(wm8750_dai); |
704 | 706 | ||
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 1d5eca89de60..a6e8f3f7f052 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1301,6 +1301,51 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec, | |||
1301 | * 3. Voice disabled - HIFI over HIFI | 1301 | * 3. Voice disabled - HIFI over HIFI |
1302 | * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture | 1302 | * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture |
1303 | */ | 1303 | */ |
1304 | static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode1 = { | ||
1305 | .hw_params = wm8753_i2s_hw_params, | ||
1306 | .digital_mute = wm8753_mute, | ||
1307 | .set_fmt = wm8753_mode1h_set_dai_fmt, | ||
1308 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1309 | .set_pll = wm8753_set_dai_pll, | ||
1310 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1311 | }; | ||
1312 | |||
1313 | static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode1 = { | ||
1314 | .hw_params = wm8753_pcm_hw_params, | ||
1315 | .digital_mute = wm8753_mute, | ||
1316 | .set_fmt = wm8753_mode1v_set_dai_fmt, | ||
1317 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1318 | .set_pll = wm8753_set_dai_pll, | ||
1319 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1320 | }; | ||
1321 | |||
1322 | static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode2 = { | ||
1323 | .hw_params = wm8753_pcm_hw_params, | ||
1324 | .digital_mute = wm8753_mute, | ||
1325 | .set_fmt = wm8753_mode2_set_dai_fmt, | ||
1326 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1327 | .set_pll = wm8753_set_dai_pll, | ||
1328 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1329 | }; | ||
1330 | |||
1331 | static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode3 = { | ||
1332 | .hw_params = wm8753_i2s_hw_params, | ||
1333 | .digital_mute = wm8753_mute, | ||
1334 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1335 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1336 | .set_pll = wm8753_set_dai_pll, | ||
1337 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1338 | }; | ||
1339 | |||
1340 | static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode4 = { | ||
1341 | .hw_params = wm8753_i2s_hw_params, | ||
1342 | .digital_mute = wm8753_mute, | ||
1343 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1344 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1345 | .set_pll = wm8753_set_dai_pll, | ||
1346 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1347 | }; | ||
1348 | |||
1304 | static const struct snd_soc_dai wm8753_all_dai[] = { | 1349 | static const struct snd_soc_dai wm8753_all_dai[] = { |
1305 | /* DAI HiFi mode 1 */ | 1350 | /* DAI HiFi mode 1 */ |
1306 | { .name = "WM8753 HiFi", | 1351 | { .name = "WM8753 HiFi", |
@@ -1317,14 +1362,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1317 | .channels_max = 2, | 1362 | .channels_max = 2, |
1318 | .rates = WM8753_RATES, | 1363 | .rates = WM8753_RATES, |
1319 | .formats = WM8753_FORMATS}, | 1364 | .formats = WM8753_FORMATS}, |
1320 | .ops = { | 1365 | .ops = &wm8753_dai_ops_hifi_mode1, |
1321 | .hw_params = wm8753_i2s_hw_params, | ||
1322 | .digital_mute = wm8753_mute, | ||
1323 | .set_fmt = wm8753_mode1h_set_dai_fmt, | ||
1324 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1325 | .set_pll = wm8753_set_dai_pll, | ||
1326 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1327 | }, | ||
1328 | }, | 1366 | }, |
1329 | /* DAI Voice mode 1 */ | 1367 | /* DAI Voice mode 1 */ |
1330 | { .name = "WM8753 Voice", | 1368 | { .name = "WM8753 Voice", |
@@ -1341,14 +1379,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1341 | .channels_max = 2, | 1379 | .channels_max = 2, |
1342 | .rates = WM8753_RATES, | 1380 | .rates = WM8753_RATES, |
1343 | .formats = WM8753_FORMATS,}, | 1381 | .formats = WM8753_FORMATS,}, |
1344 | .ops = { | 1382 | .ops = &wm8753_dai_ops_voice_mode1, |
1345 | .hw_params = wm8753_pcm_hw_params, | ||
1346 | .digital_mute = wm8753_mute, | ||
1347 | .set_fmt = wm8753_mode1v_set_dai_fmt, | ||
1348 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1349 | .set_pll = wm8753_set_dai_pll, | ||
1350 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1351 | }, | ||
1352 | }, | 1383 | }, |
1353 | /* DAI HiFi mode 2 - dummy */ | 1384 | /* DAI HiFi mode 2 - dummy */ |
1354 | { .name = "WM8753 HiFi", | 1385 | { .name = "WM8753 HiFi", |
@@ -1369,14 +1400,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1369 | .channels_max = 2, | 1400 | .channels_max = 2, |
1370 | .rates = WM8753_RATES, | 1401 | .rates = WM8753_RATES, |
1371 | .formats = WM8753_FORMATS,}, | 1402 | .formats = WM8753_FORMATS,}, |
1372 | .ops = { | 1403 | .ops = &wm8753_dai_ops_voice_mode2, |
1373 | .hw_params = wm8753_pcm_hw_params, | ||
1374 | .digital_mute = wm8753_mute, | ||
1375 | .set_fmt = wm8753_mode2_set_dai_fmt, | ||
1376 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1377 | .set_pll = wm8753_set_dai_pll, | ||
1378 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1379 | }, | ||
1380 | }, | 1404 | }, |
1381 | /* DAI HiFi mode 3 */ | 1405 | /* DAI HiFi mode 3 */ |
1382 | { .name = "WM8753 HiFi", | 1406 | { .name = "WM8753 HiFi", |
@@ -1393,14 +1417,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1393 | .channels_max = 2, | 1417 | .channels_max = 2, |
1394 | .rates = WM8753_RATES, | 1418 | .rates = WM8753_RATES, |
1395 | .formats = WM8753_FORMATS,}, | 1419 | .formats = WM8753_FORMATS,}, |
1396 | .ops = { | 1420 | .ops = &wm8753_dai_ops_hifi_mode3, |
1397 | .hw_params = wm8753_i2s_hw_params, | ||
1398 | .digital_mute = wm8753_mute, | ||
1399 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1400 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1401 | .set_pll = wm8753_set_dai_pll, | ||
1402 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1403 | }, | ||
1404 | }, | 1421 | }, |
1405 | /* DAI Voice mode 3 - dummy */ | 1422 | /* DAI Voice mode 3 - dummy */ |
1406 | { .name = "WM8753 Voice", | 1423 | { .name = "WM8753 Voice", |
@@ -1421,14 +1438,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1421 | .channels_max = 2, | 1438 | .channels_max = 2, |
1422 | .rates = WM8753_RATES, | 1439 | .rates = WM8753_RATES, |
1423 | .formats = WM8753_FORMATS,}, | 1440 | .formats = WM8753_FORMATS,}, |
1424 | .ops = { | 1441 | .ops = &wm8753_dai_ops_hifi_mode4, |
1425 | .hw_params = wm8753_i2s_hw_params, | ||
1426 | .digital_mute = wm8753_mute, | ||
1427 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1428 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1429 | .set_pll = wm8753_set_dai_pll, | ||
1430 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1431 | }, | ||
1432 | }, | 1442 | }, |
1433 | /* DAI Voice mode 4 - dummy */ | 1443 | /* DAI Voice mode 4 - dummy */ |
1434 | { .name = "WM8753 Voice", | 1444 | { .name = "WM8753 Voice", |
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index da5ca64f89bb..46c5ea1ff921 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c | |||
@@ -1088,6 +1088,14 @@ static int wm8900_digital_mute(struct snd_soc_dai *codec_dai, int mute) | |||
1088 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ | 1088 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ |
1089 | SNDRV_PCM_FORMAT_S24_LE) | 1089 | SNDRV_PCM_FORMAT_S24_LE) |
1090 | 1090 | ||
1091 | static struct snd_soc_dai_ops wm8900_dai_ops = { | ||
1092 | .hw_params = wm8900_hw_params, | ||
1093 | .set_clkdiv = wm8900_set_dai_clkdiv, | ||
1094 | .set_pll = wm8900_set_dai_pll, | ||
1095 | .set_fmt = wm8900_set_dai_fmt, | ||
1096 | .digital_mute = wm8900_digital_mute, | ||
1097 | }; | ||
1098 | |||
1091 | struct snd_soc_dai wm8900_dai = { | 1099 | struct snd_soc_dai wm8900_dai = { |
1092 | .name = "WM8900 HiFi", | 1100 | .name = "WM8900 HiFi", |
1093 | .playback = { | 1101 | .playback = { |
@@ -1104,13 +1112,7 @@ struct snd_soc_dai wm8900_dai = { | |||
1104 | .rates = WM8900_RATES, | 1112 | .rates = WM8900_RATES, |
1105 | .formats = WM8900_PCM_FORMATS, | 1113 | .formats = WM8900_PCM_FORMATS, |
1106 | }, | 1114 | }, |
1107 | .ops = { | 1115 | .ops = &wm8900_dai_ops, |
1108 | .hw_params = wm8900_hw_params, | ||
1109 | .set_clkdiv = wm8900_set_dai_clkdiv, | ||
1110 | .set_pll = wm8900_set_dai_pll, | ||
1111 | .set_fmt = wm8900_set_dai_fmt, | ||
1112 | .digital_mute = wm8900_digital_mute, | ||
1113 | }, | ||
1114 | }; | 1116 | }; |
1115 | EXPORT_SYMBOL_GPL(wm8900_dai); | 1117 | EXPORT_SYMBOL_GPL(wm8900_dai); |
1116 | 1118 | ||
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index c6fa8a71b4dd..8cf571f1a803 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -1497,6 +1497,15 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream, | |||
1497 | SNDRV_PCM_FMTBIT_S20_3LE |\ | 1497 | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1498 | SNDRV_PCM_FMTBIT_S24_LE) | 1498 | SNDRV_PCM_FMTBIT_S24_LE) |
1499 | 1499 | ||
1500 | static struct snd_soc_dai_ops wm8903_dai_ops = { | ||
1501 | .startup = wm8903_startup, | ||
1502 | .shutdown = wm8903_shutdown, | ||
1503 | .hw_params = wm8903_hw_params, | ||
1504 | .digital_mute = wm8903_digital_mute, | ||
1505 | .set_fmt = wm8903_set_dai_fmt, | ||
1506 | .set_sysclk = wm8903_set_dai_sysclk, | ||
1507 | }; | ||
1508 | |||
1500 | struct snd_soc_dai wm8903_dai = { | 1509 | struct snd_soc_dai wm8903_dai = { |
1501 | .name = "WM8903", | 1510 | .name = "WM8903", |
1502 | .playback = { | 1511 | .playback = { |
@@ -1513,14 +1522,7 @@ struct snd_soc_dai wm8903_dai = { | |||
1513 | .rates = WM8903_CAPTURE_RATES, | 1522 | .rates = WM8903_CAPTURE_RATES, |
1514 | .formats = WM8903_FORMATS, | 1523 | .formats = WM8903_FORMATS, |
1515 | }, | 1524 | }, |
1516 | .ops = { | 1525 | .ops = &wm8903_dai_ops, |
1517 | .startup = wm8903_startup, | ||
1518 | .shutdown = wm8903_shutdown, | ||
1519 | .hw_params = wm8903_hw_params, | ||
1520 | .digital_mute = wm8903_digital_mute, | ||
1521 | .set_fmt = wm8903_set_dai_fmt, | ||
1522 | .set_sysclk = wm8903_set_dai_sysclk | ||
1523 | } | ||
1524 | }; | 1526 | }; |
1525 | EXPORT_SYMBOL_GPL(wm8903_dai); | 1527 | EXPORT_SYMBOL_GPL(wm8903_dai); |
1526 | 1528 | ||
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index 24d4c905a011..032dca22dbd3 100644 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c | |||
@@ -604,6 +604,13 @@ static int wm8971_set_bias_level(struct snd_soc_codec *codec, | |||
604 | #define WM8971_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 604 | #define WM8971_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
605 | SNDRV_PCM_FMTBIT_S24_LE) | 605 | SNDRV_PCM_FMTBIT_S24_LE) |
606 | 606 | ||
607 | static struct snd_soc_dai_ops wm8971_dai_ops = { | ||
608 | .hw_params = wm8971_pcm_hw_params, | ||
609 | .digital_mute = wm8971_mute, | ||
610 | .set_fmt = wm8971_set_dai_fmt, | ||
611 | .set_sysclk = wm8971_set_dai_sysclk, | ||
612 | }; | ||
613 | |||
607 | struct snd_soc_dai wm8971_dai = { | 614 | struct snd_soc_dai wm8971_dai = { |
608 | .name = "WM8971", | 615 | .name = "WM8971", |
609 | .playback = { | 616 | .playback = { |
@@ -618,12 +625,7 @@ struct snd_soc_dai wm8971_dai = { | |||
618 | .channels_max = 2, | 625 | .channels_max = 2, |
619 | .rates = WM8971_RATES, | 626 | .rates = WM8971_RATES, |
620 | .formats = WM8971_FORMATS,}, | 627 | .formats = WM8971_FORMATS,}, |
621 | .ops = { | 628 | .ops = &wm8971_dai_ops, |
622 | .hw_params = wm8971_pcm_hw_params, | ||
623 | .digital_mute = wm8971_mute, | ||
624 | .set_fmt = wm8971_set_dai_fmt, | ||
625 | .set_sysclk = wm8971_set_dai_sysclk, | ||
626 | }, | ||
627 | }; | 629 | }; |
628 | EXPORT_SYMBOL_GPL(wm8971_dai); | 630 | EXPORT_SYMBOL_GPL(wm8971_dai); |
629 | 631 | ||
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index 1a38421f7594..c518c3e5aa3f 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c | |||
@@ -1332,6 +1332,15 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec, | |||
1332 | * 1. ADC/DAC on Primary Interface | 1332 | * 1. ADC/DAC on Primary Interface |
1333 | * 2. ADC on Primary Interface/DAC on secondary | 1333 | * 2. ADC on Primary Interface/DAC on secondary |
1334 | */ | 1334 | */ |
1335 | static struct snd_soc_dai_ops wm8990_dai_ops = { | ||
1336 | .hw_params = wm8990_hw_params, | ||
1337 | .digital_mute = wm8990_mute, | ||
1338 | .set_fmt = wm8990_set_dai_fmt, | ||
1339 | .set_clkdiv = wm8990_set_dai_clkdiv, | ||
1340 | .set_pll = wm8990_set_dai_pll, | ||
1341 | .set_sysclk = wm8990_set_dai_sysclk, | ||
1342 | }; | ||
1343 | |||
1335 | struct snd_soc_dai wm8990_dai = { | 1344 | struct snd_soc_dai wm8990_dai = { |
1336 | /* ADC/DAC on primary */ | 1345 | /* ADC/DAC on primary */ |
1337 | .name = "WM8990 ADC/DAC Primary", | 1346 | .name = "WM8990 ADC/DAC Primary", |
@@ -1348,14 +1357,7 @@ struct snd_soc_dai wm8990_dai = { | |||
1348 | .channels_max = 2, | 1357 | .channels_max = 2, |
1349 | .rates = WM8990_RATES, | 1358 | .rates = WM8990_RATES, |
1350 | .formats = WM8990_FORMATS,}, | 1359 | .formats = WM8990_FORMATS,}, |
1351 | .ops = { | 1360 | .ops = &wm8990_dai_ops, |
1352 | .hw_params = wm8990_hw_params, | ||
1353 | .digital_mute = wm8990_mute, | ||
1354 | .set_fmt = wm8990_set_dai_fmt, | ||
1355 | .set_clkdiv = wm8990_set_dai_clkdiv, | ||
1356 | .set_pll = wm8990_set_dai_pll, | ||
1357 | .set_sysclk = wm8990_set_dai_sysclk, | ||
1358 | }, | ||
1359 | }; | 1361 | }; |
1360 | EXPORT_SYMBOL_GPL(wm8990_dai); | 1362 | EXPORT_SYMBOL_GPL(wm8990_dai); |
1361 | 1363 | ||
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c index 2e9e06b2daaf..3265817c5c26 100644 --- a/sound/soc/codecs/wm9705.c +++ b/sound/soc/codecs/wm9705.c | |||
@@ -269,6 +269,10 @@ static int ac97_prepare(struct snd_pcm_substream *substream, | |||
269 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | 269 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ |
270 | SNDRV_PCM_RATE_48000) | 270 | SNDRV_PCM_RATE_48000) |
271 | 271 | ||
272 | static struct snd_soc_dai_ops wm9705_dai_ops = { | ||
273 | .prepare = ac97_prepare, | ||
274 | }; | ||
275 | |||
272 | struct snd_soc_dai wm9705_dai[] = { | 276 | struct snd_soc_dai wm9705_dai[] = { |
273 | { | 277 | { |
274 | .name = "AC97 HiFi", | 278 | .name = "AC97 HiFi", |
@@ -287,9 +291,7 @@ struct snd_soc_dai wm9705_dai[] = { | |||
287 | .rates = WM9705_AC97_RATES, | 291 | .rates = WM9705_AC97_RATES, |
288 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 292 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
289 | }, | 293 | }, |
290 | .ops = { | 294 | .ops = &wm9705_dai_ops, |
291 | .prepare = ac97_prepare, | ||
292 | }, | ||
293 | }, | 295 | }, |
294 | { | 296 | { |
295 | .name = "AC97 Aux", | 297 | .name = "AC97 Aux", |
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index b3a8be77676e..765cf1e7369e 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -517,6 +517,14 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, | |||
517 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ | 517 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ |
518 | SNDRV_PCM_RATE_48000) | 518 | SNDRV_PCM_RATE_48000) |
519 | 519 | ||
520 | static struct snd_soc_dai_ops wm9712_dai_ops_hifi = { | ||
521 | .prepare = ac97_prepare, | ||
522 | }; | ||
523 | |||
524 | static struct snd_soc_dai_ops wm9712_dai_ops_aux = { | ||
525 | .prepare = ac97_aux_prepare, | ||
526 | }; | ||
527 | |||
520 | struct snd_soc_dai wm9712_dai[] = { | 528 | struct snd_soc_dai wm9712_dai[] = { |
521 | { | 529 | { |
522 | .name = "AC97 HiFi", | 530 | .name = "AC97 HiFi", |
@@ -533,8 +541,7 @@ struct snd_soc_dai wm9712_dai[] = { | |||
533 | .channels_max = 2, | 541 | .channels_max = 2, |
534 | .rates = WM9712_AC97_RATES, | 542 | .rates = WM9712_AC97_RATES, |
535 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 543 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
536 | .ops = { | 544 | .ops = &wm9712_dai_ops_hifi, |
537 | .prepare = ac97_prepare,}, | ||
538 | }, | 545 | }, |
539 | { | 546 | { |
540 | .name = "AC97 Aux", | 547 | .name = "AC97 Aux", |
@@ -544,8 +551,7 @@ struct snd_soc_dai wm9712_dai[] = { | |||
544 | .channels_max = 1, | 551 | .channels_max = 1, |
545 | .rates = WM9712_AC97_RATES, | 552 | .rates = WM9712_AC97_RATES, |
546 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 553 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
547 | .ops = { | 554 | .ops = &wm9712_dai_ops_aux, |
548 | .prepare = ac97_aux_prepare,}, | ||
549 | } | 555 | } |
550 | }; | 556 | }; |
551 | EXPORT_SYMBOL_GPL(wm9712_dai); | 557 | EXPORT_SYMBOL_GPL(wm9712_dai); |
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index a93aea5c1878..523bad077fa0 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -1005,6 +1005,27 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, | |||
1005 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ | 1005 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ |
1006 | SNDRV_PCM_FORMAT_S24_LE) | 1006 | SNDRV_PCM_FORMAT_S24_LE) |
1007 | 1007 | ||
1008 | static struct snd_soc_dai_ops wm9713_dai_ops_hifi = { | ||
1009 | .prepare = ac97_hifi_prepare, | ||
1010 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1011 | .set_pll = wm9713_set_dai_pll, | ||
1012 | }; | ||
1013 | |||
1014 | static struct snd_soc_dai_ops wm9713_dai_ops_aux = { | ||
1015 | .prepare = ac97_aux_prepare, | ||
1016 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1017 | .set_pll = wm9713_set_dai_pll, | ||
1018 | }; | ||
1019 | |||
1020 | static struct snd_soc_dai_ops wm9713_dai_ops_voice = { | ||
1021 | .hw_params = wm9713_pcm_hw_params, | ||
1022 | .shutdown = wm9713_voiceshutdown, | ||
1023 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1024 | .set_pll = wm9713_set_dai_pll, | ||
1025 | .set_fmt = wm9713_set_dai_fmt, | ||
1026 | .set_tristate = wm9713_set_dai_tristate, | ||
1027 | }; | ||
1028 | |||
1008 | struct snd_soc_dai wm9713_dai[] = { | 1029 | struct snd_soc_dai wm9713_dai[] = { |
1009 | { | 1030 | { |
1010 | .name = "AC97 HiFi", | 1031 | .name = "AC97 HiFi", |
@@ -1021,10 +1042,7 @@ struct snd_soc_dai wm9713_dai[] = { | |||
1021 | .channels_max = 2, | 1042 | .channels_max = 2, |
1022 | .rates = WM9713_RATES, | 1043 | .rates = WM9713_RATES, |
1023 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 1044 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
1024 | .ops = { | 1045 | .ops = &wm9713_dai_ops_hifi, |
1025 | .prepare = ac97_hifi_prepare, | ||
1026 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1027 | .set_pll = wm9713_set_dai_pll,}, | ||
1028 | }, | 1046 | }, |
1029 | { | 1047 | { |
1030 | .name = "AC97 Aux", | 1048 | .name = "AC97 Aux", |
@@ -1034,10 +1052,7 @@ struct snd_soc_dai wm9713_dai[] = { | |||
1034 | .channels_max = 1, | 1052 | .channels_max = 1, |
1035 | .rates = WM9713_RATES, | 1053 | .rates = WM9713_RATES, |
1036 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 1054 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
1037 | .ops = { | 1055 | .ops = &wm9713_dai_ops_aux, |
1038 | .prepare = ac97_aux_prepare, | ||
1039 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1040 | .set_pll = wm9713_set_dai_pll,}, | ||
1041 | }, | 1056 | }, |
1042 | { | 1057 | { |
1043 | .name = "WM9713 Voice", | 1058 | .name = "WM9713 Voice", |
@@ -1053,14 +1068,7 @@ struct snd_soc_dai wm9713_dai[] = { | |||
1053 | .channels_max = 2, | 1068 | .channels_max = 2, |
1054 | .rates = WM9713_PCM_RATES, | 1069 | .rates = WM9713_PCM_RATES, |
1055 | .formats = WM9713_PCM_FORMATS,}, | 1070 | .formats = WM9713_PCM_FORMATS,}, |
1056 | .ops = { | 1071 | .ops = &wm9713_dai_ops_voice, |
1057 | .hw_params = wm9713_pcm_hw_params, | ||
1058 | .shutdown = wm9713_voiceshutdown, | ||
1059 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1060 | .set_pll = wm9713_set_dai_pll, | ||
1061 | .set_fmt = wm9713_set_dai_fmt, | ||
1062 | .set_tristate = wm9713_set_dai_tristate, | ||
1063 | }, | ||
1064 | }, | 1072 | }, |
1065 | }; | 1073 | }; |
1066 | EXPORT_SYMBOL_GPL(wm9713_dai); | 1074 | EXPORT_SYMBOL_GPL(wm9713_dai); |
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index 0fee779e3c76..ffdb9439d3d8 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -499,6 +499,13 @@ static void davinci_i2s_remove(struct platform_device *pdev, | |||
499 | 499 | ||
500 | #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 | 500 | #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 |
501 | 501 | ||
502 | static struct snd_soc_dai_ops davinci_i2s_dai_ops = { | ||
503 | .startup = davinci_i2s_startup, | ||
504 | .trigger = davinci_i2s_trigger, | ||
505 | .hw_params = davinci_i2s_hw_params, | ||
506 | .set_fmt = davinci_i2s_set_dai_fmt, | ||
507 | }; | ||
508 | |||
502 | struct snd_soc_dai davinci_i2s_dai = { | 509 | struct snd_soc_dai davinci_i2s_dai = { |
503 | .name = "davinci-i2s", | 510 | .name = "davinci-i2s", |
504 | .id = 0, | 511 | .id = 0, |
@@ -514,12 +521,7 @@ struct snd_soc_dai davinci_i2s_dai = { | |||
514 | .channels_max = 2, | 521 | .channels_max = 2, |
515 | .rates = DAVINCI_I2S_RATES, | 522 | .rates = DAVINCI_I2S_RATES, |
516 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 523 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
517 | .ops = { | 524 | .ops = &davinci_i2s_dai_ops, |
518 | .startup = davinci_i2s_startup, | ||
519 | .trigger = davinci_i2s_trigger, | ||
520 | .hw_params = davinci_i2s_hw_params, | ||
521 | .set_fmt = davinci_i2s_set_dai_fmt, | ||
522 | }, | ||
523 | }; | 525 | }; |
524 | EXPORT_SYMBOL_GPL(davinci_i2s_dai); | 526 | EXPORT_SYMBOL_GPL(davinci_i2s_dai); |
525 | 527 | ||
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index b7733e6be192..169bca295b78 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -580,6 +580,15 @@ static int fsl_ssi_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format) | |||
580 | /** | 580 | /** |
581 | * fsl_ssi_dai_template: template CPU DAI for the SSI | 581 | * fsl_ssi_dai_template: template CPU DAI for the SSI |
582 | */ | 582 | */ |
583 | static struct snd_soc_dai_ops fsl_ssi_dai_ops = { | ||
584 | .startup = fsl_ssi_startup, | ||
585 | .hw_params = fsl_ssi_hw_params, | ||
586 | .shutdown = fsl_ssi_shutdown, | ||
587 | .trigger = fsl_ssi_trigger, | ||
588 | .set_sysclk = fsl_ssi_set_sysclk, | ||
589 | .set_fmt = fsl_ssi_set_fmt, | ||
590 | }; | ||
591 | |||
583 | static struct snd_soc_dai fsl_ssi_dai_template = { | 592 | static struct snd_soc_dai fsl_ssi_dai_template = { |
584 | .playback = { | 593 | .playback = { |
585 | /* The SSI does not support monaural audio. */ | 594 | /* The SSI does not support monaural audio. */ |
@@ -594,14 +603,7 @@ static struct snd_soc_dai fsl_ssi_dai_template = { | |||
594 | .rates = FSLSSI_I2S_RATES, | 603 | .rates = FSLSSI_I2S_RATES, |
595 | .formats = FSLSSI_I2S_FORMATS, | 604 | .formats = FSLSSI_I2S_FORMATS, |
596 | }, | 605 | }, |
597 | .ops = { | 606 | .ops = &fsl_ssi_dai_ops, |
598 | .startup = fsl_ssi_startup, | ||
599 | .hw_params = fsl_ssi_hw_params, | ||
600 | .shutdown = fsl_ssi_shutdown, | ||
601 | .trigger = fsl_ssi_trigger, | ||
602 | .set_sysclk = fsl_ssi_set_sysclk, | ||
603 | .set_fmt = fsl_ssi_set_fmt, | ||
604 | }, | ||
605 | }; | 607 | }; |
606 | 608 | ||
607 | /** | 609 | /** |
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index 9eb1ce185bd0..3aa729df27b5 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c | |||
@@ -468,6 +468,16 @@ static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format) | |||
468 | /** | 468 | /** |
469 | * psc_i2s_dai_template: template CPU Digital Audio Interface | 469 | * psc_i2s_dai_template: template CPU Digital Audio Interface |
470 | */ | 470 | */ |
471 | static struct snd_soc_dai_ops psc_i2s_dai_ops = { | ||
472 | .startup = psc_i2s_startup, | ||
473 | .hw_params = psc_i2s_hw_params, | ||
474 | .hw_free = psc_i2s_hw_free, | ||
475 | .shutdown = psc_i2s_shutdown, | ||
476 | .trigger = psc_i2s_trigger, | ||
477 | .set_sysclk = psc_i2s_set_sysclk, | ||
478 | .set_fmt = psc_i2s_set_fmt, | ||
479 | }; | ||
480 | |||
471 | static struct snd_soc_dai psc_i2s_dai_template = { | 481 | static struct snd_soc_dai psc_i2s_dai_template = { |
472 | .playback = { | 482 | .playback = { |
473 | .channels_min = 2, | 483 | .channels_min = 2, |
@@ -481,15 +491,7 @@ static struct snd_soc_dai psc_i2s_dai_template = { | |||
481 | .rates = PSC_I2S_RATES, | 491 | .rates = PSC_I2S_RATES, |
482 | .formats = PSC_I2S_FORMATS, | 492 | .formats = PSC_I2S_FORMATS, |
483 | }, | 493 | }, |
484 | .ops = { | 494 | .ops = &psc_i2s_dai_ops, |
485 | .startup = psc_i2s_startup, | ||
486 | .hw_params = psc_i2s_hw_params, | ||
487 | .hw_free = psc_i2s_hw_free, | ||
488 | .shutdown = psc_i2s_shutdown, | ||
489 | .trigger = psc_i2s_trigger, | ||
490 | .set_sysclk = psc_i2s_set_sysclk, | ||
491 | .set_fmt = psc_i2s_set_fmt, | ||
492 | }, | ||
493 | }; | 495 | }; |
494 | 496 | ||
495 | /* --------------------------------------------------------------------- | 497 | /* --------------------------------------------------------------------- |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 05dd5abcddf4..d6882be33452 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -461,6 +461,16 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
461 | return err; | 461 | return err; |
462 | } | 462 | } |
463 | 463 | ||
464 | static struct snd_soc_dai_ops omap_mcbsp_dai_ops = { | ||
465 | .startup = omap_mcbsp_dai_startup, | ||
466 | .shutdown = omap_mcbsp_dai_shutdown, | ||
467 | .trigger = omap_mcbsp_dai_trigger, | ||
468 | .hw_params = omap_mcbsp_dai_hw_params, | ||
469 | .set_fmt = omap_mcbsp_dai_set_dai_fmt, | ||
470 | .set_clkdiv = omap_mcbsp_dai_set_clkdiv, | ||
471 | .set_sysclk = omap_mcbsp_dai_set_dai_sysclk, | ||
472 | }; | ||
473 | |||
464 | #define OMAP_MCBSP_DAI_BUILDER(link_id) \ | 474 | #define OMAP_MCBSP_DAI_BUILDER(link_id) \ |
465 | { \ | 475 | { \ |
466 | .name = "omap-mcbsp-dai-"#link_id, \ | 476 | .name = "omap-mcbsp-dai-"#link_id, \ |
@@ -477,15 +487,7 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
477 | .rates = OMAP_MCBSP_RATES, \ | 487 | .rates = OMAP_MCBSP_RATES, \ |
478 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ | 488 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ |
479 | }, \ | 489 | }, \ |
480 | .ops = { \ | 490 | .ops = &omap_mcbsp_dai_ops, \ |
481 | .startup = omap_mcbsp_dai_startup, \ | ||
482 | .shutdown = omap_mcbsp_dai_shutdown, \ | ||
483 | .trigger = omap_mcbsp_dai_trigger, \ | ||
484 | .hw_params = omap_mcbsp_dai_hw_params, \ | ||
485 | .set_fmt = omap_mcbsp_dai_set_dai_fmt, \ | ||
486 | .set_clkdiv = omap_mcbsp_dai_set_clkdiv, \ | ||
487 | .set_sysclk = omap_mcbsp_dai_set_dai_sysclk, \ | ||
488 | }, \ | ||
489 | .private_data = &mcbsp_data[(link_id)].bus_id, \ | 491 | .private_data = &mcbsp_data[(link_id)].bus_id, \ |
490 | } | 492 | } |
491 | 493 | ||
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 52d97c4b82b1..d3fa6357a9fd 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c | |||
@@ -794,6 +794,19 @@ static void pxa_ssp_remove(struct platform_device *pdev, | |||
794 | SNDRV_PCM_FMTBIT_S24_LE | \ | 794 | SNDRV_PCM_FMTBIT_S24_LE | \ |
795 | SNDRV_PCM_FMTBIT_S32_LE) | 795 | SNDRV_PCM_FMTBIT_S32_LE) |
796 | 796 | ||
797 | static struct snd_soc_dai_ops pxa_ssp_dai_ops = { | ||
798 | .startup = pxa_ssp_startup, | ||
799 | .shutdown = pxa_ssp_shutdown, | ||
800 | .trigger = pxa_ssp_trigger, | ||
801 | .hw_params = pxa_ssp_hw_params, | ||
802 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
803 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
804 | .set_pll = pxa_ssp_set_dai_pll, | ||
805 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
806 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
807 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
808 | }; | ||
809 | |||
797 | struct snd_soc_dai pxa_ssp_dai[] = { | 810 | struct snd_soc_dai pxa_ssp_dai[] = { |
798 | { | 811 | { |
799 | .name = "pxa2xx-ssp1", | 812 | .name = "pxa2xx-ssp1", |
@@ -814,18 +827,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
814 | .rates = PXA_SSP_RATES, | 827 | .rates = PXA_SSP_RATES, |
815 | .formats = PXA_SSP_FORMATS, | 828 | .formats = PXA_SSP_FORMATS, |
816 | }, | 829 | }, |
817 | .ops = { | 830 | .ops = &pxa_ssp_dai_ops, |
818 | .startup = pxa_ssp_startup, | ||
819 | .shutdown = pxa_ssp_shutdown, | ||
820 | .trigger = pxa_ssp_trigger, | ||
821 | .hw_params = pxa_ssp_hw_params, | ||
822 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
823 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
824 | .set_pll = pxa_ssp_set_dai_pll, | ||
825 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
826 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
827 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
828 | }, | ||
829 | }, | 831 | }, |
830 | { .name = "pxa2xx-ssp2", | 832 | { .name = "pxa2xx-ssp2", |
831 | .id = 1, | 833 | .id = 1, |
@@ -845,18 +847,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
845 | .rates = PXA_SSP_RATES, | 847 | .rates = PXA_SSP_RATES, |
846 | .formats = PXA_SSP_FORMATS, | 848 | .formats = PXA_SSP_FORMATS, |
847 | }, | 849 | }, |
848 | .ops = { | 850 | .ops = &pxa_ssp_dai_ops, |
849 | .startup = pxa_ssp_startup, | ||
850 | .shutdown = pxa_ssp_shutdown, | ||
851 | .trigger = pxa_ssp_trigger, | ||
852 | .hw_params = pxa_ssp_hw_params, | ||
853 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
854 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
855 | .set_pll = pxa_ssp_set_dai_pll, | ||
856 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
857 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
858 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
859 | }, | ||
860 | }, | 851 | }, |
861 | { | 852 | { |
862 | .name = "pxa2xx-ssp3", | 853 | .name = "pxa2xx-ssp3", |
@@ -877,18 +868,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
877 | .rates = PXA_SSP_RATES, | 868 | .rates = PXA_SSP_RATES, |
878 | .formats = PXA_SSP_FORMATS, | 869 | .formats = PXA_SSP_FORMATS, |
879 | }, | 870 | }, |
880 | .ops = { | 871 | .ops = &pxa_ssp_dai_ops, |
881 | .startup = pxa_ssp_startup, | ||
882 | .shutdown = pxa_ssp_shutdown, | ||
883 | .trigger = pxa_ssp_trigger, | ||
884 | .hw_params = pxa_ssp_hw_params, | ||
885 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
886 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
887 | .set_pll = pxa_ssp_set_dai_pll, | ||
888 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
889 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
890 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
891 | }, | ||
892 | }, | 872 | }, |
893 | { | 873 | { |
894 | .name = "pxa2xx-ssp4", | 874 | .name = "pxa2xx-ssp4", |
@@ -909,18 +889,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
909 | .rates = PXA_SSP_RATES, | 889 | .rates = PXA_SSP_RATES, |
910 | .formats = PXA_SSP_FORMATS, | 890 | .formats = PXA_SSP_FORMATS, |
911 | }, | 891 | }, |
912 | .ops = { | 892 | .ops = &pxa_ssp_dai_ops, |
913 | .startup = pxa_ssp_startup, | ||
914 | .shutdown = pxa_ssp_shutdown, | ||
915 | .trigger = pxa_ssp_trigger, | ||
916 | .hw_params = pxa_ssp_hw_params, | ||
917 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
918 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
919 | .set_pll = pxa_ssp_set_dai_pll, | ||
920 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
921 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
922 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
923 | }, | ||
924 | }, | 893 | }, |
925 | }; | 894 | }; |
926 | EXPORT_SYMBOL_GPL(pxa_ssp_dai); | 895 | EXPORT_SYMBOL_GPL(pxa_ssp_dai); |
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 49a2810ca58c..cf809049272a 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c | |||
@@ -164,6 +164,10 @@ static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream, | |||
164 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ | 164 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ |
165 | SNDRV_PCM_RATE_48000) | 165 | SNDRV_PCM_RATE_48000) |
166 | 166 | ||
167 | static struct snd_soc_dai_ops pxa_ac97_dai_ops = { | ||
168 | .hw_params = pxa2xx_ac97_hw_params, | ||
169 | }; | ||
170 | |||
167 | /* | 171 | /* |
168 | * There is only 1 physical AC97 interface for pxa2xx, but it | 172 | * There is only 1 physical AC97 interface for pxa2xx, but it |
169 | * has extra fifo's that can be used for aux DACs and ADCs. | 173 | * has extra fifo's that can be used for aux DACs and ADCs. |
@@ -189,8 +193,7 @@ struct snd_soc_dai pxa_ac97_dai[] = { | |||
189 | .channels_max = 2, | 193 | .channels_max = 2, |
190 | .rates = PXA2XX_AC97_RATES, | 194 | .rates = PXA2XX_AC97_RATES, |
191 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 195 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
192 | .ops = { | 196 | .ops = &pxa_ac97_dai_ops, |
193 | .hw_params = pxa2xx_ac97_hw_params,}, | ||
194 | }, | 197 | }, |
195 | { | 198 | { |
196 | .name = "pxa2xx-ac97-aux", | 199 | .name = "pxa2xx-ac97-aux", |
@@ -208,8 +211,7 @@ struct snd_soc_dai pxa_ac97_dai[] = { | |||
208 | .channels_max = 1, | 211 | .channels_max = 1, |
209 | .rates = PXA2XX_AC97_RATES, | 212 | .rates = PXA2XX_AC97_RATES, |
210 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 213 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
211 | .ops = { | 214 | .ops = &pxa_ac97_dai_ops, |
212 | .hw_params = pxa2xx_ac97_hw_aux_params,}, | ||
213 | }, | 215 | }, |
214 | { | 216 | { |
215 | .name = "pxa2xx-ac97-mic", | 217 | .name = "pxa2xx-ac97-mic", |
@@ -221,8 +223,7 @@ struct snd_soc_dai pxa_ac97_dai[] = { | |||
221 | .channels_max = 1, | 223 | .channels_max = 1, |
222 | .rates = PXA2XX_AC97_RATES, | 224 | .rates = PXA2XX_AC97_RATES, |
223 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 225 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
224 | .ops = { | 226 | .ops = &pxa_ac97_dai_ops, |
225 | .hw_params = pxa2xx_ac97_hw_mic_params,}, | ||
226 | }, | 227 | }, |
227 | }; | 228 | }; |
228 | 229 | ||
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 83b59d7fe96e..e6c24408c5f9 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c | |||
@@ -304,6 +304,15 @@ static int pxa2xx_i2s_resume(struct snd_soc_dai *dai) | |||
304 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ | 304 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ |
305 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000) | 305 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000) |
306 | 306 | ||
307 | static struct snd_soc_dai_ops pxa_i2s_dai_ops = { | ||
308 | .startup = pxa2xx_i2s_startup, | ||
309 | .shutdown = pxa2xx_i2s_shutdown, | ||
310 | .trigger = pxa2xx_i2s_trigger, | ||
311 | .hw_params = pxa2xx_i2s_hw_params, | ||
312 | .set_fmt = pxa2xx_i2s_set_dai_fmt, | ||
313 | .set_sysclk = pxa2xx_i2s_set_dai_sysclk, | ||
314 | }; | ||
315 | |||
307 | struct snd_soc_dai pxa_i2s_dai = { | 316 | struct snd_soc_dai pxa_i2s_dai = { |
308 | .name = "pxa2xx-i2s", | 317 | .name = "pxa2xx-i2s", |
309 | .id = 0, | 318 | .id = 0, |
@@ -319,14 +328,7 @@ struct snd_soc_dai pxa_i2s_dai = { | |||
319 | .channels_max = 2, | 328 | .channels_max = 2, |
320 | .rates = PXA2XX_I2S_RATES, | 329 | .rates = PXA2XX_I2S_RATES, |
321 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 330 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
322 | .ops = { | 331 | .ops = &pxa_i2s_dai_ops, |
323 | .startup = pxa2xx_i2s_startup, | ||
324 | .shutdown = pxa2xx_i2s_shutdown, | ||
325 | .trigger = pxa2xx_i2s_trigger, | ||
326 | .hw_params = pxa2xx_i2s_hw_params, | ||
327 | .set_fmt = pxa2xx_i2s_set_dai_fmt, | ||
328 | .set_sysclk = pxa2xx_i2s_set_dai_sysclk, | ||
329 | }, | ||
330 | }; | 332 | }; |
331 | 333 | ||
332 | EXPORT_SYMBOL_GPL(pxa_i2s_dai); | 334 | EXPORT_SYMBOL_GPL(pxa_i2s_dai); |
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c index 1ceae690d019..1ca3cdaa8213 100644 --- a/sound/soc/s3c24xx/s3c2412-i2s.c +++ b/sound/soc/s3c24xx/s3c2412-i2s.c | |||
@@ -147,6 +147,10 @@ static int s3c2412_i2s_probe(struct platform_device *pdev, | |||
147 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | 147 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ |
148 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) | 148 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) |
149 | 149 | ||
150 | static struct snd_soc_dai_ops s3c2412_i2s_dai_ops = { | ||
151 | .set_sysclk = s3c2412_i2s_set_sysclk, | ||
152 | }; | ||
153 | |||
150 | struct snd_soc_dai s3c2412_i2s_dai = { | 154 | struct snd_soc_dai s3c2412_i2s_dai = { |
151 | .name = "s3c2412-i2s", | 155 | .name = "s3c2412-i2s", |
152 | .id = 0, | 156 | .id = 0, |
@@ -163,9 +167,7 @@ struct snd_soc_dai s3c2412_i2s_dai = { | |||
163 | .rates = S3C2412_I2S_RATES, | 167 | .rates = S3C2412_I2S_RATES, |
164 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE, | 168 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE, |
165 | }, | 169 | }, |
166 | .ops = { | 170 | .ops = &s3c2412_i2s_dai_ops, |
167 | .set_sysclk = s3c2412_i2s_set_sysclk, | ||
168 | }, | ||
169 | }; | 171 | }; |
170 | EXPORT_SYMBOL_GPL(s3c2412_i2s_dai); | 172 | EXPORT_SYMBOL_GPL(s3c2412_i2s_dai); |
171 | 173 | ||
diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c index 5c7f18a22645..3698f707c44d 100644 --- a/sound/soc/s3c24xx/s3c2443-ac97.c +++ b/sound/soc/s3c24xx/s3c2443-ac97.c | |||
@@ -355,6 +355,16 @@ static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream, | |||
355 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \ | 355 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \ |
356 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 356 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |
357 | 357 | ||
358 | static struct snd_soc_dai_ops s3c2443_ac97_dai_ops = { | ||
359 | .hw_params = s3c2443_ac97_hw_params, | ||
360 | .trigger = s3c2443_ac97_trigger, | ||
361 | }; | ||
362 | |||
363 | static struct snd_soc_dai_ops s3c2443_ac97_mic_dai_ops = { | ||
364 | .hw_params = s3c2443_ac97_hw_mic_params, | ||
365 | .trigger = s3c2443_ac97_mic_trigger, | ||
366 | }; | ||
367 | |||
358 | struct snd_soc_dai s3c2443_ac97_dai[] = { | 368 | struct snd_soc_dai s3c2443_ac97_dai[] = { |
359 | { | 369 | { |
360 | .name = "s3c2443-ac97", | 370 | .name = "s3c2443-ac97", |
@@ -374,9 +384,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = { | |||
374 | .channels_max = 2, | 384 | .channels_max = 2, |
375 | .rates = s3c2443_AC97_RATES, | 385 | .rates = s3c2443_AC97_RATES, |
376 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 386 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
377 | .ops = { | 387 | .ops = &s3c2443_ac97_dai_ops, |
378 | .hw_params = s3c2443_ac97_hw_params, | ||
379 | .trigger = s3c2443_ac97_trigger}, | ||
380 | }, | 388 | }, |
381 | { | 389 | { |
382 | .name = "pxa2xx-ac97-mic", | 390 | .name = "pxa2xx-ac97-mic", |
@@ -388,9 +396,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = { | |||
388 | .channels_max = 1, | 396 | .channels_max = 1, |
389 | .rates = s3c2443_AC97_RATES, | 397 | .rates = s3c2443_AC97_RATES, |
390 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 398 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
391 | .ops = { | 399 | .ops = &s3c2443_ac97_mic_dai_ops, |
392 | .hw_params = s3c2443_ac97_hw_mic_params, | ||
393 | .trigger = s3c2443_ac97_mic_trigger,}, | ||
394 | }, | 400 | }, |
395 | }; | 401 | }; |
396 | EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); | 402 | EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); |
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c index 407ccd7180fe..cc066964dad6 100644 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c | |||
@@ -449,6 +449,14 @@ static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) | |||
449 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | 449 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ |
450 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) | 450 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) |
451 | 451 | ||
452 | static struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = { | ||
453 | .trigger = s3c24xx_i2s_trigger, | ||
454 | .hw_params = s3c24xx_i2s_hw_params, | ||
455 | .set_fmt = s3c24xx_i2s_set_fmt, | ||
456 | .set_clkdiv = s3c24xx_i2s_set_clkdiv, | ||
457 | .set_sysclk = s3c24xx_i2s_set_sysclk, | ||
458 | }; | ||
459 | |||
452 | struct snd_soc_dai s3c24xx_i2s_dai = { | 460 | struct snd_soc_dai s3c24xx_i2s_dai = { |
453 | .name = "s3c24xx-i2s", | 461 | .name = "s3c24xx-i2s", |
454 | .id = 0, | 462 | .id = 0, |
@@ -465,13 +473,7 @@ struct snd_soc_dai s3c24xx_i2s_dai = { | |||
465 | .channels_max = 2, | 473 | .channels_max = 2, |
466 | .rates = S3C24XX_I2S_RATES, | 474 | .rates = S3C24XX_I2S_RATES, |
467 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, | 475 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, |
468 | .ops = { | 476 | .ops = &s3c24xx_i2s_dai_ops, |
469 | .trigger = s3c24xx_i2s_trigger, | ||
470 | .hw_params = s3c24xx_i2s_hw_params, | ||
471 | .set_fmt = s3c24xx_i2s_set_fmt, | ||
472 | .set_clkdiv = s3c24xx_i2s_set_clkdiv, | ||
473 | .set_sysclk = s3c24xx_i2s_set_sysclk, | ||
474 | }, | ||
475 | }; | 477 | }; |
476 | EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); | 478 | EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); |
477 | 479 | ||
diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index d1e5390fddeb..56fa0872abbb 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c | |||
@@ -336,6 +336,16 @@ static int ssi_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | |||
336 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE | \ | 336 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE | \ |
337 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE) | 337 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE) |
338 | 338 | ||
339 | static struct snd_soc_dai_ops ssi_dai_ops = { | ||
340 | .startup = ssi_startup, | ||
341 | .shutdown = ssi_shutdown, | ||
342 | .trigger = ssi_trigger, | ||
343 | .hw_params = ssi_hw_params, | ||
344 | .set_sysclk = ssi_set_sysclk, | ||
345 | .set_clkdiv = ssi_set_clkdiv, | ||
346 | .set_fmt = ssi_set_fmt, | ||
347 | }; | ||
348 | |||
339 | struct snd_soc_dai sh4_ssi_dai[] = { | 349 | struct snd_soc_dai sh4_ssi_dai[] = { |
340 | { | 350 | { |
341 | .name = "SSI0", | 351 | .name = "SSI0", |
@@ -352,15 +362,7 @@ struct snd_soc_dai sh4_ssi_dai[] = { | |||
352 | .channels_min = 2, | 362 | .channels_min = 2, |
353 | .channels_max = 8, | 363 | .channels_max = 8, |
354 | }, | 364 | }, |
355 | .ops = { | 365 | .ops = &ssi_dai_ops, |
356 | .startup = ssi_startup, | ||
357 | .shutdown = ssi_shutdown, | ||
358 | .trigger = ssi_trigger, | ||
359 | .hw_params = ssi_hw_params, | ||
360 | .set_sysclk = ssi_set_sysclk, | ||
361 | .set_clkdiv = ssi_set_clkdiv, | ||
362 | .set_fmt = ssi_set_fmt, | ||
363 | }, | ||
364 | }, | 366 | }, |
365 | #ifdef CONFIG_CPU_SUBTYPE_SH7760 | 367 | #ifdef CONFIG_CPU_SUBTYPE_SH7760 |
366 | { | 368 | { |
@@ -378,15 +380,7 @@ struct snd_soc_dai sh4_ssi_dai[] = { | |||
378 | .channels_min = 2, | 380 | .channels_min = 2, |
379 | .channels_max = 8, | 381 | .channels_max = 8, |
380 | }, | 382 | }, |
381 | .ops = { | 383 | .ops = &ssi_dai_ops, |
382 | .startup = ssi_startup, | ||
383 | .shutdown = ssi_shutdown, | ||
384 | .trigger = ssi_trigger, | ||
385 | .hw_params = ssi_hw_params, | ||
386 | .set_sysclk = ssi_set_sysclk, | ||
387 | .set_clkdiv = ssi_set_clkdiv, | ||
388 | .set_fmt = ssi_set_fmt, | ||
389 | }, | ||
390 | }, | 384 | }, |
391 | #endif | 385 | #endif |
392 | }; | 386 | }; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d4b90d82a098..16518329f6b2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -133,8 +133,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
133 | mutex_lock(&pcm_mutex); | 133 | mutex_lock(&pcm_mutex); |
134 | 134 | ||
135 | /* startup the audio subsystem */ | 135 | /* startup the audio subsystem */ |
136 | if (cpu_dai->ops.startup) { | 136 | if (cpu_dai->ops->startup) { |
137 | ret = cpu_dai->ops.startup(substream, cpu_dai); | 137 | ret = cpu_dai->ops->startup(substream, cpu_dai); |
138 | if (ret < 0) { | 138 | if (ret < 0) { |
139 | printk(KERN_ERR "asoc: can't open interface %s\n", | 139 | printk(KERN_ERR "asoc: can't open interface %s\n", |
140 | cpu_dai->name); | 140 | cpu_dai->name); |
@@ -150,8 +150,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | if (codec_dai->ops.startup) { | 153 | if (codec_dai->ops->startup) { |
154 | ret = codec_dai->ops.startup(substream, codec_dai); | 154 | ret = codec_dai->ops->startup(substream, codec_dai); |
155 | if (ret < 0) { | 155 | if (ret < 0) { |
156 | printk(KERN_ERR "asoc: can't open codec %s\n", | 156 | printk(KERN_ERR "asoc: can't open codec %s\n", |
157 | codec_dai->name); | 157 | codec_dai->name); |
@@ -247,8 +247,8 @@ codec_dai_err: | |||
247 | platform->pcm_ops->close(substream); | 247 | platform->pcm_ops->close(substream); |
248 | 248 | ||
249 | platform_err: | 249 | platform_err: |
250 | if (cpu_dai->ops.shutdown) | 250 | if (cpu_dai->ops->shutdown) |
251 | cpu_dai->ops.shutdown(substream, cpu_dai); | 251 | cpu_dai->ops->shutdown(substream, cpu_dai); |
252 | out: | 252 | out: |
253 | mutex_unlock(&pcm_mutex); | 253 | mutex_unlock(&pcm_mutex); |
254 | return ret; | 254 | return ret; |
@@ -340,11 +340,11 @@ static int soc_codec_close(struct snd_pcm_substream *substream) | |||
340 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 340 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
341 | snd_soc_dai_digital_mute(codec_dai, 1); | 341 | snd_soc_dai_digital_mute(codec_dai, 1); |
342 | 342 | ||
343 | if (cpu_dai->ops.shutdown) | 343 | if (cpu_dai->ops->shutdown) |
344 | cpu_dai->ops.shutdown(substream, cpu_dai); | 344 | cpu_dai->ops->shutdown(substream, cpu_dai); |
345 | 345 | ||
346 | if (codec_dai->ops.shutdown) | 346 | if (codec_dai->ops->shutdown) |
347 | codec_dai->ops.shutdown(substream, codec_dai); | 347 | codec_dai->ops->shutdown(substream, codec_dai); |
348 | 348 | ||
349 | if (machine->ops && machine->ops->shutdown) | 349 | if (machine->ops && machine->ops->shutdown) |
350 | machine->ops->shutdown(substream); | 350 | machine->ops->shutdown(substream); |
@@ -408,16 +408,16 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) | |||
408 | } | 408 | } |
409 | } | 409 | } |
410 | 410 | ||
411 | if (codec_dai->ops.prepare) { | 411 | if (codec_dai->ops->prepare) { |
412 | ret = codec_dai->ops.prepare(substream, codec_dai); | 412 | ret = codec_dai->ops->prepare(substream, codec_dai); |
413 | if (ret < 0) { | 413 | if (ret < 0) { |
414 | printk(KERN_ERR "asoc: codec DAI prepare error\n"); | 414 | printk(KERN_ERR "asoc: codec DAI prepare error\n"); |
415 | goto out; | 415 | goto out; |
416 | } | 416 | } |
417 | } | 417 | } |
418 | 418 | ||
419 | if (cpu_dai->ops.prepare) { | 419 | if (cpu_dai->ops->prepare) { |
420 | ret = cpu_dai->ops.prepare(substream, cpu_dai); | 420 | ret = cpu_dai->ops->prepare(substream, cpu_dai); |
421 | if (ret < 0) { | 421 | if (ret < 0) { |
422 | printk(KERN_ERR "asoc: cpu DAI prepare error\n"); | 422 | printk(KERN_ERR "asoc: cpu DAI prepare error\n"); |
423 | goto out; | 423 | goto out; |
@@ -494,8 +494,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
494 | } | 494 | } |
495 | } | 495 | } |
496 | 496 | ||
497 | if (codec_dai->ops.hw_params) { | 497 | if (codec_dai->ops->hw_params) { |
498 | ret = codec_dai->ops.hw_params(substream, params, codec_dai); | 498 | ret = codec_dai->ops->hw_params(substream, params, codec_dai); |
499 | if (ret < 0) { | 499 | if (ret < 0) { |
500 | printk(KERN_ERR "asoc: can't set codec %s hw params\n", | 500 | printk(KERN_ERR "asoc: can't set codec %s hw params\n", |
501 | codec_dai->name); | 501 | codec_dai->name); |
@@ -503,8 +503,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
503 | } | 503 | } |
504 | } | 504 | } |
505 | 505 | ||
506 | if (cpu_dai->ops.hw_params) { | 506 | if (cpu_dai->ops->hw_params) { |
507 | ret = cpu_dai->ops.hw_params(substream, params, cpu_dai); | 507 | ret = cpu_dai->ops->hw_params(substream, params, cpu_dai); |
508 | if (ret < 0) { | 508 | if (ret < 0) { |
509 | printk(KERN_ERR "asoc: interface %s hw params failed\n", | 509 | printk(KERN_ERR "asoc: interface %s hw params failed\n", |
510 | cpu_dai->name); | 510 | cpu_dai->name); |
@@ -526,12 +526,12 @@ out: | |||
526 | return ret; | 526 | return ret; |
527 | 527 | ||
528 | platform_err: | 528 | platform_err: |
529 | if (cpu_dai->ops.hw_free) | 529 | if (cpu_dai->ops->hw_free) |
530 | cpu_dai->ops.hw_free(substream, cpu_dai); | 530 | cpu_dai->ops->hw_free(substream, cpu_dai); |
531 | 531 | ||
532 | interface_err: | 532 | interface_err: |
533 | if (codec_dai->ops.hw_free) | 533 | if (codec_dai->ops->hw_free) |
534 | codec_dai->ops.hw_free(substream, codec_dai); | 534 | codec_dai->ops->hw_free(substream, codec_dai); |
535 | 535 | ||
536 | codec_err: | 536 | codec_err: |
537 | if (machine->ops && machine->ops->hw_free) | 537 | if (machine->ops && machine->ops->hw_free) |
@@ -570,11 +570,11 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) | |||
570 | platform->pcm_ops->hw_free(substream); | 570 | platform->pcm_ops->hw_free(substream); |
571 | 571 | ||
572 | /* now free hw params for the DAI's */ | 572 | /* now free hw params for the DAI's */ |
573 | if (codec_dai->ops.hw_free) | 573 | if (codec_dai->ops->hw_free) |
574 | codec_dai->ops.hw_free(substream, codec_dai); | 574 | codec_dai->ops->hw_free(substream, codec_dai); |
575 | 575 | ||
576 | if (cpu_dai->ops.hw_free) | 576 | if (cpu_dai->ops->hw_free) |
577 | cpu_dai->ops.hw_free(substream, cpu_dai); | 577 | cpu_dai->ops->hw_free(substream, cpu_dai); |
578 | 578 | ||
579 | mutex_unlock(&pcm_mutex); | 579 | mutex_unlock(&pcm_mutex); |
580 | return 0; | 580 | return 0; |
@@ -591,8 +591,8 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
591 | struct snd_soc_dai *codec_dai = machine->codec_dai; | 591 | struct snd_soc_dai *codec_dai = machine->codec_dai; |
592 | int ret; | 592 | int ret; |
593 | 593 | ||
594 | if (codec_dai->ops.trigger) { | 594 | if (codec_dai->ops->trigger) { |
595 | ret = codec_dai->ops.trigger(substream, cmd, codec_dai); | 595 | ret = codec_dai->ops->trigger(substream, cmd, codec_dai); |
596 | if (ret < 0) | 596 | if (ret < 0) |
597 | return ret; | 597 | return ret; |
598 | } | 598 | } |
@@ -603,8 +603,8 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
603 | return ret; | 603 | return ret; |
604 | } | 604 | } |
605 | 605 | ||
606 | if (cpu_dai->ops.trigger) { | 606 | if (cpu_dai->ops->trigger) { |
607 | ret = cpu_dai->ops.trigger(substream, cmd, cpu_dai); | 607 | ret = cpu_dai->ops->trigger(substream, cmd, cpu_dai); |
608 | if (ret < 0) | 608 | if (ret < 0) |
609 | return ret; | 609 | return ret; |
610 | } | 610 | } |
@@ -645,8 +645,8 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state) | |||
645 | /* mute any active DAC's */ | 645 | /* mute any active DAC's */ |
646 | for (i = 0; i < card->num_links; i++) { | 646 | for (i = 0; i < card->num_links; i++) { |
647 | struct snd_soc_dai *dai = card->dai_link[i].codec_dai; | 647 | struct snd_soc_dai *dai = card->dai_link[i].codec_dai; |
648 | if (dai->ops.digital_mute && dai->playback.active) | 648 | if (dai->ops->digital_mute && dai->playback.active) |
649 | dai->ops.digital_mute(dai, 1); | 649 | dai->ops->digital_mute(dai, 1); |
650 | } | 650 | } |
651 | 651 | ||
652 | /* suspend all pcms */ | 652 | /* suspend all pcms */ |
@@ -741,8 +741,8 @@ static void soc_resume_deferred(struct work_struct *work) | |||
741 | /* unmute any active DACs */ | 741 | /* unmute any active DACs */ |
742 | for (i = 0; i < card->num_links; i++) { | 742 | for (i = 0; i < card->num_links; i++) { |
743 | struct snd_soc_dai *dai = card->dai_link[i].codec_dai; | 743 | struct snd_soc_dai *dai = card->dai_link[i].codec_dai; |
744 | if (dai->ops.digital_mute && dai->playback.active) | 744 | if (dai->ops->digital_mute && dai->playback.active) |
745 | dai->ops.digital_mute(dai, 0); | 745 | dai->ops->digital_mute(dai, 0); |
746 | } | 746 | } |
747 | 747 | ||
748 | for (i = 0; i < card->num_links; i++) { | 748 | for (i = 0; i < card->num_links; i++) { |
@@ -2051,8 +2051,8 @@ EXPORT_SYMBOL_GPL(snd_soc_put_volsw_s8); | |||
2051 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | 2051 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, |
2052 | unsigned int freq, int dir) | 2052 | unsigned int freq, int dir) |
2053 | { | 2053 | { |
2054 | if (dai->ops.set_sysclk) | 2054 | if (dai->ops->set_sysclk) |
2055 | return dai->ops.set_sysclk(dai, clk_id, freq, dir); | 2055 | return dai->ops->set_sysclk(dai, clk_id, freq, dir); |
2056 | else | 2056 | else |
2057 | return -EINVAL; | 2057 | return -EINVAL; |
2058 | } | 2058 | } |
@@ -2071,8 +2071,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk); | |||
2071 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | 2071 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, |
2072 | int div_id, int div) | 2072 | int div_id, int div) |
2073 | { | 2073 | { |
2074 | if (dai->ops.set_clkdiv) | 2074 | if (dai->ops->set_clkdiv) |
2075 | return dai->ops.set_clkdiv(dai, div_id, div); | 2075 | return dai->ops->set_clkdiv(dai, div_id, div); |
2076 | else | 2076 | else |
2077 | return -EINVAL; | 2077 | return -EINVAL; |
2078 | } | 2078 | } |
@@ -2090,8 +2090,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_clkdiv); | |||
2090 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | 2090 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, |
2091 | int pll_id, unsigned int freq_in, unsigned int freq_out) | 2091 | int pll_id, unsigned int freq_in, unsigned int freq_out) |
2092 | { | 2092 | { |
2093 | if (dai->ops.set_pll) | 2093 | if (dai->ops->set_pll) |
2094 | return dai->ops.set_pll(dai, pll_id, freq_in, freq_out); | 2094 | return dai->ops->set_pll(dai, pll_id, freq_in, freq_out); |
2095 | else | 2095 | else |
2096 | return -EINVAL; | 2096 | return -EINVAL; |
2097 | } | 2097 | } |
@@ -2106,8 +2106,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll); | |||
2106 | */ | 2106 | */ |
2107 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | 2107 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
2108 | { | 2108 | { |
2109 | if (dai->ops.set_fmt) | 2109 | if (dai->ops->set_fmt) |
2110 | return dai->ops.set_fmt(dai, fmt); | 2110 | return dai->ops->set_fmt(dai, fmt); |
2111 | else | 2111 | else |
2112 | return -EINVAL; | 2112 | return -EINVAL; |
2113 | } | 2113 | } |
@@ -2125,8 +2125,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt); | |||
2125 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 2125 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
2126 | unsigned int mask, int slots) | 2126 | unsigned int mask, int slots) |
2127 | { | 2127 | { |
2128 | if (dai->ops.set_sysclk) | 2128 | if (dai->ops->set_sysclk) |
2129 | return dai->ops.set_tdm_slot(dai, mask, slots); | 2129 | return dai->ops->set_tdm_slot(dai, mask, slots); |
2130 | else | 2130 | else |
2131 | return -EINVAL; | 2131 | return -EINVAL; |
2132 | } | 2132 | } |
@@ -2141,8 +2141,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot); | |||
2141 | */ | 2141 | */ |
2142 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) | 2142 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) |
2143 | { | 2143 | { |
2144 | if (dai->ops.set_sysclk) | 2144 | if (dai->ops->set_sysclk) |
2145 | return dai->ops.set_tristate(dai, tristate); | 2145 | return dai->ops->set_tristate(dai, tristate); |
2146 | else | 2146 | else |
2147 | return -EINVAL; | 2147 | return -EINVAL; |
2148 | } | 2148 | } |
@@ -2157,8 +2157,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tristate); | |||
2157 | */ | 2157 | */ |
2158 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute) | 2158 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute) |
2159 | { | 2159 | { |
2160 | if (dai->ops.digital_mute) | 2160 | if (dai->ops->digital_mute) |
2161 | return dai->ops.digital_mute(dai, mute); | 2161 | return dai->ops->digital_mute(dai, mute); |
2162 | else | 2162 | else |
2163 | return -EINVAL; | 2163 | return -EINVAL; |
2164 | } | 2164 | } |
@@ -2211,6 +2211,9 @@ static int snd_soc_unregister_card(struct snd_soc_card *card) | |||
2211 | return 0; | 2211 | return 0; |
2212 | } | 2212 | } |
2213 | 2213 | ||
2214 | static struct snd_soc_dai_ops null_dai_ops = { | ||
2215 | }; | ||
2216 | |||
2214 | /** | 2217 | /** |
2215 | * snd_soc_register_dai - Register a DAI with the ASoC core | 2218 | * snd_soc_register_dai - Register a DAI with the ASoC core |
2216 | * | 2219 | * |
@@ -2225,6 +2228,9 @@ int snd_soc_register_dai(struct snd_soc_dai *dai) | |||
2225 | if (!dai->dev) | 2228 | if (!dai->dev) |
2226 | printk(KERN_WARNING "No device for DAI %s\n", dai->name); | 2229 | printk(KERN_WARNING "No device for DAI %s\n", dai->name); |
2227 | 2230 | ||
2231 | if (!dai->ops) | ||
2232 | dai->ops = &null_dai_ops; | ||
2233 | |||
2228 | INIT_LIST_HEAD(&dai->list); | 2234 | INIT_LIST_HEAD(&dai->list); |
2229 | 2235 | ||
2230 | mutex_lock(&client_mutex); | 2236 | mutex_lock(&client_mutex); |