Commit 64089b84abfe2f26a864ebd968429302dcb071de
1 parent
958e792c7c
Exists in
master
and in
39 other branches
ASoC: Register non-AC97 codec DAIs
Currently this is done at module probe time since ASoC ties in codec device probe to the instantiation of the entire ASoC device. Subsequent patches will refactor the codec drivers to handle probing separately. Note that the core does not yet use this information. AC97 is special since the codec is controlled over the AC97 link but we want to give the machine driver a chance to set up the system before trying to instantiate since it may need to do configuration before the AC97 link will operate Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Showing 21 changed files with 253 additions and 4 deletions Side-by-side Diff
- sound/soc/codecs/ad73311.c
- sound/soc/codecs/ak4535.c
- sound/soc/codecs/cs4270.c
- sound/soc/codecs/pcm3008.c
- sound/soc/codecs/ssm2602.c
- sound/soc/codecs/tlv320aic23.c
- sound/soc/codecs/tlv320aic26.c
- sound/soc/codecs/tlv320aic3x.c
- sound/soc/codecs/twl4030.c
- sound/soc/codecs/uda134x.c
- sound/soc/codecs/uda1380.c
- sound/soc/codecs/wm8510.c
- sound/soc/codecs/wm8580.c
- sound/soc/codecs/wm8728.c
- sound/soc/codecs/wm8731.c
- sound/soc/codecs/wm8750.c
- sound/soc/codecs/wm8753.c
- sound/soc/codecs/wm8900.c
- sound/soc/codecs/wm8903.c
- sound/soc/codecs/wm8971.c
- sound/soc/codecs/wm8990.c
sound/soc/codecs/ad73311.c
... | ... | @@ -98,6 +98,18 @@ |
98 | 98 | }; |
99 | 99 | EXPORT_SYMBOL_GPL(soc_codec_dev_ad73311); |
100 | 100 | |
101 | +static int __devinit ad73311_init(void) | |
102 | +{ | |
103 | + return snd_soc_register_dai(&ad73311_dai); | |
104 | +} | |
105 | +module_init(ad73311_init); | |
106 | + | |
107 | +static void __exit ad73311_exit(void) | |
108 | +{ | |
109 | + snd_soc_unregister_dai(&ad73311_dai); | |
110 | +} | |
111 | +module_exit(ad73311_exit); | |
112 | + | |
101 | 113 | MODULE_DESCRIPTION("ASoC ad73311 driver"); |
102 | 114 | MODULE_AUTHOR("Cliff Cai "); |
103 | 115 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/ak4535.c
... | ... | @@ -688,6 +688,18 @@ |
688 | 688 | }; |
689 | 689 | EXPORT_SYMBOL_GPL(soc_codec_dev_ak4535); |
690 | 690 | |
691 | +static int __devinit ak4535_modinit(void) | |
692 | +{ | |
693 | + return snd_soc_register_dai(&ak4535_dai); | |
694 | +} | |
695 | +module_init(ak4535_modinit); | |
696 | + | |
697 | +static void __exit ak4535_exit(void) | |
698 | +{ | |
699 | + snd_soc_unregister_dai(&ak4535_dai); | |
700 | +} | |
701 | +module_exit(ak4535_exit); | |
702 | + | |
691 | 703 | MODULE_DESCRIPTION("Soc AK4535 driver"); |
692 | 704 | MODULE_AUTHOR("Richard Purdie"); |
693 | 705 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/cs4270.c
... | ... | @@ -774,6 +774,18 @@ |
774 | 774 | }; |
775 | 775 | EXPORT_SYMBOL_GPL(soc_codec_device_cs4270); |
776 | 776 | |
777 | +static int __devinit cs4270_init(void) | |
778 | +{ | |
779 | + return snd_soc_register_dai(&cs4270_dai); | |
780 | +} | |
781 | +module_init(cs4270_init); | |
782 | + | |
783 | +static void __exit cs4270_exit(void) | |
784 | +{ | |
785 | + snd_soc_unregister_dai(&cs4270_dai); | |
786 | +} | |
787 | +module_exit(cs4270_exit); | |
788 | + | |
777 | 789 | MODULE_AUTHOR("Timur Tabi <timur@freescale.com>"); |
778 | 790 | MODULE_DESCRIPTION("Cirrus Logic CS4270 ALSA SoC Codec Driver"); |
779 | 791 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/pcm3008.c
... | ... | @@ -195,6 +195,18 @@ |
195 | 195 | }; |
196 | 196 | EXPORT_SYMBOL_GPL(soc_codec_dev_pcm3008); |
197 | 197 | |
198 | +static int __devinit pcm3008_init(void) | |
199 | +{ | |
200 | + return snd_soc_register_dai(&pcm3008_dai); | |
201 | +} | |
202 | +module_init(pcm3008_init); | |
203 | + | |
204 | +static void __exit pcm3008_exit(void) | |
205 | +{ | |
206 | + snd_soc_unregister_dai(&pcm3008_dai); | |
207 | +} | |
208 | +module_exit(pcm3008_exit); | |
209 | + | |
198 | 210 | MODULE_DESCRIPTION("Soc PCM3008 driver"); |
199 | 211 | MODULE_AUTHOR("Hugo Villeneuve"); |
200 | 212 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/ssm2602.c
... | ... | @@ -793,6 +793,18 @@ |
793 | 793 | }; |
794 | 794 | EXPORT_SYMBOL_GPL(soc_codec_dev_ssm2602); |
795 | 795 | |
796 | +static int __devinit ssm2602_modinit(void) | |
797 | +{ | |
798 | + return snd_soc_register_dai(&ssm2602_dai); | |
799 | +} | |
800 | +module_init(ssm2602_modinit); | |
801 | + | |
802 | +static void __exit ssm2602_exit(void) | |
803 | +{ | |
804 | + snd_soc_unregister_dai(&ssm2602_dai); | |
805 | +} | |
806 | +module_exit(ssm2602_exit); | |
807 | + | |
796 | 808 | MODULE_DESCRIPTION("ASoC ssm2602 driver"); |
797 | 809 | MODULE_AUTHOR("Cliff Cai"); |
798 | 810 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/tlv320aic23.c
... | ... | @@ -847,6 +847,18 @@ |
847 | 847 | }; |
848 | 848 | EXPORT_SYMBOL_GPL(soc_codec_dev_tlv320aic23); |
849 | 849 | |
850 | +static int __devinit tlv320aic23_modinit(void) | |
851 | +{ | |
852 | + return snd_soc_register_dai(&tlv320aic23_dai); | |
853 | +} | |
854 | +module_init(tlv320aic23_modinit); | |
855 | + | |
856 | +static void __exit tlv320aic23_exit(void) | |
857 | +{ | |
858 | + snd_soc_unregister_dai(&tlv320aic23_dai); | |
859 | +} | |
860 | +module_exit(tlv320aic23_exit); | |
861 | + | |
850 | 862 | MODULE_DESCRIPTION("ASoC TLV320AIC23 codec driver"); |
851 | 863 | MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>"); |
852 | 864 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/tlv320aic26.c
... | ... | @@ -426,7 +426,7 @@ |
426 | 426 | static int aic26_spi_probe(struct spi_device *spi) |
427 | 427 | { |
428 | 428 | struct aic26 *aic26; |
429 | - int rc, i, reg; | |
429 | + int ret, i, reg; | |
430 | 430 | |
431 | 431 | dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); |
432 | 432 | |
... | ... | @@ -456,6 +456,14 @@ |
456 | 456 | aic26->codec.reg_cache_size = AIC26_NUM_REGS; |
457 | 457 | aic26->codec.reg_cache = aic26->reg_cache; |
458 | 458 | |
459 | + aic26_dai.dev = &spi->dev; | |
460 | + ret = snd_soc_register_dai(&aic26_dai); | |
461 | + if (ret != 0) { | |
462 | + dev_err(&spi->dev, "Failed to register DAI: %d\n", ret); | |
463 | + kfree(aic26); | |
464 | + return ret; | |
465 | + } | |
466 | + | |
459 | 467 | /* Reset the codec to power on defaults */ |
460 | 468 | aic26_reg_write(&aic26->codec, AIC26_REG_RESET, 0xBB00); |
461 | 469 | |
... | ... | @@ -474,8 +482,8 @@ |
474 | 482 | |
475 | 483 | /* Register the sysfs files for debugging */ |
476 | 484 | /* Create SysFS files */ |
477 | - rc = device_create_file(&spi->dev, &dev_attr_keyclick); | |
478 | - if (rc) | |
485 | + ret = device_create_file(&spi->dev, &dev_attr_keyclick); | |
486 | + if (ret) | |
479 | 487 | dev_info(&spi->dev, "error creating sysfs files\n"); |
480 | 488 | |
481 | 489 | #if defined(CONFIG_SND_SOC_OF_SIMPLE) |
... | ... | @@ -492,6 +500,7 @@ |
492 | 500 | { |
493 | 501 | struct aic26 *aic26 = dev_get_drvdata(&spi->dev); |
494 | 502 | |
503 | + snd_soc_unregister_dai(&aic26_dai); | |
495 | 504 | kfree(aic26); |
496 | 505 | |
497 | 506 | return 0; |
sound/soc/codecs/tlv320aic3x.c
... | ... | @@ -1411,6 +1411,18 @@ |
1411 | 1411 | }; |
1412 | 1412 | EXPORT_SYMBOL_GPL(soc_codec_dev_aic3x); |
1413 | 1413 | |
1414 | +static int __devinit aic3x_modinit(void) | |
1415 | +{ | |
1416 | + return snd_soc_register_dai(&aic3x_dai); | |
1417 | +} | |
1418 | +module_init(aic3x_modinit); | |
1419 | + | |
1420 | +static void __exit aic3x_exit(void) | |
1421 | +{ | |
1422 | + snd_soc_unregister_dai(&aic3x_dai); | |
1423 | +} | |
1424 | +module_exit(aic3x_exit); | |
1425 | + | |
1414 | 1426 | MODULE_DESCRIPTION("ASoC TLV320AIC3X codec driver"); |
1415 | 1427 | MODULE_AUTHOR("Vladimir Barinov"); |
1416 | 1428 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/twl4030.c
... | ... | @@ -358,7 +358,7 @@ |
358 | 358 | .put = snd_soc_put_volsw_r2_twl4030, \ |
359 | 359 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
360 | 360 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
361 | - .max = xmax, .invert = xinvert} } | |
361 | + .rshift = xshift, .max = xmax, .invert = xinvert} } | |
362 | 362 | #define SOC_SINGLE_TLV_TWL4030(xname, xreg, xshift, xmax, xinvert, tlv_array) \ |
363 | 363 | SOC_DOUBLE_TLV_TWL4030(xname, xreg, xshift, xshift, xmax, \ |
364 | 364 | xinvert, tlv_array) |
... | ... | @@ -1274,6 +1274,18 @@ |
1274 | 1274 | .resume = twl4030_resume, |
1275 | 1275 | }; |
1276 | 1276 | EXPORT_SYMBOL_GPL(soc_codec_dev_twl4030); |
1277 | + | |
1278 | +static int __devinit twl4030_init(void) | |
1279 | +{ | |
1280 | + return snd_soc_register_dai(&twl4030_dai); | |
1281 | +} | |
1282 | +module_init(twl4030_init); | |
1283 | + | |
1284 | +static void __exit twl4030_exit(void) | |
1285 | +{ | |
1286 | + snd_soc_unregister_dai(&twl4030_dai); | |
1287 | +} | |
1288 | +module_exit(twl4030_exit); | |
1277 | 1289 | |
1278 | 1290 | MODULE_DESCRIPTION("ASoC TWL4030 codec driver"); |
1279 | 1291 | MODULE_AUTHOR("Steve Sakoman"); |
sound/soc/codecs/uda134x.c
... | ... | @@ -651,6 +651,18 @@ |
651 | 651 | }; |
652 | 652 | EXPORT_SYMBOL_GPL(soc_codec_dev_uda134x); |
653 | 653 | |
654 | +static int __devinit uda134x_init(void) | |
655 | +{ | |
656 | + return snd_soc_register_dai(&uda134x_dai); | |
657 | +} | |
658 | +module_init(uda134x_init); | |
659 | + | |
660 | +static void __exit uda134x_exit(void) | |
661 | +{ | |
662 | + snd_soc_unregister_dai(&uda134x_dai); | |
663 | +} | |
664 | +module_exit(uda134x_exit); | |
665 | + | |
654 | 666 | MODULE_DESCRIPTION("UDA134X ALSA soc codec driver"); |
655 | 667 | MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin <chripell@evolware.org>"); |
656 | 668 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/uda1380.c
... | ... | @@ -841,6 +841,18 @@ |
841 | 841 | }; |
842 | 842 | EXPORT_SYMBOL_GPL(soc_codec_dev_uda1380); |
843 | 843 | |
844 | +static int __devinit uda1380_modinit(void) | |
845 | +{ | |
846 | + return snd_soc_register_dais(uda1380_dai, ARRAY_SIZE(uda1380_dai)); | |
847 | +} | |
848 | +module_init(uda1380_modinit); | |
849 | + | |
850 | +static void __exit uda1380_exit(void) | |
851 | +{ | |
852 | + snd_soc_unregister_dais(uda1380_dai, ARRAY_SIZE(uda1380_dai)); | |
853 | +} | |
854 | +module_exit(uda1380_exit); | |
855 | + | |
844 | 856 | MODULE_AUTHOR("Giorgio Padrin"); |
845 | 857 | MODULE_DESCRIPTION("Audio support for codec Philips UDA1380"); |
846 | 858 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8510.c
... | ... | @@ -889,6 +889,18 @@ |
889 | 889 | }; |
890 | 890 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8510); |
891 | 891 | |
892 | +static int __devinit wm8510_modinit(void) | |
893 | +{ | |
894 | + return snd_soc_register_dai(&wm8510_dai); | |
895 | +} | |
896 | +module_init(wm8510_modinit); | |
897 | + | |
898 | +static void __exit wm8510_exit(void) | |
899 | +{ | |
900 | + snd_soc_unregister_dai(&wm8510_dai); | |
901 | +} | |
902 | +module_exit(wm8510_exit); | |
903 | + | |
892 | 904 | MODULE_DESCRIPTION("ASoC WM8510 driver"); |
893 | 905 | MODULE_AUTHOR("Liam Girdwood"); |
894 | 906 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8580.c
... | ... | @@ -1042,6 +1042,18 @@ |
1042 | 1042 | }; |
1043 | 1043 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8580); |
1044 | 1044 | |
1045 | +static int __devinit wm8580_modinit(void) | |
1046 | +{ | |
1047 | + return snd_soc_register_dais(wm8580_dai, ARRAY_SIZE(wm8580_dai)); | |
1048 | +} | |
1049 | +module_init(wm8580_modinit); | |
1050 | + | |
1051 | +static void __exit wm8580_exit(void) | |
1052 | +{ | |
1053 | + snd_soc_unregister_dais(wm8580_dai, ARRAY_SIZE(wm8580_dai)); | |
1054 | +} | |
1055 | +module_exit(wm8580_exit); | |
1056 | + | |
1045 | 1057 | MODULE_DESCRIPTION("ASoC WM8580 driver"); |
1046 | 1058 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
1047 | 1059 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8728.c
... | ... | @@ -568,6 +568,18 @@ |
568 | 568 | }; |
569 | 569 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8728); |
570 | 570 | |
571 | +static int __devinit wm8728_modinit(void) | |
572 | +{ | |
573 | + return snd_soc_register_dai(&wm8728_dai); | |
574 | +} | |
575 | +module_init(wm8728_modinit); | |
576 | + | |
577 | +static void __exit wm8728_exit(void) | |
578 | +{ | |
579 | + snd_soc_unregister_dai(&wm8728_dai); | |
580 | +} | |
581 | +module_exit(wm8728_exit); | |
582 | + | |
571 | 583 | MODULE_DESCRIPTION("ASoC WM8728 driver"); |
572 | 584 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
573 | 585 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8731.c
... | ... | @@ -793,6 +793,18 @@ |
793 | 793 | }; |
794 | 794 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731); |
795 | 795 | |
796 | +static int __devinit wm8731_modinit(void) | |
797 | +{ | |
798 | + return snd_soc_register_dai(&wm8731_dai); | |
799 | +} | |
800 | +module_init(wm8731_modinit); | |
801 | + | |
802 | +static void __exit wm8731_exit(void) | |
803 | +{ | |
804 | + snd_soc_unregister_dai(&wm8731_dai); | |
805 | +} | |
806 | +module_exit(wm8731_exit); | |
807 | + | |
796 | 808 | MODULE_DESCRIPTION("ASoC WM8731 driver"); |
797 | 809 | MODULE_AUTHOR("Richard Purdie"); |
798 | 810 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8750.c
... | ... | @@ -1085,6 +1085,18 @@ |
1085 | 1085 | }; |
1086 | 1086 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8750); |
1087 | 1087 | |
1088 | +static int __devinit wm8750_modinit(void) | |
1089 | +{ | |
1090 | + return snd_soc_register_dai(&wm8750_dai); | |
1091 | +} | |
1092 | +module_init(wm8750_modinit); | |
1093 | + | |
1094 | +static void __exit wm8750_exit(void) | |
1095 | +{ | |
1096 | + snd_soc_unregister_dai(&wm8750_dai); | |
1097 | +} | |
1098 | +module_exit(wm8750_exit); | |
1099 | + | |
1088 | 1100 | MODULE_DESCRIPTION("ASoC WM8750 driver"); |
1089 | 1101 | MODULE_AUTHOR("Liam Girdwood"); |
1090 | 1102 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8753.c
... | ... | @@ -1874,6 +1874,18 @@ |
1874 | 1874 | }; |
1875 | 1875 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753); |
1876 | 1876 | |
1877 | +static int __devinit wm8753_modinit(void) | |
1878 | +{ | |
1879 | + return snd_soc_register_dais(wm8753_dai, ARRAY_SIZE(wm8753_dai)); | |
1880 | +} | |
1881 | +module_init(wm8753_modinit); | |
1882 | + | |
1883 | +static void __exit wm8753_exit(void) | |
1884 | +{ | |
1885 | + snd_soc_unregister_dais(wm8753_dai, ARRAY_SIZE(wm8753_dai)); | |
1886 | +} | |
1887 | +module_exit(wm8753_exit); | |
1888 | + | |
1877 | 1889 | MODULE_DESCRIPTION("ASoC WM8753 driver"); |
1878 | 1890 | MODULE_AUTHOR("Liam Girdwood"); |
1879 | 1891 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8900.c
... | ... | @@ -1530,6 +1530,18 @@ |
1530 | 1530 | }; |
1531 | 1531 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8900); |
1532 | 1532 | |
1533 | +static int __devinit wm8900_modinit(void) | |
1534 | +{ | |
1535 | + return snd_soc_register_dai(&wm8900_dai); | |
1536 | +} | |
1537 | +module_init(wm8900_modinit); | |
1538 | + | |
1539 | +static void __exit wm8900_exit(void) | |
1540 | +{ | |
1541 | + snd_soc_unregister_dai(&wm8900_dai); | |
1542 | +} | |
1543 | +module_exit(wm8900_exit); | |
1544 | + | |
1533 | 1545 | MODULE_DESCRIPTION("ASoC WM8900 driver"); |
1534 | 1546 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfonmicro.com>"); |
1535 | 1547 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8903.c
... | ... | @@ -1809,6 +1809,18 @@ |
1809 | 1809 | }; |
1810 | 1810 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8903); |
1811 | 1811 | |
1812 | +static int __devinit wm8903_modinit(void) | |
1813 | +{ | |
1814 | + return snd_soc_register_dai(&wm8903_dai); | |
1815 | +} | |
1816 | +module_init(wm8903_modinit); | |
1817 | + | |
1818 | +static void __exit wm8903_exit(void) | |
1819 | +{ | |
1820 | + snd_soc_unregister_dai(&wm8903_dai); | |
1821 | +} | |
1822 | +module_exit(wm8903_exit); | |
1823 | + | |
1812 | 1824 | MODULE_DESCRIPTION("ASoC WM8903 driver"); |
1813 | 1825 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.cm>"); |
1814 | 1826 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8971.c
... | ... | @@ -935,6 +935,18 @@ |
935 | 935 | |
936 | 936 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8971); |
937 | 937 | |
938 | +static int __devinit wm8971_modinit(void) | |
939 | +{ | |
940 | + return snd_soc_register_dai(&wm8971_dai); | |
941 | +} | |
942 | +module_init(wm8971_modinit); | |
943 | + | |
944 | +static void __exit wm8971_exit(void) | |
945 | +{ | |
946 | + snd_soc_unregister_dai(&wm8971_dai); | |
947 | +} | |
948 | +module_exit(wm8971_exit); | |
949 | + | |
938 | 950 | MODULE_DESCRIPTION("ASoC WM8971 driver"); |
939 | 951 | MODULE_AUTHOR("Lab126"); |
940 | 952 | MODULE_LICENSE("GPL"); |
sound/soc/codecs/wm8990.c
... | ... | @@ -1643,6 +1643,18 @@ |
1643 | 1643 | }; |
1644 | 1644 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8990); |
1645 | 1645 | |
1646 | +static int __devinit wm8990_modinit(void) | |
1647 | +{ | |
1648 | + return snd_soc_register_dai(&wm8990_dai); | |
1649 | +} | |
1650 | +module_init(wm8990_modinit); | |
1651 | + | |
1652 | +static void __exit wm8990_exit(void) | |
1653 | +{ | |
1654 | + snd_soc_unregister_dai(&wm8990_dai); | |
1655 | +} | |
1656 | +module_exit(wm8990_exit); | |
1657 | + | |
1646 | 1658 | MODULE_DESCRIPTION("ASoC WM8990 driver"); |
1647 | 1659 | MODULE_AUTHOR("Liam Girdwood"); |
1648 | 1660 | MODULE_LICENSE("GPL"); |