diff options
Diffstat (limited to 'sound')
39 files changed, 480 insertions, 427 deletions
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/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 f86f33cc1798..7ae3d6520e3f 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c | |||
@@ -503,6 +503,13 @@ static const struct snd_kcontrol_new cs4270_snd_controls[] = { | |||
503 | */ | 503 | */ |
504 | static struct snd_soc_codec *cs4270_codec; | 504 | static struct snd_soc_codec *cs4270_codec; |
505 | 505 | ||
506 | static struct snd_soc_dai_ops cs4270_dai_ops = { | ||
507 | .hw_params = cs4270_hw_params, | ||
508 | .set_sysclk = cs4270_set_dai_sysclk, | ||
509 | .set_fmt = cs4270_set_dai_fmt, | ||
510 | .digital_mute = cs4270_mute, | ||
511 | }; | ||
512 | |||
506 | struct snd_soc_dai cs4270_dai = { | 513 | struct snd_soc_dai cs4270_dai = { |
507 | .name = "cs4270", | 514 | .name = "cs4270", |
508 | .playback = { | 515 | .playback = { |
@@ -519,12 +526,7 @@ struct snd_soc_dai cs4270_dai = { | |||
519 | .rates = 0, | 526 | .rates = 0, |
520 | .formats = CS4270_FORMATS, | 527 | .formats = CS4270_FORMATS, |
521 | }, | 528 | }, |
522 | .ops = { | 529 | .ops = &cs4270_dai_ops, |
523 | .hw_params = cs4270_hw_params, | ||
524 | .set_sysclk = cs4270_set_dai_sysclk, | ||
525 | .set_fmt = cs4270_set_dai_fmt, | ||
526 | .digital_mute = cs4270_mute, | ||
527 | }, | ||
528 | }; | 530 | }; |
529 | EXPORT_SYMBOL_GPL(cs4270_dai); | 531 | EXPORT_SYMBOL_GPL(cs4270_dai); |
530 | 532 | ||
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 5242b8156b38..cafa7684c0e7 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -583,6 +583,29 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec, | |||
583 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ | 583 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ |
584 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 584 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |
585 | 585 | ||
586 | static struct snd_soc_dai_ops uda1380_dai_ops = { | ||
587 | .hw_params = uda1380_pcm_hw_params, | ||
588 | .shutdown = uda1380_pcm_shutdown, | ||
589 | .prepare = uda1380_pcm_prepare, | ||
590 | .digital_mute = uda1380_mute, | ||
591 | .set_fmt = uda1380_set_dai_fmt_both, | ||
592 | }; | ||
593 | |||
594 | static struct snd_soc_dai_ops uda1380_dai_ops_playback = { | ||
595 | .hw_params = uda1380_pcm_hw_params, | ||
596 | .shutdown = uda1380_pcm_shutdown, | ||
597 | .prepare = uda1380_pcm_prepare, | ||
598 | .digital_mute = uda1380_mute, | ||
599 | .set_fmt = uda1380_set_dai_fmt_playback, | ||
600 | }; | ||
601 | |||
602 | static struct snd_soc_dai_ops uda1380_dai_ops_capture = { | ||
603 | .hw_params = uda1380_pcm_hw_params, | ||
604 | .shutdown = uda1380_pcm_shutdown, | ||
605 | .prepare = uda1380_pcm_prepare, | ||
606 | .set_fmt = uda1380_set_dai_fmt_capture, | ||
607 | }; | ||
608 | |||
586 | struct snd_soc_dai uda1380_dai[] = { | 609 | struct snd_soc_dai uda1380_dai[] = { |
587 | { | 610 | { |
588 | .name = "UDA1380", | 611 | .name = "UDA1380", |
@@ -598,13 +621,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
598 | .channels_max = 2, | 621 | .channels_max = 2, |
599 | .rates = UDA1380_RATES, | 622 | .rates = UDA1380_RATES, |
600 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 623 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
601 | .ops = { | 624 | .ops = &uda1380_dai_ops, |
602 | .hw_params = uda1380_pcm_hw_params, | ||
603 | .shutdown = uda1380_pcm_shutdown, | ||
604 | .prepare = uda1380_pcm_prepare, | ||
605 | .digital_mute = uda1380_mute, | ||
606 | .set_fmt = uda1380_set_dai_fmt_both, | ||
607 | }, | ||
608 | }, | 625 | }, |
609 | { /* playback only - dual interface */ | 626 | { /* playback only - dual interface */ |
610 | .name = "UDA1380", | 627 | .name = "UDA1380", |
@@ -615,13 +632,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
615 | .rates = UDA1380_RATES, | 632 | .rates = UDA1380_RATES, |
616 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 633 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
617 | }, | 634 | }, |
618 | .ops = { | 635 | .ops = &uda1380_dai_ops_playback, |
619 | .hw_params = uda1380_pcm_hw_params, | ||
620 | .shutdown = uda1380_pcm_shutdown, | ||
621 | .prepare = uda1380_pcm_prepare, | ||
622 | .digital_mute = uda1380_mute, | ||
623 | .set_fmt = uda1380_set_dai_fmt_playback, | ||
624 | }, | ||
625 | }, | 636 | }, |
626 | { /* capture only - dual interface*/ | 637 | { /* capture only - dual interface*/ |
627 | .name = "UDA1380", | 638 | .name = "UDA1380", |
@@ -632,12 +643,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
632 | .rates = UDA1380_RATES, | 643 | .rates = UDA1380_RATES, |
633 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 644 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
634 | }, | 645 | }, |
635 | .ops = { | 646 | .ops = &uda1380_dai_ops_capture, |
636 | .hw_params = uda1380_pcm_hw_params, | ||
637 | .shutdown = uda1380_pcm_shutdown, | ||
638 | .prepare = uda1380_pcm_prepare, | ||
639 | .set_fmt = uda1380_set_dai_fmt_capture, | ||
640 | }, | ||
641 | }, | 647 | }, |
642 | }; | 648 | }; |
643 | EXPORT_SYMBOL_GPL(uda1380_dai); | 649 | 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/wm8510.c b/sound/soc/codecs/wm8510.c index f01078cfbd72..cc975a62fa5c 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 d3c51ba5e6f9..ee0af23a1acc 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -771,6 +771,21 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, | |||
771 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 771 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
772 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 772 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
773 | 773 | ||
774 | static struct snd_soc_dai_ops wm8580_dai_ops_playback = { | ||
775 | .hw_params = wm8580_paif_hw_params, | ||
776 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
777 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
778 | .set_pll = wm8580_set_dai_pll, | ||
779 | .digital_mute = wm8580_digital_mute, | ||
780 | }; | ||
781 | |||
782 | static struct snd_soc_dai_ops wm8580_dai_ops_capture = { | ||
783 | .hw_params = wm8580_paif_hw_params, | ||
784 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
785 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
786 | .set_pll = wm8580_set_dai_pll, | ||
787 | }; | ||
788 | |||
774 | struct snd_soc_dai wm8580_dai[] = { | 789 | struct snd_soc_dai wm8580_dai[] = { |
775 | { | 790 | { |
776 | .name = "WM8580 PAIFRX", | 791 | .name = "WM8580 PAIFRX", |
@@ -782,13 +797,7 @@ struct snd_soc_dai wm8580_dai[] = { | |||
782 | .rates = SNDRV_PCM_RATE_8000_192000, | 797 | .rates = SNDRV_PCM_RATE_8000_192000, |
783 | .formats = WM8580_FORMATS, | 798 | .formats = WM8580_FORMATS, |
784 | }, | 799 | }, |
785 | .ops = { | 800 | .ops = &wm8580_dai_ops_playback, |
786 | .hw_params = wm8580_paif_hw_params, | ||
787 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
788 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
789 | .set_pll = wm8580_set_dai_pll, | ||
790 | .digital_mute = wm8580_digital_mute, | ||
791 | }, | ||
792 | }, | 801 | }, |
793 | { | 802 | { |
794 | .name = "WM8580 PAIFTX", | 803 | .name = "WM8580 PAIFTX", |
@@ -800,12 +809,7 @@ struct snd_soc_dai wm8580_dai[] = { | |||
800 | .rates = SNDRV_PCM_RATE_8000_192000, | 809 | .rates = SNDRV_PCM_RATE_8000_192000, |
801 | .formats = WM8580_FORMATS, | 810 | .formats = WM8580_FORMATS, |
802 | }, | 811 | }, |
803 | .ops = { | 812 | .ops = &wm8580_dai_ops_capture, |
804 | .hw_params = wm8580_paif_hw_params, | ||
805 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
806 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
807 | .set_pll = wm8580_set_dai_pll, | ||
808 | }, | ||
809 | }, | 813 | }, |
810 | }; | 814 | }; |
811 | EXPORT_SYMBOL_GPL(wm8580_dai); | 815 | 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 7f353e935d71..cc6e57f9acf8 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1306,6 +1306,51 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec, | |||
1306 | * 3. Voice disabled - HIFI over HIFI | 1306 | * 3. Voice disabled - HIFI over HIFI |
1307 | * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture | 1307 | * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture |
1308 | */ | 1308 | */ |
1309 | static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode1 = { | ||
1310 | .hw_params = wm8753_i2s_hw_params, | ||
1311 | .digital_mute = wm8753_mute, | ||
1312 | .set_fmt = wm8753_mode1h_set_dai_fmt, | ||
1313 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1314 | .set_pll = wm8753_set_dai_pll, | ||
1315 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1316 | }; | ||
1317 | |||
1318 | static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode1 = { | ||
1319 | .hw_params = wm8753_pcm_hw_params, | ||
1320 | .digital_mute = wm8753_mute, | ||
1321 | .set_fmt = wm8753_mode1v_set_dai_fmt, | ||
1322 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1323 | .set_pll = wm8753_set_dai_pll, | ||
1324 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1325 | }; | ||
1326 | |||
1327 | static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode2 = { | ||
1328 | .hw_params = wm8753_pcm_hw_params, | ||
1329 | .digital_mute = wm8753_mute, | ||
1330 | .set_fmt = wm8753_mode2_set_dai_fmt, | ||
1331 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1332 | .set_pll = wm8753_set_dai_pll, | ||
1333 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1334 | }; | ||
1335 | |||
1336 | static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode3 = { | ||
1337 | .hw_params = wm8753_i2s_hw_params, | ||
1338 | .digital_mute = wm8753_mute, | ||
1339 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1340 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1341 | .set_pll = wm8753_set_dai_pll, | ||
1342 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1343 | }; | ||
1344 | |||
1345 | static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode4 = { | ||
1346 | .hw_params = wm8753_i2s_hw_params, | ||
1347 | .digital_mute = wm8753_mute, | ||
1348 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1349 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1350 | .set_pll = wm8753_set_dai_pll, | ||
1351 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1352 | }; | ||
1353 | |||
1309 | static const struct snd_soc_dai wm8753_all_dai[] = { | 1354 | static const struct snd_soc_dai wm8753_all_dai[] = { |
1310 | /* DAI HiFi mode 1 */ | 1355 | /* DAI HiFi mode 1 */ |
1311 | { .name = "WM8753 HiFi", | 1356 | { .name = "WM8753 HiFi", |
@@ -1322,14 +1367,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1322 | .channels_max = 2, | 1367 | .channels_max = 2, |
1323 | .rates = WM8753_RATES, | 1368 | .rates = WM8753_RATES, |
1324 | .formats = WM8753_FORMATS}, | 1369 | .formats = WM8753_FORMATS}, |
1325 | .ops = { | 1370 | .ops = &wm8753_dai_ops_hifi_mode1, |
1326 | .hw_params = wm8753_i2s_hw_params, | ||
1327 | .digital_mute = wm8753_mute, | ||
1328 | .set_fmt = wm8753_mode1h_set_dai_fmt, | ||
1329 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1330 | .set_pll = wm8753_set_dai_pll, | ||
1331 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1332 | }, | ||
1333 | }, | 1371 | }, |
1334 | /* DAI Voice mode 1 */ | 1372 | /* DAI Voice mode 1 */ |
1335 | { .name = "WM8753 Voice", | 1373 | { .name = "WM8753 Voice", |
@@ -1346,14 +1384,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1346 | .channels_max = 2, | 1384 | .channels_max = 2, |
1347 | .rates = WM8753_RATES, | 1385 | .rates = WM8753_RATES, |
1348 | .formats = WM8753_FORMATS,}, | 1386 | .formats = WM8753_FORMATS,}, |
1349 | .ops = { | 1387 | .ops = &wm8753_dai_ops_voice_mode1, |
1350 | .hw_params = wm8753_pcm_hw_params, | ||
1351 | .digital_mute = wm8753_mute, | ||
1352 | .set_fmt = wm8753_mode1v_set_dai_fmt, | ||
1353 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1354 | .set_pll = wm8753_set_dai_pll, | ||
1355 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1356 | }, | ||
1357 | }, | 1388 | }, |
1358 | /* DAI HiFi mode 2 - dummy */ | 1389 | /* DAI HiFi mode 2 - dummy */ |
1359 | { .name = "WM8753 HiFi", | 1390 | { .name = "WM8753 HiFi", |
@@ -1374,14 +1405,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1374 | .channels_max = 2, | 1405 | .channels_max = 2, |
1375 | .rates = WM8753_RATES, | 1406 | .rates = WM8753_RATES, |
1376 | .formats = WM8753_FORMATS,}, | 1407 | .formats = WM8753_FORMATS,}, |
1377 | .ops = { | 1408 | .ops = &wm8753_dai_ops_voice_mode2, |
1378 | .hw_params = wm8753_pcm_hw_params, | ||
1379 | .digital_mute = wm8753_mute, | ||
1380 | .set_fmt = wm8753_mode2_set_dai_fmt, | ||
1381 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1382 | .set_pll = wm8753_set_dai_pll, | ||
1383 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1384 | }, | ||
1385 | }, | 1409 | }, |
1386 | /* DAI HiFi mode 3 */ | 1410 | /* DAI HiFi mode 3 */ |
1387 | { .name = "WM8753 HiFi", | 1411 | { .name = "WM8753 HiFi", |
@@ -1398,14 +1422,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1398 | .channels_max = 2, | 1422 | .channels_max = 2, |
1399 | .rates = WM8753_RATES, | 1423 | .rates = WM8753_RATES, |
1400 | .formats = WM8753_FORMATS,}, | 1424 | .formats = WM8753_FORMATS,}, |
1401 | .ops = { | 1425 | .ops = &wm8753_dai_ops_hifi_mode3, |
1402 | .hw_params = wm8753_i2s_hw_params, | ||
1403 | .digital_mute = wm8753_mute, | ||
1404 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1405 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1406 | .set_pll = wm8753_set_dai_pll, | ||
1407 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1408 | }, | ||
1409 | }, | 1426 | }, |
1410 | /* DAI Voice mode 3 - dummy */ | 1427 | /* DAI Voice mode 3 - dummy */ |
1411 | { .name = "WM8753 Voice", | 1428 | { .name = "WM8753 Voice", |
@@ -1426,14 +1443,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1426 | .channels_max = 2, | 1443 | .channels_max = 2, |
1427 | .rates = WM8753_RATES, | 1444 | .rates = WM8753_RATES, |
1428 | .formats = WM8753_FORMATS,}, | 1445 | .formats = WM8753_FORMATS,}, |
1429 | .ops = { | 1446 | .ops = &wm8753_dai_ops_hifi_mode4, |
1430 | .hw_params = wm8753_i2s_hw_params, | ||
1431 | .digital_mute = wm8753_mute, | ||
1432 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | ||
1433 | .set_clkdiv = wm8753_set_dai_clkdiv, | ||
1434 | .set_pll = wm8753_set_dai_pll, | ||
1435 | .set_sysclk = wm8753_set_dai_sysclk, | ||
1436 | }, | ||
1437 | }, | 1447 | }, |
1438 | /* DAI Voice mode 4 - dummy */ | 1448 | /* DAI Voice mode 4 - dummy */ |
1439 | { .name = "WM8753 Voice", | 1449 | { .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 6844009833db..0fddd437a7c9 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -562,6 +562,15 @@ static int fsl_ssi_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format) | |||
562 | /** | 562 | /** |
563 | * fsl_ssi_dai_template: template CPU DAI for the SSI | 563 | * fsl_ssi_dai_template: template CPU DAI for the SSI |
564 | */ | 564 | */ |
565 | static struct snd_soc_dai_ops fsl_ssi_dai_ops = { | ||
566 | .startup = fsl_ssi_startup, | ||
567 | .hw_params = fsl_ssi_hw_params, | ||
568 | .shutdown = fsl_ssi_shutdown, | ||
569 | .trigger = fsl_ssi_trigger, | ||
570 | .set_sysclk = fsl_ssi_set_sysclk, | ||
571 | .set_fmt = fsl_ssi_set_fmt, | ||
572 | }; | ||
573 | |||
565 | static struct snd_soc_dai fsl_ssi_dai_template = { | 574 | static struct snd_soc_dai fsl_ssi_dai_template = { |
566 | .playback = { | 575 | .playback = { |
567 | /* The SSI does not support monaural audio. */ | 576 | /* The SSI does not support monaural audio. */ |
@@ -576,14 +585,7 @@ static struct snd_soc_dai fsl_ssi_dai_template = { | |||
576 | .rates = FSLSSI_I2S_RATES, | 585 | .rates = FSLSSI_I2S_RATES, |
577 | .formats = FSLSSI_I2S_FORMATS, | 586 | .formats = FSLSSI_I2S_FORMATS, |
578 | }, | 587 | }, |
579 | .ops = { | 588 | .ops = &fsl_ssi_dai_ops, |
580 | .startup = fsl_ssi_startup, | ||
581 | .hw_params = fsl_ssi_hw_params, | ||
582 | .shutdown = fsl_ssi_shutdown, | ||
583 | .trigger = fsl_ssi_trigger, | ||
584 | .set_sysclk = fsl_ssi_set_sysclk, | ||
585 | .set_fmt = fsl_ssi_set_fmt, | ||
586 | }, | ||
587 | }; | 589 | }; |
588 | 590 | ||
589 | /** | 591 | /** |
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 4a973ab710be..3e18064e86b2 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c | |||
@@ -784,6 +784,19 @@ static void pxa_ssp_remove(struct platform_device *pdev, | |||
784 | SNDRV_PCM_FMTBIT_S24_LE | \ | 784 | SNDRV_PCM_FMTBIT_S24_LE | \ |
785 | SNDRV_PCM_FMTBIT_S32_LE) | 785 | SNDRV_PCM_FMTBIT_S32_LE) |
786 | 786 | ||
787 | static struct snd_soc_dai_ops pxa_ssp_dai_ops = { | ||
788 | .startup = pxa_ssp_startup, | ||
789 | .shutdown = pxa_ssp_shutdown, | ||
790 | .trigger = pxa_ssp_trigger, | ||
791 | .hw_params = pxa_ssp_hw_params, | ||
792 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
793 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
794 | .set_pll = pxa_ssp_set_dai_pll, | ||
795 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
796 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
797 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
798 | }; | ||
799 | |||
787 | struct snd_soc_dai pxa_ssp_dai[] = { | 800 | struct snd_soc_dai pxa_ssp_dai[] = { |
788 | { | 801 | { |
789 | .name = "pxa2xx-ssp1", | 802 | .name = "pxa2xx-ssp1", |
@@ -804,18 +817,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
804 | .rates = PXA_SSP_RATES, | 817 | .rates = PXA_SSP_RATES, |
805 | .formats = PXA_SSP_FORMATS, | 818 | .formats = PXA_SSP_FORMATS, |
806 | }, | 819 | }, |
807 | .ops = { | 820 | .ops = &pxa_ssp_dai_ops, |
808 | .startup = pxa_ssp_startup, | ||
809 | .shutdown = pxa_ssp_shutdown, | ||
810 | .trigger = pxa_ssp_trigger, | ||
811 | .hw_params = pxa_ssp_hw_params, | ||
812 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
813 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
814 | .set_pll = pxa_ssp_set_dai_pll, | ||
815 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
816 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
817 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
818 | }, | ||
819 | }, | 821 | }, |
820 | { .name = "pxa2xx-ssp2", | 822 | { .name = "pxa2xx-ssp2", |
821 | .id = 1, | 823 | .id = 1, |
@@ -835,18 +837,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
835 | .rates = PXA_SSP_RATES, | 837 | .rates = PXA_SSP_RATES, |
836 | .formats = PXA_SSP_FORMATS, | 838 | .formats = PXA_SSP_FORMATS, |
837 | }, | 839 | }, |
838 | .ops = { | 840 | .ops = &pxa_ssp_dai_ops, |
839 | .startup = pxa_ssp_startup, | ||
840 | .shutdown = pxa_ssp_shutdown, | ||
841 | .trigger = pxa_ssp_trigger, | ||
842 | .hw_params = pxa_ssp_hw_params, | ||
843 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
844 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
845 | .set_pll = pxa_ssp_set_dai_pll, | ||
846 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
847 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
848 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
849 | }, | ||
850 | }, | 841 | }, |
851 | { | 842 | { |
852 | .name = "pxa2xx-ssp3", | 843 | .name = "pxa2xx-ssp3", |
@@ -867,18 +858,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
867 | .rates = PXA_SSP_RATES, | 858 | .rates = PXA_SSP_RATES, |
868 | .formats = PXA_SSP_FORMATS, | 859 | .formats = PXA_SSP_FORMATS, |
869 | }, | 860 | }, |
870 | .ops = { | 861 | .ops = &pxa_ssp_dai_ops, |
871 | .startup = pxa_ssp_startup, | ||
872 | .shutdown = pxa_ssp_shutdown, | ||
873 | .trigger = pxa_ssp_trigger, | ||
874 | .hw_params = pxa_ssp_hw_params, | ||
875 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
876 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
877 | .set_pll = pxa_ssp_set_dai_pll, | ||
878 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
879 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
880 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
881 | }, | ||
882 | }, | 862 | }, |
883 | { | 863 | { |
884 | .name = "pxa2xx-ssp4", | 864 | .name = "pxa2xx-ssp4", |
@@ -899,18 +879,7 @@ struct snd_soc_dai pxa_ssp_dai[] = { | |||
899 | .rates = PXA_SSP_RATES, | 879 | .rates = PXA_SSP_RATES, |
900 | .formats = PXA_SSP_FORMATS, | 880 | .formats = PXA_SSP_FORMATS, |
901 | }, | 881 | }, |
902 | .ops = { | 882 | .ops = &pxa_ssp_dai_ops, |
903 | .startup = pxa_ssp_startup, | ||
904 | .shutdown = pxa_ssp_shutdown, | ||
905 | .trigger = pxa_ssp_trigger, | ||
906 | .hw_params = pxa_ssp_hw_params, | ||
907 | .set_sysclk = pxa_ssp_set_dai_sysclk, | ||
908 | .set_clkdiv = pxa_ssp_set_dai_clkdiv, | ||
909 | .set_pll = pxa_ssp_set_dai_pll, | ||
910 | .set_fmt = pxa_ssp_set_dai_fmt, | ||
911 | .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, | ||
912 | .set_tristate = pxa_ssp_set_dai_tristate, | ||
913 | }, | ||
914 | }, | 883 | }, |
915 | }; | 884 | }; |
916 | EXPORT_SYMBOL_GPL(pxa_ssp_dai); | 885 | EXPORT_SYMBOL_GPL(pxa_ssp_dai); |
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 812c2b4d3e07..11cd0f289c16 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 f3fc0aba0aaf..382d7eee53ef 100644 --- a/sound/soc/s3c24xx/s3c2412-i2s.c +++ b/sound/soc/s3c24xx/s3c2412-i2s.c | |||
@@ -708,6 +708,14 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai) | |||
708 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | 708 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ |
709 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) | 709 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) |
710 | 710 | ||
711 | static struct snd_soc_dai_ops s3c2412_i2s_dai_ops = { | ||
712 | .trigger = s3c2412_i2s_trigger, | ||
713 | .hw_params = s3c2412_i2s_hw_params, | ||
714 | .set_fmt = s3c2412_i2s_set_fmt, | ||
715 | .set_clkdiv = s3c2412_i2s_set_clkdiv, | ||
716 | .set_sysclk = s3c2412_i2s_set_sysclk, | ||
717 | }; | ||
718 | |||
711 | struct snd_soc_dai s3c2412_i2s_dai = { | 719 | struct snd_soc_dai s3c2412_i2s_dai = { |
712 | .name = "s3c2412-i2s", | 720 | .name = "s3c2412-i2s", |
713 | .id = 0, | 721 | .id = 0, |
@@ -726,13 +734,7 @@ struct snd_soc_dai s3c2412_i2s_dai = { | |||
726 | .rates = S3C2412_I2S_RATES, | 734 | .rates = S3C2412_I2S_RATES, |
727 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE, | 735 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE, |
728 | }, | 736 | }, |
729 | .ops = { | 737 | .ops = &s3c2412_i2s_dai_ops, |
730 | .trigger = s3c2412_i2s_trigger, | ||
731 | .hw_params = s3c2412_i2s_hw_params, | ||
732 | .set_fmt = s3c2412_i2s_set_fmt, | ||
733 | .set_clkdiv = s3c2412_i2s_set_clkdiv, | ||
734 | .set_sysclk = s3c2412_i2s_set_sysclk, | ||
735 | }, | ||
736 | }; | 738 | }; |
737 | EXPORT_SYMBOL_GPL(s3c2412_i2s_dai); | 739 | EXPORT_SYMBOL_GPL(s3c2412_i2s_dai); |
738 | 740 | ||
diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c index 5822d2dd49ba..83ea623234e7 100644 --- a/sound/soc/s3c24xx/s3c2443-ac97.c +++ b/sound/soc/s3c24xx/s3c2443-ac97.c | |||
@@ -355,6 +355,11 @@ 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 | |||
358 | struct snd_soc_dai s3c2443_ac97_dai[] = { | 363 | struct snd_soc_dai s3c2443_ac97_dai[] = { |
359 | { | 364 | { |
360 | .name = "s3c2443-ac97", | 365 | .name = "s3c2443-ac97", |
@@ -374,9 +379,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = { | |||
374 | .channels_max = 2, | 379 | .channels_max = 2, |
375 | .rates = s3c2443_AC97_RATES, | 380 | .rates = s3c2443_AC97_RATES, |
376 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 381 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
377 | .ops = { | 382 | .ops = &s3c2443_ac97_dai_ops, |
378 | .hw_params = s3c2443_ac97_hw_params, | ||
379 | .trigger = s3c2443_ac97_trigger}, | ||
380 | }, | 383 | }, |
381 | { | 384 | { |
382 | .name = "pxa2xx-ac97-mic", | 385 | .name = "pxa2xx-ac97-mic", |
@@ -388,9 +391,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = { | |||
388 | .channels_max = 1, | 391 | .channels_max = 1, |
389 | .rates = s3c2443_AC97_RATES, | 392 | .rates = s3c2443_AC97_RATES, |
390 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 393 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
391 | .ops = { | 394 | .ops = &s3c2443_ac97_dai_ops, |
392 | .hw_params = s3c2443_ac97_hw_mic_params, | ||
393 | .trigger = s3c2443_ac97_mic_trigger,}, | ||
394 | }, | 395 | }, |
395 | }; | 396 | }; |
396 | EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); | 397 | EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); |
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c index 1c2b05497107..4473fb584c4c 100644 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c | |||
@@ -456,6 +456,14 @@ static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) | |||
456 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | 456 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ |
457 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) | 457 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) |
458 | 458 | ||
459 | static struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = { | ||
460 | .trigger = s3c24xx_i2s_trigger, | ||
461 | .hw_params = s3c24xx_i2s_hw_params, | ||
462 | .set_fmt = s3c24xx_i2s_set_fmt, | ||
463 | .set_clkdiv = s3c24xx_i2s_set_clkdiv, | ||
464 | .set_sysclk = s3c24xx_i2s_set_sysclk, | ||
465 | }; | ||
466 | |||
459 | struct snd_soc_dai s3c24xx_i2s_dai = { | 467 | struct snd_soc_dai s3c24xx_i2s_dai = { |
460 | .name = "s3c24xx-i2s", | 468 | .name = "s3c24xx-i2s", |
461 | .id = 0, | 469 | .id = 0, |
@@ -472,13 +480,7 @@ struct snd_soc_dai s3c24xx_i2s_dai = { | |||
472 | .channels_max = 2, | 480 | .channels_max = 2, |
473 | .rates = S3C24XX_I2S_RATES, | 481 | .rates = S3C24XX_I2S_RATES, |
474 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, | 482 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, |
475 | .ops = { | 483 | .ops = &s3c24xx_i2s_dai_ops, |
476 | .trigger = s3c24xx_i2s_trigger, | ||
477 | .hw_params = s3c24xx_i2s_hw_params, | ||
478 | .set_fmt = s3c24xx_i2s_set_fmt, | ||
479 | .set_clkdiv = s3c24xx_i2s_set_clkdiv, | ||
480 | .set_sysclk = s3c24xx_i2s_set_sysclk, | ||
481 | }, | ||
482 | }; | 484 | }; |
483 | EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); | 485 | EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); |
484 | 486 | ||
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); |