Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: Merge dai_ops factor out

Merge Eric Maio's patch to merge snd_soc_dai_ops out of line. Fixed
merge issues and updated drivers, plus an issue with the ops for the two
s3c2443 AC97 DAIs having been merged.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

+495 -433
+1 -1
include/sound/soc-dai.h
··· 203 203 int (*resume)(struct snd_soc_dai *dai); 204 204 205 205 /* ops */ 206 - struct snd_soc_dai_ops ops; 206 + struct snd_soc_dai_ops *ops; 207 207 208 208 /* DAI capabilities */ 209 209 struct snd_soc_pcm_stream capture;
+12 -21
sound/soc/atmel/atmel_ssc_dai.c
··· 697 697 #define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\ 698 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 709 struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { 701 710 { .name = "atmel-ssc0", 702 711 .id = 0, ··· 721 712 .channels_max = 2, 722 713 .rates = ATMEL_SSC_RATES, 723 714 .formats = ATMEL_SSC_FORMATS,}, 724 - .ops = { 725 - .startup = atmel_ssc_startup, 726 - .shutdown = atmel_ssc_shutdown, 727 - .prepare = atmel_ssc_prepare, 728 - .hw_params = atmel_ssc_hw_params, 729 - .set_fmt = atmel_ssc_set_dai_fmt, 730 - .set_clkdiv = atmel_ssc_set_dai_clkdiv,}, 715 + .ops = &atmel_ssc_dai_ops, 731 716 .private_data = &ssc_info[0], 732 717 }, 733 718 #if NUM_SSC_DEVICES == 3 ··· 739 736 .channels_max = 2, 740 737 .rates = ATMEL_SSC_RATES, 741 738 .formats = ATMEL_SSC_FORMATS,}, 742 - .ops = { 743 - .startup = atmel_ssc_startup, 744 - .shutdown = atmel_ssc_shutdown, 745 - .prepare = atmel_ssc_prepare, 746 - .hw_params = atmel_ssc_hw_params, 747 - .set_fmt = atmel_ssc_set_dai_fmt, 748 - .set_clkdiv = atmel_ssc_set_dai_clkdiv,}, 739 + .ops = &atmel_ssc_dai_ops, 749 740 .private_data = &ssc_info[1], 750 741 }, 751 742 { .name = "atmel-ssc2", ··· 756 759 .channels_max = 2, 757 760 .rates = ATMEL_SSC_RATES, 758 761 .formats = ATMEL_SSC_FORMATS,}, 759 - .ops = { 760 - .startup = atmel_ssc_startup, 761 - .shutdown = atmel_ssc_shutdown, 762 - .prepare = atmel_ssc_prepare, 763 - .hw_params = atmel_ssc_hw_params, 764 - .set_fmt = atmel_ssc_set_dai_fmt, 765 - .set_clkdiv = atmel_ssc_set_dai_clkdiv,}, 762 + .ops = &atmel_ssc_dai_ops, 766 763 .private_data = &ssc_info[2], 767 764 }, 768 765 #endif
+6 -4
sound/soc/au1x/psc-ac97.c
··· 342 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 350 struct snd_soc_dai au1xpsc_ac97_dai = { 346 351 .name = "au1xpsc_ac97", 347 352 .ac97_control = 1, ··· 366 361 .channels_min = 2, 367 362 .channels_max = 2, 368 363 }, 369 - .ops = { 370 - .trigger = au1xpsc_ac97_trigger, 371 - .hw_params = au1xpsc_ac97_hw_params, 372 - }, 364 + .ops = &au1xpsc_ac97_dai_ops, 373 365 }; 374 366 EXPORT_SYMBOL_GPL(au1xpsc_ac97_dai); 375 367
+7 -5
sound/soc/au1x/psc-i2s.c
··· 367 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 376 struct snd_soc_dai au1xpsc_i2s_dai = { 371 377 .name = "au1xpsc_i2s", 372 378 .probe = au1xpsc_i2s_probe, ··· 391 385 .channels_min = 2, 392 386 .channels_max = 8, /* 2 without external help */ 393 387 }, 394 - .ops = { 395 - .trigger = au1xpsc_i2s_trigger, 396 - .hw_params = au1xpsc_i2s_hw_params, 397 - .set_fmt = au1xpsc_i2s_set_fmt, 398 - }, 388 + .ops = &au1xpsc_i2s_dai_ops, 399 389 }; 400 390 EXPORT_SYMBOL(au1xpsc_i2s_dai); 401 391
+8 -6
sound/soc/blackfin/bf5xx-i2s.c
··· 287 287 #define BF5XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |\ 288 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 297 struct snd_soc_dai bf5xx_i2s_dai = { 291 298 .name = "bf5xx-i2s", 292 299 .id = 0, ··· 311 304 .channels_max = 2, 312 305 .rates = BF5XX_I2S_RATES, 313 306 .formats = BF5XX_I2S_FORMATS,}, 314 - .ops = { 315 - .startup = bf5xx_i2s_startup, 316 - .shutdown = bf5xx_i2s_shutdown, 317 - .hw_params = bf5xx_i2s_hw_params, 318 - .set_fmt = bf5xx_i2s_set_dai_fmt, 319 - }, 307 + .ops = &bf5xx_i2s_dai_ops, 320 308 }; 321 309 EXPORT_SYMBOL_GPL(bf5xx_i2s_dai); 322 310
+5 -2
sound/soc/codecs/ac97.c
··· 41 41 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ 42 42 SNDRV_PCM_RATE_48000) 43 43 44 + static struct snd_soc_dai_ops ac97_dai_ops = { 45 + .prepare = ac97_prepare, 46 + }; 47 + 44 48 struct snd_soc_dai ac97_dai = { 45 49 .name = "AC97 HiFi", 46 50 .ac97_control = 1, ··· 60 56 .channels_max = 2, 61 57 .rates = STD_AC97_RATES, 62 58 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 63 - .ops = { 64 - .prepare = ac97_prepare,}, 59 + .ops = &ac97_dai_ops, 65 60 }; 66 61 EXPORT_SYMBOL_GPL(ac97_dai); 67 62
+6 -4
sound/soc/codecs/ak4104.c
··· 174 174 return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val); 175 175 } 176 176 177 + static struct snd_soc_dai_ops ak4101_dai_ops = { 178 + .hw_params = ak4104_hw_params, 179 + .set_fmt = ak4104_set_dai_fmt, 180 + }; 181 + 177 182 struct snd_soc_dai ak4104_dai = { 178 183 .name = DRV_NAME, 179 184 .playback = { ··· 192 187 SNDRV_PCM_FMTBIT_S24_3LE | 193 188 SNDRV_PCM_FMTBIT_S24_LE 194 189 }, 195 - .ops = { 196 - .hw_params = ak4104_hw_params, 197 - .set_fmt = ak4104_set_dai_fmt, 198 - } 190 + .ops = &ak4101_dai_ops, 199 191 }; 200 192 201 193 static struct snd_soc_codec *ak4104_codec;
+8 -6
sound/soc/codecs/ak4535.c
··· 421 421 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ 422 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 431 struct snd_soc_dai ak4535_dai = { 425 432 .name = "AK4535", 426 433 .playback = { ··· 442 435 .channels_max = 2, 443 436 .rates = AK4535_RATES, 444 437 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 445 - .ops = { 446 - .hw_params = ak4535_hw_params, 447 - .set_fmt = ak4535_set_dai_fmt, 448 - .digital_mute = ak4535_mute, 449 - .set_sysclk = ak4535_set_dai_sysclk, 450 - }, 438 + .ops = &ak4535_dai_ops, 451 439 }; 452 440 EXPORT_SYMBOL_GPL(ak4535_dai); 453 441
+8 -6
sound/soc/codecs/cs4270.c
··· 502 502 */ 503 503 static struct snd_soc_codec *cs4270_codec; 504 504 505 + static struct snd_soc_dai_ops cs4270_dai_ops = { 506 + .hw_params = cs4270_hw_params, 507 + .set_sysclk = cs4270_set_dai_sysclk, 508 + .set_fmt = cs4270_set_dai_fmt, 509 + .digital_mute = cs4270_mute, 510 + }; 511 + 505 512 struct snd_soc_dai cs4270_dai = { 506 513 .name = "cs4270", 507 514 .playback = { ··· 525 518 .rates = 0, 526 519 .formats = CS4270_FORMATS, 527 520 }, 528 - .ops = { 529 - .hw_params = cs4270_hw_params, 530 - .set_sysclk = cs4270_set_dai_sysclk, 531 - .set_fmt = cs4270_set_dai_fmt, 532 - .digital_mute = cs4270_mute, 533 - }, 521 + .ops = &cs4270_dai_ops, 534 522 }; 535 523 EXPORT_SYMBOL_GPL(cs4270_dai); 536 524
+11 -9
sound/soc/codecs/ssm2602.c
··· 506 506 #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 507 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 519 struct snd_soc_dai ssm2602_dai = { 510 520 .name = "SSM2602", 511 521 .playback = { ··· 530 520 .channels_max = 2, 531 521 .rates = SSM2602_RATES, 532 522 .formats = SSM2602_FORMATS,}, 533 - .ops = { 534 - .startup = ssm2602_startup, 535 - .prepare = ssm2602_pcm_prepare, 536 - .hw_params = ssm2602_hw_params, 537 - .shutdown = ssm2602_shutdown, 538 - .digital_mute = ssm2602_mute, 539 - .set_sysclk = ssm2602_set_dai_sysclk, 540 - .set_fmt = ssm2602_set_dai_fmt, 541 - } 523 + .ops = &ssm2602_dai_ops, 542 524 }; 543 525 EXPORT_SYMBOL_GPL(ssm2602_dai); 544 526
+10 -8
sound/soc/codecs/tlv320aic23.c
··· 580 580 #define AIC23_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ 581 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 592 struct snd_soc_dai tlv320aic23_dai = { 584 593 .name = "tlv320aic23", 585 594 .playback = { ··· 603 594 .channels_max = 2, 604 595 .rates = AIC23_RATES, 605 596 .formats = AIC23_FORMATS,}, 606 - .ops = { 607 - .prepare = tlv320aic23_pcm_prepare, 608 - .hw_params = tlv320aic23_hw_params, 609 - .shutdown = tlv320aic23_shutdown, 610 - .digital_mute = tlv320aic23_mute, 611 - .set_fmt = tlv320aic23_set_dai_fmt, 612 - .set_sysclk = tlv320aic23_set_dai_sysclk, 613 - } 597 + .ops = &tlv320aic23_dai_ops, 614 598 }; 615 599 EXPORT_SYMBOL_GPL(tlv320aic23_dai); 616 600
+8 -6
sound/soc/codecs/tlv320aic26.c
··· 270 270 #define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ 271 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 280 struct snd_soc_dai aic26_dai = { 274 281 .name = "tlv320aic26", 275 282 .playback = { ··· 293 286 .rates = AIC26_RATES, 294 287 .formats = AIC26_FORMATS, 295 288 }, 296 - .ops = { 297 - .hw_params = aic26_hw_params, 298 - .digital_mute = aic26_mute, 299 - .set_sysclk = aic26_set_sysclk, 300 - .set_fmt = aic26_set_fmt, 301 - }, 289 + .ops = &aic26_dai_ops, 302 290 }; 303 291 EXPORT_SYMBOL_GPL(aic26_dai); 304 292
+8 -6
sound/soc/codecs/tlv320aic3x.c
··· 1088 1088 #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ 1089 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 1098 struct snd_soc_dai aic3x_dai = { 1092 1099 .name = "tlv320aic3x", 1093 1100 .playback = { ··· 1109 1102 .channels_max = 2, 1110 1103 .rates = AIC3X_RATES, 1111 1104 .formats = AIC3X_FORMATS,}, 1112 - .ops = { 1113 - .hw_params = aic3x_hw_params, 1114 - .digital_mute = aic3x_mute, 1115 - .set_sysclk = aic3x_set_dai_sysclk, 1116 - .set_fmt = aic3x_set_dai_fmt, 1117 - } 1105 + .ops = &aic3x_dai_ops, 1118 1106 }; 1119 1107 EXPORT_SYMBOL_GPL(aic3x_dai); 1120 1108
+10 -8
sound/soc/codecs/uda134x.c
··· 431 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 443 struct snd_soc_dai uda134x_dai = { 435 444 .name = "UDA134X", 436 445 /* playback capabilities */ ··· 459 450 .formats = UDA134X_FORMATS, 460 451 }, 461 452 /* pcm operations */ 462 - .ops = { 463 - .startup = uda134x_startup, 464 - .shutdown = uda134x_shutdown, 465 - .hw_params = uda134x_hw_params, 466 - .digital_mute = uda134x_mute, 467 - .set_sysclk = uda134x_set_dai_sysclk, 468 - .set_fmt = uda134x_set_dai_fmt, 469 - } 453 + .ops = &uda134x_dai_ops, 470 454 }; 471 455 EXPORT_SYMBOL(uda134x_dai); 472 456
+24 -18
sound/soc/codecs/uda1380.c
··· 579 579 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ 580 580 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) 581 581 582 + static struct snd_soc_dai_ops uda1380_dai_ops = { 583 + .hw_params = uda1380_pcm_hw_params, 584 + .shutdown = uda1380_pcm_shutdown, 585 + .trigger = uda1380_trigger, 586 + .set_fmt = uda1380_set_dai_fmt_both, 587 + }; 588 + 589 + static struct snd_soc_dai_ops uda1380_dai_ops_playback = { 590 + .hw_params = uda1380_pcm_hw_params, 591 + .shutdown = uda1380_pcm_shutdown, 592 + .trigger = uda1380_trigger, 593 + .set_fmt = uda1380_set_dai_fmt_playback, 594 + }; 595 + 596 + static struct snd_soc_dai_ops uda1380_dai_ops_capture = { 597 + .hw_params = uda1380_pcm_hw_params, 598 + .shutdown = uda1380_pcm_shutdown, 599 + .trigger = uda1380_trigger, 600 + .set_fmt = uda1380_set_dai_fmt_capture, 601 + }; 602 + 582 603 struct snd_soc_dai uda1380_dai[] = { 583 604 { 584 605 .name = "UDA1380", ··· 615 594 .channels_max = 2, 616 595 .rates = UDA1380_RATES, 617 596 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 618 - .ops = { 619 - .trigger = uda1380_trigger, 620 - .hw_params = uda1380_pcm_hw_params, 621 - .shutdown = uda1380_pcm_shutdown, 622 - .set_fmt = uda1380_set_dai_fmt_both, 623 - }, 597 + .ops = &uda1380_dai_ops, 624 598 }, 625 599 { /* playback only - dual interface */ 626 600 .name = "UDA1380", ··· 626 610 .rates = UDA1380_RATES, 627 611 .formats = SNDRV_PCM_FMTBIT_S16_LE, 628 612 }, 629 - .ops = { 630 - .trigger = uda1380_trigger, 631 - .hw_params = uda1380_pcm_hw_params, 632 - .shutdown = uda1380_pcm_shutdown, 633 - .set_fmt = uda1380_set_dai_fmt_playback, 634 - }, 613 + .ops = &uda1380_dai_ops_playback, 635 614 }, 636 615 { /* capture only - dual interface*/ 637 616 .name = "UDA1380", ··· 637 626 .rates = UDA1380_RATES, 638 627 .formats = SNDRV_PCM_FMTBIT_S16_LE, 639 628 }, 640 - .ops = { 641 - .trigger = uda1380_trigger, 642 - .hw_params = uda1380_pcm_hw_params, 643 - .shutdown = uda1380_pcm_shutdown, 644 - .set_fmt = uda1380_set_dai_fmt_capture, 645 - }, 629 + .ops = &uda1380_dai_ops_capture, 646 630 }, 647 631 }; 648 632 EXPORT_SYMBOL_GPL(uda1380_dai);
+11 -9
sound/soc/codecs/wm8350.c
··· 1538 1538 SNDRV_PCM_FMTBIT_S20_3LE |\ 1539 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 1551 struct snd_soc_dai wm8350_dai = { 1542 1552 .name = "WM8350", 1543 1553 .playback = { ··· 1564 1554 .rates = WM8350_RATES, 1565 1555 .formats = WM8350_FORMATS, 1566 1556 }, 1567 - .ops = { 1568 - .hw_params = wm8350_pcm_hw_params, 1569 - .digital_mute = wm8350_mute, 1570 - .trigger = wm8350_pcm_trigger, 1571 - .set_fmt = wm8350_set_dai_fmt, 1572 - .set_sysclk = wm8350_set_dai_sysclk, 1573 - .set_pll = wm8350_set_fll, 1574 - .set_clkdiv = wm8350_set_clkdiv, 1575 - }, 1557 + .ops = &wm8350_dai_ops, 1576 1558 }; 1577 1559 EXPORT_SYMBOL_GPL(wm8350_dai); 1578 1560
+9 -7
sound/soc/codecs/wm8400.c
··· 1210 1210 #define WM8400_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 1211 1211 SNDRV_PCM_FMTBIT_S24_LE) 1212 1212 1213 + static struct snd_soc_dai_ops wm8400_dai_ops = { 1214 + .hw_params = wm8400_hw_params, 1215 + .digital_mute = wm8400_mute, 1216 + .set_fmt = wm8400_set_dai_fmt, 1217 + .set_clkdiv = wm8400_set_dai_clkdiv, 1218 + .set_sysclk = wm8400_set_dai_sysclk, 1219 + }; 1220 + 1213 1221 /* 1214 1222 * The WM8400 supports 2 different and mutually exclusive DAI 1215 1223 * configurations. ··· 1243 1235 .rates = WM8400_RATES, 1244 1236 .formats = WM8400_FORMATS, 1245 1237 }, 1246 - .ops = { 1247 - .hw_params = wm8400_hw_params, 1248 - .digital_mute = wm8400_mute, 1249 - .set_fmt = wm8400_set_dai_fmt, 1250 - .set_clkdiv = wm8400_set_dai_clkdiv, 1251 - .set_sysclk = wm8400_set_dai_sysclk, 1252 - }, 1238 + .ops = &wm8400_dai_ops, 1253 1239 }; 1254 1240 EXPORT_SYMBOL_GPL(wm8400_dai); 1255 1241
+9 -7
sound/soc/codecs/wm8510.c
··· 554 554 #define WM8510_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 555 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 565 struct snd_soc_dai wm8510_dai = { 558 566 .name = "WM8510 HiFi", 559 567 .playback = { ··· 576 568 .channels_max = 2, 577 569 .rates = WM8510_RATES, 578 570 .formats = WM8510_FORMATS,}, 579 - .ops = { 580 - .hw_params = wm8510_pcm_hw_params, 581 - .digital_mute = wm8510_mute, 582 - .set_fmt = wm8510_set_dai_fmt, 583 - .set_clkdiv = wm8510_set_dai_clkdiv, 584 - .set_pll = wm8510_set_dai_pll, 585 - }, 571 + .ops = &wm8510_dai_ops, 586 572 }; 587 573 EXPORT_SYMBOL_GPL(wm8510_dai); 588 574
+17 -13
sound/soc/codecs/wm8580.c
··· 769 769 #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 770 770 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 771 771 772 + static struct snd_soc_dai_ops wm8580_dai_ops_playback = { 773 + .hw_params = wm8580_paif_hw_params, 774 + .set_fmt = wm8580_set_paif_dai_fmt, 775 + .set_clkdiv = wm8580_set_dai_clkdiv, 776 + .set_pll = wm8580_set_dai_pll, 777 + .digital_mute = wm8580_digital_mute, 778 + }; 779 + 780 + static struct snd_soc_dai_ops wm8580_dai_ops_capture = { 781 + .hw_params = wm8580_paif_hw_params, 782 + .set_fmt = wm8580_set_paif_dai_fmt, 783 + .set_clkdiv = wm8580_set_dai_clkdiv, 784 + .set_pll = wm8580_set_dai_pll, 785 + }; 786 + 772 787 struct snd_soc_dai wm8580_dai[] = { 773 788 { 774 789 .name = "WM8580 PAIFRX", ··· 795 780 .rates = SNDRV_PCM_RATE_8000_192000, 796 781 .formats = WM8580_FORMATS, 797 782 }, 798 - .ops = { 799 - .hw_params = wm8580_paif_hw_params, 800 - .set_fmt = wm8580_set_paif_dai_fmt, 801 - .set_clkdiv = wm8580_set_dai_clkdiv, 802 - .set_pll = wm8580_set_dai_pll, 803 - .digital_mute = wm8580_digital_mute, 804 - }, 783 + .ops = &wm8580_dai_ops_playback, 805 784 }, 806 785 { 807 786 .name = "WM8580 PAIFTX", ··· 807 798 .rates = SNDRV_PCM_RATE_8000_192000, 808 799 .formats = WM8580_FORMATS, 809 800 }, 810 - .ops = { 811 - .hw_params = wm8580_paif_hw_params, 812 - .set_fmt = wm8580_set_paif_dai_fmt, 813 - .set_clkdiv = wm8580_set_dai_clkdiv, 814 - .set_pll = wm8580_set_dai_pll, 815 - }, 801 + .ops = &wm8580_dai_ops_capture, 816 802 }, 817 803 }; 818 804 EXPORT_SYMBOL_GPL(wm8580_dai);
+7 -5
sound/soc/codecs/wm8728.c
··· 244 244 #define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 245 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 253 struct snd_soc_dai wm8728_dai = { 248 254 .name = "WM8728", 249 255 .playback = { ··· 259 253 .rates = WM8728_RATES, 260 254 .formats = WM8728_FORMATS, 261 255 }, 262 - .ops = { 263 - .hw_params = wm8728_hw_params, 264 - .digital_mute = wm8728_mute, 265 - .set_fmt = wm8728_set_dai_fmt, 266 - } 256 + .ops = &wm8728_dai_ops, 267 257 }; 268 258 EXPORT_SYMBOL_GPL(wm8728_dai); 269 259
+10 -8
sound/soc/codecs/wm8731.c
··· 433 433 #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 434 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 445 struct snd_soc_dai wm8731_dai = { 437 446 .name = "WM8731", 438 447 .playback = { ··· 456 447 .channels_max = 2, 457 448 .rates = WM8731_RATES, 458 449 .formats = WM8731_FORMATS,}, 459 - .ops = { 460 - .prepare = wm8731_pcm_prepare, 461 - .hw_params = wm8731_hw_params, 462 - .shutdown = wm8731_shutdown, 463 - .digital_mute = wm8731_mute, 464 - .set_sysclk = wm8731_set_dai_sysclk, 465 - .set_fmt = wm8731_set_dai_fmt, 466 - } 450 + .ops = &wm8731_dai_ops, 467 451 }; 468 452 EXPORT_SYMBOL_GPL(wm8731_dai); 469 453
+8 -6
sound/soc/codecs/wm8750.c
··· 679 679 #define WM8750_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 680 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 689 struct snd_soc_dai wm8750_dai = { 683 690 .name = "WM8750", 684 691 .playback = { ··· 700 693 .channels_max = 2, 701 694 .rates = WM8750_RATES, 702 695 .formats = WM8750_FORMATS,}, 703 - .ops = { 704 - .hw_params = wm8750_pcm_hw_params, 705 - .digital_mute = wm8750_mute, 706 - .set_fmt = wm8750_set_dai_fmt, 707 - .set_sysclk = wm8750_set_dai_sysclk, 708 - }, 696 + .ops = &wm8750_dai_ops, 709 697 }; 710 698 EXPORT_SYMBOL_GPL(wm8750_dai); 711 699
+50 -40
sound/soc/codecs/wm8753.c
··· 1301 1301 * 3. Voice disabled - HIFI over HIFI 1302 1302 * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture 1303 1303 */ 1304 + static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode1 = { 1305 + .hw_params = wm8753_i2s_hw_params, 1306 + .digital_mute = wm8753_mute, 1307 + .set_fmt = wm8753_mode1h_set_dai_fmt, 1308 + .set_clkdiv = wm8753_set_dai_clkdiv, 1309 + .set_pll = wm8753_set_dai_pll, 1310 + .set_sysclk = wm8753_set_dai_sysclk, 1311 + }; 1312 + 1313 + static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode1 = { 1314 + .hw_params = wm8753_pcm_hw_params, 1315 + .digital_mute = wm8753_mute, 1316 + .set_fmt = wm8753_mode1v_set_dai_fmt, 1317 + .set_clkdiv = wm8753_set_dai_clkdiv, 1318 + .set_pll = wm8753_set_dai_pll, 1319 + .set_sysclk = wm8753_set_dai_sysclk, 1320 + }; 1321 + 1322 + static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode2 = { 1323 + .hw_params = wm8753_pcm_hw_params, 1324 + .digital_mute = wm8753_mute, 1325 + .set_fmt = wm8753_mode2_set_dai_fmt, 1326 + .set_clkdiv = wm8753_set_dai_clkdiv, 1327 + .set_pll = wm8753_set_dai_pll, 1328 + .set_sysclk = wm8753_set_dai_sysclk, 1329 + }; 1330 + 1331 + static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode3 = { 1332 + .hw_params = wm8753_i2s_hw_params, 1333 + .digital_mute = wm8753_mute, 1334 + .set_fmt = wm8753_mode3_4_set_dai_fmt, 1335 + .set_clkdiv = wm8753_set_dai_clkdiv, 1336 + .set_pll = wm8753_set_dai_pll, 1337 + .set_sysclk = wm8753_set_dai_sysclk, 1338 + }; 1339 + 1340 + static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode4 = { 1341 + .hw_params = wm8753_i2s_hw_params, 1342 + .digital_mute = wm8753_mute, 1343 + .set_fmt = wm8753_mode3_4_set_dai_fmt, 1344 + .set_clkdiv = wm8753_set_dai_clkdiv, 1345 + .set_pll = wm8753_set_dai_pll, 1346 + .set_sysclk = wm8753_set_dai_sysclk, 1347 + }; 1348 + 1304 1349 static const struct snd_soc_dai wm8753_all_dai[] = { 1305 1350 /* DAI HiFi mode 1 */ 1306 1351 { .name = "WM8753 HiFi", ··· 1362 1317 .channels_max = 2, 1363 1318 .rates = WM8753_RATES, 1364 1319 .formats = WM8753_FORMATS}, 1365 - .ops = { 1366 - .hw_params = wm8753_i2s_hw_params, 1367 - .digital_mute = wm8753_mute, 1368 - .set_fmt = wm8753_mode1h_set_dai_fmt, 1369 - .set_clkdiv = wm8753_set_dai_clkdiv, 1370 - .set_pll = wm8753_set_dai_pll, 1371 - .set_sysclk = wm8753_set_dai_sysclk, 1372 - }, 1320 + .ops = &wm8753_dai_ops_hifi_mode1, 1373 1321 }, 1374 1322 /* DAI Voice mode 1 */ 1375 1323 { .name = "WM8753 Voice", ··· 1379 1341 .channels_max = 2, 1380 1342 .rates = WM8753_RATES, 1381 1343 .formats = WM8753_FORMATS,}, 1382 - .ops = { 1383 - .hw_params = wm8753_pcm_hw_params, 1384 - .digital_mute = wm8753_mute, 1385 - .set_fmt = wm8753_mode1v_set_dai_fmt, 1386 - .set_clkdiv = wm8753_set_dai_clkdiv, 1387 - .set_pll = wm8753_set_dai_pll, 1388 - .set_sysclk = wm8753_set_dai_sysclk, 1389 - }, 1344 + .ops = &wm8753_dai_ops_voice_mode1, 1390 1345 }, 1391 1346 /* DAI HiFi mode 2 - dummy */ 1392 1347 { .name = "WM8753 HiFi", ··· 1400 1369 .channels_max = 2, 1401 1370 .rates = WM8753_RATES, 1402 1371 .formats = WM8753_FORMATS,}, 1403 - .ops = { 1404 - .hw_params = wm8753_pcm_hw_params, 1405 - .digital_mute = wm8753_mute, 1406 - .set_fmt = wm8753_mode2_set_dai_fmt, 1407 - .set_clkdiv = wm8753_set_dai_clkdiv, 1408 - .set_pll = wm8753_set_dai_pll, 1409 - .set_sysclk = wm8753_set_dai_sysclk, 1410 - }, 1372 + .ops = &wm8753_dai_ops_voice_mode2, 1411 1373 }, 1412 1374 /* DAI HiFi mode 3 */ 1413 1375 { .name = "WM8753 HiFi", ··· 1417 1393 .channels_max = 2, 1418 1394 .rates = WM8753_RATES, 1419 1395 .formats = WM8753_FORMATS,}, 1420 - .ops = { 1421 - .hw_params = wm8753_i2s_hw_params, 1422 - .digital_mute = wm8753_mute, 1423 - .set_fmt = wm8753_mode3_4_set_dai_fmt, 1424 - .set_clkdiv = wm8753_set_dai_clkdiv, 1425 - .set_pll = wm8753_set_dai_pll, 1426 - .set_sysclk = wm8753_set_dai_sysclk, 1427 - }, 1396 + .ops = &wm8753_dai_ops_hifi_mode3, 1428 1397 }, 1429 1398 /* DAI Voice mode 3 - dummy */ 1430 1399 { .name = "WM8753 Voice", ··· 1438 1421 .channels_max = 2, 1439 1422 .rates = WM8753_RATES, 1440 1423 .formats = WM8753_FORMATS,}, 1441 - .ops = { 1442 - .hw_params = wm8753_i2s_hw_params, 1443 - .digital_mute = wm8753_mute, 1444 - .set_fmt = wm8753_mode3_4_set_dai_fmt, 1445 - .set_clkdiv = wm8753_set_dai_clkdiv, 1446 - .set_pll = wm8753_set_dai_pll, 1447 - .set_sysclk = wm8753_set_dai_sysclk, 1448 - }, 1424 + .ops = &wm8753_dai_ops_hifi_mode4, 1449 1425 }, 1450 1426 /* DAI Voice mode 4 - dummy */ 1451 1427 { .name = "WM8753 Voice",
+9 -7
sound/soc/codecs/wm8900.c
··· 1088 1088 (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ 1089 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 1099 struct snd_soc_dai wm8900_dai = { 1092 1100 .name = "WM8900 HiFi", 1093 1101 .playback = { ··· 1112 1104 .rates = WM8900_RATES, 1113 1105 .formats = WM8900_PCM_FORMATS, 1114 1106 }, 1115 - .ops = { 1116 - .hw_params = wm8900_hw_params, 1117 - .set_clkdiv = wm8900_set_dai_clkdiv, 1118 - .set_pll = wm8900_set_dai_pll, 1119 - .set_fmt = wm8900_set_dai_fmt, 1120 - .digital_mute = wm8900_digital_mute, 1121 - }, 1107 + .ops = &wm8900_dai_ops, 1122 1108 }; 1123 1109 EXPORT_SYMBOL_GPL(wm8900_dai); 1124 1110
+10 -8
sound/soc/codecs/wm8903.c
··· 1497 1497 SNDRV_PCM_FMTBIT_S20_3LE |\ 1498 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 1509 struct snd_soc_dai wm8903_dai = { 1501 1510 .name = "WM8903", 1502 1511 .playback = { ··· 1522 1513 .rates = WM8903_CAPTURE_RATES, 1523 1514 .formats = WM8903_FORMATS, 1524 1515 }, 1525 - .ops = { 1526 - .startup = wm8903_startup, 1527 - .shutdown = wm8903_shutdown, 1528 - .hw_params = wm8903_hw_params, 1529 - .digital_mute = wm8903_digital_mute, 1530 - .set_fmt = wm8903_set_dai_fmt, 1531 - .set_sysclk = wm8903_set_dai_sysclk 1532 - } 1516 + .ops = &wm8903_dai_ops, 1533 1517 }; 1534 1518 EXPORT_SYMBOL_GPL(wm8903_dai); 1535 1519
+8 -6
sound/soc/codecs/wm8971.c
··· 604 604 #define WM8971_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 605 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 614 struct snd_soc_dai wm8971_dai = { 608 615 .name = "WM8971", 609 616 .playback = { ··· 625 618 .channels_max = 2, 626 619 .rates = WM8971_RATES, 627 620 .formats = WM8971_FORMATS,}, 628 - .ops = { 629 - .hw_params = wm8971_pcm_hw_params, 630 - .digital_mute = wm8971_mute, 631 - .set_fmt = wm8971_set_dai_fmt, 632 - .set_sysclk = wm8971_set_dai_sysclk, 633 - }, 621 + .ops = &wm8971_dai_ops, 634 622 }; 635 623 EXPORT_SYMBOL_GPL(wm8971_dai); 636 624
+10 -8
sound/soc/codecs/wm8990.c
··· 1332 1332 * 1. ADC/DAC on Primary Interface 1333 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 1344 struct snd_soc_dai wm8990_dai = { 1336 1345 /* ADC/DAC on primary */ 1337 1346 .name = "WM8990 ADC/DAC Primary", ··· 1357 1348 .channels_max = 2, 1358 1349 .rates = WM8990_RATES, 1359 1350 .formats = WM8990_FORMATS,}, 1360 - .ops = { 1361 - .hw_params = wm8990_hw_params, 1362 - .digital_mute = wm8990_mute, 1363 - .set_fmt = wm8990_set_dai_fmt, 1364 - .set_clkdiv = wm8990_set_dai_clkdiv, 1365 - .set_pll = wm8990_set_dai_pll, 1366 - .set_sysclk = wm8990_set_dai_sysclk, 1367 - }, 1351 + .ops = &wm8990_dai_ops, 1368 1352 }; 1369 1353 EXPORT_SYMBOL_GPL(wm8990_dai); 1370 1354
+5 -3
sound/soc/codecs/wm9705.c
··· 269 269 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ 270 270 SNDRV_PCM_RATE_48000) 271 271 272 + static struct snd_soc_dai_ops wm9705_dai_ops = { 273 + .prepare = ac97_prepare, 274 + }; 275 + 272 276 struct snd_soc_dai wm9705_dai[] = { 273 277 { 274 278 .name = "AC97 HiFi", ··· 291 287 .rates = WM9705_AC97_RATES, 292 288 .formats = SNDRV_PCM_FMTBIT_S16_LE, 293 289 }, 294 - .ops = { 295 - .prepare = ac97_prepare, 296 - }, 290 + .ops = &wm9705_dai_ops, 297 291 }, 298 292 { 299 293 .name = "AC97 Aux",
+10 -4
sound/soc/codecs/wm9712.c
··· 517 517 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ 518 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 528 struct snd_soc_dai wm9712_dai[] = { 521 529 { 522 530 .name = "AC97 HiFi", ··· 541 533 .channels_max = 2, 542 534 .rates = WM9712_AC97_RATES, 543 535 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 544 - .ops = { 545 - .prepare = ac97_prepare,}, 536 + .ops = &wm9712_dai_ops_hifi, 546 537 }, 547 538 { 548 539 .name = "AC97 Aux", ··· 551 544 .channels_max = 1, 552 545 .rates = WM9712_AC97_RATES, 553 546 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 554 - .ops = { 555 - .prepare = ac97_aux_prepare,}, 547 + .ops = &wm9712_dai_ops_aux, 556 548 } 557 549 }; 558 550 EXPORT_SYMBOL_GPL(wm9712_dai);
+24 -16
sound/soc/codecs/wm9713.c
··· 1005 1005 (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ 1006 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 1029 struct snd_soc_dai wm9713_dai[] = { 1009 1030 { 1010 1031 .name = "AC97 HiFi", ··· 1042 1021 .channels_max = 2, 1043 1022 .rates = WM9713_RATES, 1044 1023 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 1045 - .ops = { 1046 - .prepare = ac97_hifi_prepare, 1047 - .set_clkdiv = wm9713_set_dai_clkdiv, 1048 - .set_pll = wm9713_set_dai_pll,}, 1024 + .ops = &wm9713_dai_ops_hifi, 1049 1025 }, 1050 1026 { 1051 1027 .name = "AC97 Aux", ··· 1052 1034 .channels_max = 1, 1053 1035 .rates = WM9713_RATES, 1054 1036 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 1055 - .ops = { 1056 - .prepare = ac97_aux_prepare, 1057 - .set_clkdiv = wm9713_set_dai_clkdiv, 1058 - .set_pll = wm9713_set_dai_pll,}, 1037 + .ops = &wm9713_dai_ops_aux, 1059 1038 }, 1060 1039 { 1061 1040 .name = "WM9713 Voice", ··· 1068 1053 .channels_max = 2, 1069 1054 .rates = WM9713_PCM_RATES, 1070 1055 .formats = WM9713_PCM_FORMATS,}, 1071 - .ops = { 1072 - .hw_params = wm9713_pcm_hw_params, 1073 - .shutdown = wm9713_voiceshutdown, 1074 - .set_clkdiv = wm9713_set_dai_clkdiv, 1075 - .set_pll = wm9713_set_dai_pll, 1076 - .set_fmt = wm9713_set_dai_fmt, 1077 - .set_tristate = wm9713_set_dai_tristate, 1078 - }, 1056 + .ops = &wm9713_dai_ops_voice, 1079 1057 }, 1080 1058 }; 1081 1059 EXPORT_SYMBOL_GPL(wm9713_dai);
+8 -6
sound/soc/davinci/davinci-i2s.c
··· 499 499 500 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 509 struct snd_soc_dai davinci_i2s_dai = { 503 510 .name = "davinci-i2s", 504 511 .id = 0, ··· 521 514 .channels_max = 2, 522 515 .rates = DAVINCI_I2S_RATES, 523 516 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 524 - .ops = { 525 - .startup = davinci_i2s_startup, 526 - .trigger = davinci_i2s_trigger, 527 - .hw_params = davinci_i2s_hw_params, 528 - .set_fmt = davinci_i2s_set_dai_fmt, 529 - }, 517 + .ops = &davinci_i2s_dai_ops, 530 518 }; 531 519 EXPORT_SYMBOL_GPL(davinci_i2s_dai); 532 520
+10 -8
sound/soc/fsl/fsl_ssi.c
··· 580 580 /** 581 581 * fsl_ssi_dai_template: template CPU DAI for the SSI 582 582 */ 583 + static struct snd_soc_dai_ops fsl_ssi_dai_ops = { 584 + .startup = fsl_ssi_startup, 585 + .hw_params = fsl_ssi_hw_params, 586 + .shutdown = fsl_ssi_shutdown, 587 + .trigger = fsl_ssi_trigger, 588 + .set_sysclk = fsl_ssi_set_sysclk, 589 + .set_fmt = fsl_ssi_set_fmt, 590 + }; 591 + 583 592 static struct snd_soc_dai fsl_ssi_dai_template = { 584 593 .playback = { 585 594 /* The SSI does not support monaural audio. */ ··· 603 594 .rates = FSLSSI_I2S_RATES, 604 595 .formats = FSLSSI_I2S_FORMATS, 605 596 }, 606 - .ops = { 607 - .startup = fsl_ssi_startup, 608 - .hw_params = fsl_ssi_hw_params, 609 - .shutdown = fsl_ssi_shutdown, 610 - .trigger = fsl_ssi_trigger, 611 - .set_sysclk = fsl_ssi_set_sysclk, 612 - .set_fmt = fsl_ssi_set_fmt, 613 - }, 597 + .ops = &fsl_ssi_dai_ops, 614 598 }; 615 599 616 600 /**
+11 -9
sound/soc/fsl/mpc5200_psc_i2s.c
··· 468 468 /** 469 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 481 static struct snd_soc_dai psc_i2s_dai_template = { 472 482 .playback = { 473 483 .channels_min = 2, ··· 491 481 .rates = PSC_I2S_RATES, 492 482 .formats = PSC_I2S_FORMATS, 493 483 }, 494 - .ops = { 495 - .startup = psc_i2s_startup, 496 - .hw_params = psc_i2s_hw_params, 497 - .hw_free = psc_i2s_hw_free, 498 - .shutdown = psc_i2s_shutdown, 499 - .trigger = psc_i2s_trigger, 500 - .set_sysclk = psc_i2s_set_sysclk, 501 - .set_fmt = psc_i2s_set_fmt, 502 - }, 484 + .ops = &psc_i2s_dai_ops, 503 485 }; 504 486 505 487 /* ---------------------------------------------------------------------
+11 -9
sound/soc/omap/omap-mcbsp.c
··· 461 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 474 #define OMAP_MCBSP_DAI_BUILDER(link_id) \ 465 475 { \ 466 476 .name = "omap-mcbsp-dai-"#link_id, \ ··· 487 477 .rates = OMAP_MCBSP_RATES, \ 488 478 .formats = SNDRV_PCM_FMTBIT_S16_LE, \ 489 479 }, \ 490 - .ops = { \ 491 - .startup = omap_mcbsp_dai_startup, \ 492 - .shutdown = omap_mcbsp_dai_shutdown, \ 493 - .trigger = omap_mcbsp_dai_trigger, \ 494 - .hw_params = omap_mcbsp_dai_hw_params, \ 495 - .set_fmt = omap_mcbsp_dai_set_dai_fmt, \ 496 - .set_clkdiv = omap_mcbsp_dai_set_clkdiv, \ 497 - .set_sysclk = omap_mcbsp_dai_set_dai_sysclk, \ 498 - }, \ 480 + .ops = &omap_mcbsp_dai_ops, \ 499 481 .private_data = &mcbsp_data[(link_id)].bus_id, \ 500 482 } 501 483
+17 -48
sound/soc/pxa/pxa-ssp.c
··· 794 794 SNDRV_PCM_FMTBIT_S24_LE | \ 795 795 SNDRV_PCM_FMTBIT_S32_LE) 796 796 797 + static struct snd_soc_dai_ops pxa_ssp_dai_ops = { 798 + .startup = pxa_ssp_startup, 799 + .shutdown = pxa_ssp_shutdown, 800 + .trigger = pxa_ssp_trigger, 801 + .hw_params = pxa_ssp_hw_params, 802 + .set_sysclk = pxa_ssp_set_dai_sysclk, 803 + .set_clkdiv = pxa_ssp_set_dai_clkdiv, 804 + .set_pll = pxa_ssp_set_dai_pll, 805 + .set_fmt = pxa_ssp_set_dai_fmt, 806 + .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, 807 + .set_tristate = pxa_ssp_set_dai_tristate, 808 + }; 809 + 797 810 struct snd_soc_dai pxa_ssp_dai[] = { 798 811 { 799 812 .name = "pxa2xx-ssp1", ··· 827 814 .rates = PXA_SSP_RATES, 828 815 .formats = PXA_SSP_FORMATS, 829 816 }, 830 - .ops = { 831 - .startup = pxa_ssp_startup, 832 - .shutdown = pxa_ssp_shutdown, 833 - .trigger = pxa_ssp_trigger, 834 - .hw_params = pxa_ssp_hw_params, 835 - .set_sysclk = pxa_ssp_set_dai_sysclk, 836 - .set_clkdiv = pxa_ssp_set_dai_clkdiv, 837 - .set_pll = pxa_ssp_set_dai_pll, 838 - .set_fmt = pxa_ssp_set_dai_fmt, 839 - .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, 840 - .set_tristate = pxa_ssp_set_dai_tristate, 841 - }, 817 + .ops = &pxa_ssp_dai_ops, 842 818 }, 843 819 { .name = "pxa2xx-ssp2", 844 820 .id = 1, ··· 847 845 .rates = PXA_SSP_RATES, 848 846 .formats = PXA_SSP_FORMATS, 849 847 }, 850 - .ops = { 851 - .startup = pxa_ssp_startup, 852 - .shutdown = pxa_ssp_shutdown, 853 - .trigger = pxa_ssp_trigger, 854 - .hw_params = pxa_ssp_hw_params, 855 - .set_sysclk = pxa_ssp_set_dai_sysclk, 856 - .set_clkdiv = pxa_ssp_set_dai_clkdiv, 857 - .set_pll = pxa_ssp_set_dai_pll, 858 - .set_fmt = pxa_ssp_set_dai_fmt, 859 - .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, 860 - .set_tristate = pxa_ssp_set_dai_tristate, 861 - }, 848 + .ops = &pxa_ssp_dai_ops, 862 849 }, 863 850 { 864 851 .name = "pxa2xx-ssp3", ··· 868 877 .rates = PXA_SSP_RATES, 869 878 .formats = PXA_SSP_FORMATS, 870 879 }, 871 - .ops = { 872 - .startup = pxa_ssp_startup, 873 - .shutdown = pxa_ssp_shutdown, 874 - .trigger = pxa_ssp_trigger, 875 - .hw_params = pxa_ssp_hw_params, 876 - .set_sysclk = pxa_ssp_set_dai_sysclk, 877 - .set_clkdiv = pxa_ssp_set_dai_clkdiv, 878 - .set_pll = pxa_ssp_set_dai_pll, 879 - .set_fmt = pxa_ssp_set_dai_fmt, 880 - .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, 881 - .set_tristate = pxa_ssp_set_dai_tristate, 882 - }, 880 + .ops = &pxa_ssp_dai_ops, 883 881 }, 884 882 { 885 883 .name = "pxa2xx-ssp4", ··· 889 909 .rates = PXA_SSP_RATES, 890 910 .formats = PXA_SSP_FORMATS, 891 911 }, 892 - .ops = { 893 - .startup = pxa_ssp_startup, 894 - .shutdown = pxa_ssp_shutdown, 895 - .trigger = pxa_ssp_trigger, 896 - .hw_params = pxa_ssp_hw_params, 897 - .set_sysclk = pxa_ssp_set_dai_sysclk, 898 - .set_clkdiv = pxa_ssp_set_dai_clkdiv, 899 - .set_pll = pxa_ssp_set_dai_pll, 900 - .set_fmt = pxa_ssp_set_dai_fmt, 901 - .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, 902 - .set_tristate = pxa_ssp_set_dai_tristate, 903 - }, 912 + .ops = &pxa_ssp_dai_ops, 904 913 }, 905 914 }; 906 915 EXPORT_SYMBOL_GPL(pxa_ssp_dai);
+7 -6
sound/soc/pxa/pxa2xx-ac97.c
··· 164 164 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ 165 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 172 * There is only 1 physical AC97 interface for pxa2xx, but it 169 173 * has extra fifo's that can be used for aux DACs and ADCs. ··· 193 189 .channels_max = 2, 194 190 .rates = PXA2XX_AC97_RATES, 195 191 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 196 - .ops = { 197 - .hw_params = pxa2xx_ac97_hw_params,}, 192 + .ops = &pxa_ac97_dai_ops, 198 193 }, 199 194 { 200 195 .name = "pxa2xx-ac97-aux", ··· 211 208 .channels_max = 1, 212 209 .rates = PXA2XX_AC97_RATES, 213 210 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 214 - .ops = { 215 - .hw_params = pxa2xx_ac97_hw_aux_params,}, 211 + .ops = &pxa_ac97_dai_ops, 216 212 }, 217 213 { 218 214 .name = "pxa2xx-ac97-mic", ··· 223 221 .channels_max = 1, 224 222 .rates = PXA2XX_AC97_RATES, 225 223 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 226 - .ops = { 227 - .hw_params = pxa2xx_ac97_hw_mic_params,}, 224 + .ops = &pxa_ac97_dai_ops, 228 225 }, 229 226 }; 230 227
+10 -8
sound/soc/pxa/pxa2xx-i2s.c
··· 304 304 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ 305 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 316 struct snd_soc_dai pxa_i2s_dai = { 308 317 .name = "pxa2xx-i2s", 309 318 .id = 0, ··· 328 319 .channels_max = 2, 329 320 .rates = PXA2XX_I2S_RATES, 330 321 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 331 - .ops = { 332 - .startup = pxa2xx_i2s_startup, 333 - .shutdown = pxa2xx_i2s_shutdown, 334 - .trigger = pxa2xx_i2s_trigger, 335 - .hw_params = pxa2xx_i2s_hw_params, 336 - .set_fmt = pxa2xx_i2s_set_dai_fmt, 337 - .set_sysclk = pxa2xx_i2s_set_dai_sysclk, 338 - }, 322 + .ops = &pxa_i2s_dai_ops, 339 323 }; 340 324 341 325 EXPORT_SYMBOL_GPL(pxa_i2s_dai);
+5 -3
sound/soc/s3c24xx/s3c2412-i2s.c
··· 147 147 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ 148 148 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 149 149 150 + static struct snd_soc_dai_ops s3c2412_i2s_dai_ops = { 151 + .set_sysclk = s3c2412_i2s_set_sysclk, 152 + }; 153 + 150 154 struct snd_soc_dai s3c2412_i2s_dai = { 151 155 .name = "s3c2412-i2s", 152 156 .id = 0, ··· 167 163 .rates = S3C2412_I2S_RATES, 168 164 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE, 169 165 }, 170 - .ops = { 171 - .set_sysclk = s3c2412_i2s_set_sysclk, 172 - }, 166 + .ops = &s3c2412_i2s_dai_ops, 173 167 }; 174 168 EXPORT_SYMBOL_GPL(s3c2412_i2s_dai); 175 169
+12 -6
sound/soc/s3c24xx/s3c2443-ac97.c
··· 355 355 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \ 356 356 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) 357 357 358 + static struct snd_soc_dai_ops s3c2443_ac97_dai_ops = { 359 + .hw_params = s3c2443_ac97_hw_params, 360 + .trigger = s3c2443_ac97_trigger, 361 + }; 362 + 363 + static struct snd_soc_dai_ops s3c2443_ac97_mic_dai_ops = { 364 + .hw_params = s3c2443_ac97_hw_mic_params, 365 + .trigger = s3c2443_ac97_mic_trigger, 366 + }; 367 + 358 368 struct snd_soc_dai s3c2443_ac97_dai[] = { 359 369 { 360 370 .name = "s3c2443-ac97", ··· 384 374 .channels_max = 2, 385 375 .rates = s3c2443_AC97_RATES, 386 376 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 387 - .ops = { 388 - .hw_params = s3c2443_ac97_hw_params, 389 - .trigger = s3c2443_ac97_trigger}, 377 + .ops = &s3c2443_ac97_dai_ops, 390 378 }, 391 379 { 392 380 .name = "pxa2xx-ac97-mic", ··· 396 388 .channels_max = 1, 397 389 .rates = s3c2443_AC97_RATES, 398 390 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 399 - .ops = { 400 - .hw_params = s3c2443_ac97_hw_mic_params, 401 - .trigger = s3c2443_ac97_mic_trigger,}, 391 + .ops = &s3c2443_ac97_mic_dai_ops, 402 392 }, 403 393 }; 404 394 EXPORT_SYMBOL_GPL(s3c2443_ac97_dai);
+9 -7
sound/soc/s3c24xx/s3c24xx-i2s.c
··· 449 449 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ 450 450 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 451 451 452 + static struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = { 453 + .trigger = s3c24xx_i2s_trigger, 454 + .hw_params = s3c24xx_i2s_hw_params, 455 + .set_fmt = s3c24xx_i2s_set_fmt, 456 + .set_clkdiv = s3c24xx_i2s_set_clkdiv, 457 + .set_sysclk = s3c24xx_i2s_set_sysclk, 458 + }; 459 + 452 460 struct snd_soc_dai s3c24xx_i2s_dai = { 453 461 .name = "s3c24xx-i2s", 454 462 .id = 0, ··· 473 465 .channels_max = 2, 474 466 .rates = S3C24XX_I2S_RATES, 475 467 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, 476 - .ops = { 477 - .trigger = s3c24xx_i2s_trigger, 478 - .hw_params = s3c24xx_i2s_hw_params, 479 - .set_fmt = s3c24xx_i2s_set_fmt, 480 - .set_clkdiv = s3c24xx_i2s_set_clkdiv, 481 - .set_sysclk = s3c24xx_i2s_set_sysclk, 482 - }, 468 + .ops = &s3c24xx_i2s_dai_ops, 483 469 }; 484 470 EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); 485 471
+12 -18
sound/soc/sh/ssi.c
··· 336 336 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE | \ 337 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 349 struct snd_soc_dai sh4_ssi_dai[] = { 340 350 { 341 351 .name = "SSI0", ··· 362 352 .channels_min = 2, 363 353 .channels_max = 8, 364 354 }, 365 - .ops = { 366 - .startup = ssi_startup, 367 - .shutdown = ssi_shutdown, 368 - .trigger = ssi_trigger, 369 - .hw_params = ssi_hw_params, 370 - .set_sysclk = ssi_set_sysclk, 371 - .set_clkdiv = ssi_set_clkdiv, 372 - .set_fmt = ssi_set_fmt, 373 - }, 355 + .ops = &ssi_dai_ops, 374 356 }, 375 357 #ifdef CONFIG_CPU_SUBTYPE_SH7760 376 358 { ··· 380 378 .channels_min = 2, 381 379 .channels_max = 8, 382 380 }, 383 - .ops = { 384 - .startup = ssi_startup, 385 - .shutdown = ssi_shutdown, 386 - .trigger = ssi_trigger, 387 - .hw_params = ssi_hw_params, 388 - .set_sysclk = ssi_set_sysclk, 389 - .set_clkdiv = ssi_set_clkdiv, 390 - .set_fmt = ssi_set_fmt, 391 - }, 381 + .ops = &ssi_dai_ops, 392 382 }, 393 383 #endif 394 384 };
+54 -48
sound/soc/soc-core.c
··· 133 133 mutex_lock(&pcm_mutex); 134 134 135 135 /* startup the audio subsystem */ 136 - if (cpu_dai->ops.startup) { 137 - ret = cpu_dai->ops.startup(substream, cpu_dai); 136 + if (cpu_dai->ops->startup) { 137 + ret = cpu_dai->ops->startup(substream, cpu_dai); 138 138 if (ret < 0) { 139 139 printk(KERN_ERR "asoc: can't open interface %s\n", 140 140 cpu_dai->name); ··· 150 150 } 151 151 } 152 152 153 - if (codec_dai->ops.startup) { 154 - ret = codec_dai->ops.startup(substream, codec_dai); 153 + if (codec_dai->ops->startup) { 154 + ret = codec_dai->ops->startup(substream, codec_dai); 155 155 if (ret < 0) { 156 156 printk(KERN_ERR "asoc: can't open codec %s\n", 157 157 codec_dai->name); ··· 247 247 platform->pcm_ops->close(substream); 248 248 249 249 platform_err: 250 - if (cpu_dai->ops.shutdown) 251 - cpu_dai->ops.shutdown(substream, cpu_dai); 250 + if (cpu_dai->ops->shutdown) 251 + cpu_dai->ops->shutdown(substream, cpu_dai); 252 252 out: 253 253 mutex_unlock(&pcm_mutex); 254 254 return ret; ··· 340 340 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 341 341 snd_soc_dai_digital_mute(codec_dai, 1); 342 342 343 - if (cpu_dai->ops.shutdown) 344 - cpu_dai->ops.shutdown(substream, cpu_dai); 343 + if (cpu_dai->ops->shutdown) 344 + cpu_dai->ops->shutdown(substream, cpu_dai); 345 345 346 - if (codec_dai->ops.shutdown) 347 - codec_dai->ops.shutdown(substream, codec_dai); 346 + if (codec_dai->ops->shutdown) 347 + codec_dai->ops->shutdown(substream, codec_dai); 348 348 349 349 if (machine->ops && machine->ops->shutdown) 350 350 machine->ops->shutdown(substream); ··· 408 408 } 409 409 } 410 410 411 - if (codec_dai->ops.prepare) { 412 - ret = codec_dai->ops.prepare(substream, codec_dai); 411 + if (codec_dai->ops->prepare) { 412 + ret = codec_dai->ops->prepare(substream, codec_dai); 413 413 if (ret < 0) { 414 414 printk(KERN_ERR "asoc: codec DAI prepare error\n"); 415 415 goto out; 416 416 } 417 417 } 418 418 419 - if (cpu_dai->ops.prepare) { 420 - ret = cpu_dai->ops.prepare(substream, cpu_dai); 419 + if (cpu_dai->ops->prepare) { 420 + ret = cpu_dai->ops->prepare(substream, cpu_dai); 421 421 if (ret < 0) { 422 422 printk(KERN_ERR "asoc: cpu DAI prepare error\n"); 423 423 goto out; ··· 494 494 } 495 495 } 496 496 497 - if (codec_dai->ops.hw_params) { 498 - ret = codec_dai->ops.hw_params(substream, params, codec_dai); 497 + if (codec_dai->ops->hw_params) { 498 + ret = codec_dai->ops->hw_params(substream, params, codec_dai); 499 499 if (ret < 0) { 500 500 printk(KERN_ERR "asoc: can't set codec %s hw params\n", 501 501 codec_dai->name); ··· 503 503 } 504 504 } 505 505 506 - if (cpu_dai->ops.hw_params) { 507 - ret = cpu_dai->ops.hw_params(substream, params, cpu_dai); 506 + if (cpu_dai->ops->hw_params) { 507 + ret = cpu_dai->ops->hw_params(substream, params, cpu_dai); 508 508 if (ret < 0) { 509 509 printk(KERN_ERR "asoc: interface %s hw params failed\n", 510 510 cpu_dai->name); ··· 526 526 return ret; 527 527 528 528 platform_err: 529 - if (cpu_dai->ops.hw_free) 530 - cpu_dai->ops.hw_free(substream, cpu_dai); 529 + if (cpu_dai->ops->hw_free) 530 + cpu_dai->ops->hw_free(substream, cpu_dai); 531 531 532 532 interface_err: 533 - if (codec_dai->ops.hw_free) 534 - codec_dai->ops.hw_free(substream, codec_dai); 533 + if (codec_dai->ops->hw_free) 534 + codec_dai->ops->hw_free(substream, codec_dai); 535 535 536 536 codec_err: 537 537 if (machine->ops && machine->ops->hw_free) ··· 570 570 platform->pcm_ops->hw_free(substream); 571 571 572 572 /* now free hw params for the DAI's */ 573 - if (codec_dai->ops.hw_free) 574 - codec_dai->ops.hw_free(substream, codec_dai); 573 + if (codec_dai->ops->hw_free) 574 + codec_dai->ops->hw_free(substream, codec_dai); 575 575 576 - if (cpu_dai->ops.hw_free) 577 - cpu_dai->ops.hw_free(substream, cpu_dai); 576 + if (cpu_dai->ops->hw_free) 577 + cpu_dai->ops->hw_free(substream, cpu_dai); 578 578 579 579 mutex_unlock(&pcm_mutex); 580 580 return 0; ··· 591 591 struct snd_soc_dai *codec_dai = machine->codec_dai; 592 592 int ret; 593 593 594 - if (codec_dai->ops.trigger) { 595 - ret = codec_dai->ops.trigger(substream, cmd, codec_dai); 594 + if (codec_dai->ops->trigger) { 595 + ret = codec_dai->ops->trigger(substream, cmd, codec_dai); 596 596 if (ret < 0) 597 597 return ret; 598 598 } ··· 603 603 return ret; 604 604 } 605 605 606 - if (cpu_dai->ops.trigger) { 607 - ret = cpu_dai->ops.trigger(substream, cmd, cpu_dai); 606 + if (cpu_dai->ops->trigger) { 607 + ret = cpu_dai->ops->trigger(substream, cmd, cpu_dai); 608 608 if (ret < 0) 609 609 return ret; 610 610 } ··· 645 645 /* mute any active DAC's */ 646 646 for (i = 0; i < card->num_links; i++) { 647 647 struct snd_soc_dai *dai = card->dai_link[i].codec_dai; 648 - if (dai->ops.digital_mute && dai->playback.active) 649 - dai->ops.digital_mute(dai, 1); 648 + if (dai->ops->digital_mute && dai->playback.active) 649 + dai->ops->digital_mute(dai, 1); 650 650 } 651 651 652 652 /* suspend all pcms */ ··· 741 741 /* unmute any active DACs */ 742 742 for (i = 0; i < card->num_links; i++) { 743 743 struct snd_soc_dai *dai = card->dai_link[i].codec_dai; 744 - if (dai->ops.digital_mute && dai->playback.active) 745 - dai->ops.digital_mute(dai, 0); 744 + if (dai->ops->digital_mute && dai->playback.active) 745 + dai->ops->digital_mute(dai, 0); 746 746 } 747 747 748 748 for (i = 0; i < card->num_links; i++) { ··· 2051 2051 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, 2052 2052 unsigned int freq, int dir) 2053 2053 { 2054 - if (dai->ops.set_sysclk) 2055 - return dai->ops.set_sysclk(dai, clk_id, freq, dir); 2054 + if (dai->ops->set_sysclk) 2055 + return dai->ops->set_sysclk(dai, clk_id, freq, dir); 2056 2056 else 2057 2057 return -EINVAL; 2058 2058 } ··· 2071 2071 int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, 2072 2072 int div_id, int div) 2073 2073 { 2074 - if (dai->ops.set_clkdiv) 2075 - return dai->ops.set_clkdiv(dai, div_id, div); 2074 + if (dai->ops->set_clkdiv) 2075 + return dai->ops->set_clkdiv(dai, div_id, div); 2076 2076 else 2077 2077 return -EINVAL; 2078 2078 } ··· 2090 2090 int snd_soc_dai_set_pll(struct snd_soc_dai *dai, 2091 2091 int pll_id, unsigned int freq_in, unsigned int freq_out) 2092 2092 { 2093 - if (dai->ops.set_pll) 2094 - return dai->ops.set_pll(dai, pll_id, freq_in, freq_out); 2093 + if (dai->ops->set_pll) 2094 + return dai->ops->set_pll(dai, pll_id, freq_in, freq_out); 2095 2095 else 2096 2096 return -EINVAL; 2097 2097 } ··· 2106 2106 */ 2107 2107 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) 2108 2108 { 2109 - if (dai->ops.set_fmt) 2110 - return dai->ops.set_fmt(dai, fmt); 2109 + if (dai->ops->set_fmt) 2110 + return dai->ops->set_fmt(dai, fmt); 2111 2111 else 2112 2112 return -EINVAL; 2113 2113 } ··· 2125 2125 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, 2126 2126 unsigned int mask, int slots) 2127 2127 { 2128 - if (dai->ops.set_sysclk) 2129 - return dai->ops.set_tdm_slot(dai, mask, slots); 2128 + if (dai->ops->set_sysclk) 2129 + return dai->ops->set_tdm_slot(dai, mask, slots); 2130 2130 else 2131 2131 return -EINVAL; 2132 2132 } ··· 2141 2141 */ 2142 2142 int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) 2143 2143 { 2144 - if (dai->ops.set_sysclk) 2145 - return dai->ops.set_tristate(dai, tristate); 2144 + if (dai->ops->set_sysclk) 2145 + return dai->ops->set_tristate(dai, tristate); 2146 2146 else 2147 2147 return -EINVAL; 2148 2148 } ··· 2157 2157 */ 2158 2158 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute) 2159 2159 { 2160 - if (dai->ops.digital_mute) 2161 - return dai->ops.digital_mute(dai, mute); 2160 + if (dai->ops->digital_mute) 2161 + return dai->ops->digital_mute(dai, mute); 2162 2162 else 2163 2163 return -EINVAL; 2164 2164 } ··· 2211 2211 return 0; 2212 2212 } 2213 2213 2214 + static struct snd_soc_dai_ops null_dai_ops = { 2215 + }; 2216 + 2214 2217 /** 2215 2218 * snd_soc_register_dai - Register a DAI with the ASoC core 2216 2219 * ··· 2227 2224 /* The device should become mandatory over time */ 2228 2225 if (!dai->dev) 2229 2226 printk(KERN_WARNING "No device for DAI %s\n", dai->name); 2227 + 2228 + if (!dai->ops) 2229 + dai->ops = &null_dai_ops; 2230 2230 2231 2231 INIT_LIST_HEAD(&dai->list); 2232 2232