diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2009-03-02 20:41:00 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-04 17:29:47 -0500 |
commit | 6335d05548eece40092000aa91b64a50310d69d5 (patch) | |
tree | ac72c74562f349879a127b4067827476a7875c88 /sound/soc/codecs | |
parent | ff09d49ad0176a5f52a398c137a7ff5f669d6be4 (diff) |
ASoC: make ops a pointer in 'struct snd_soc_dai'
Considering the fact that most cpu_dai or codec_dai are using a same
'snd_soc_dai_ops' for several similar interfaces, 'ops' would be better
made a pointer instead, to make sharing easier and code a bit cleaner.
The patch below is rather preliminary since the asoc tree is being
actively developed, and this touches almost every piece of code,
(and possibly many others in development need to be changed as
well). Building of all codecs are OK, yet to every SoC, I didn't test
that.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/ac97.c | 7 | ||||
-rw-r--r-- | sound/soc/codecs/ak4535.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/cs4270.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/ssm2602.c | 20 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic23.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic26.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/uda134x.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/uda1380.c | 46 | ||||
-rw-r--r-- | sound/soc/codecs/wm8350.c | 20 | ||||
-rw-r--r-- | sound/soc/codecs/wm8510.c | 16 | ||||
-rw-r--r-- | sound/soc/codecs/wm8580.c | 30 | ||||
-rw-r--r-- | sound/soc/codecs/wm8728.c | 12 | ||||
-rw-r--r-- | sound/soc/codecs/wm8731.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/wm8750.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/wm8753.c | 90 | ||||
-rw-r--r-- | sound/soc/codecs/wm8900.c | 16 | ||||
-rw-r--r-- | sound/soc/codecs/wm8903.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/wm8971.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/wm8990.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/wm9705.c | 8 | ||||
-rw-r--r-- | sound/soc/codecs/wm9712.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/wm9713.c | 40 |
23 files changed, 282 insertions, 211 deletions
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); |