Re: [alsa-devel] [PATCH V2 1/9] Register the wm9712 DAIs on module load
On Sun, May 24, 2009 at 11:28:15AM -0400, Jon Smirl wrote: > On Sun, May 24, 2009 at 7:11 AM, Mark Brown > > Why do you wish to do this - ASoC does not require or use DAI registration > > for AC97 CODECs? > Then what is wrong with my binding code? If I take out the > registration my bind fails. It appears that the problem here is that your CPU DAI isn't marked as an ac97 DAI by having ac97_control set so the core expects the codec to instantiate prior to the card. Setting ac97_control ought to fix the problem, but obviously I can't test. When looking at problems like this it's worth taking a step back and looking at why the existing code is the way that it is when considering if you've found the right fix. In this case AC97 is fairly widely used and there are also a number of WM9712 users but neither WM9712 or any of the other AC97 CODEC drivers ever register their DAIs. That should be an indication that either things probably should work without a change to existing code or things are completely broken and something wider than a change in a single driver is required in order to get things working. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH V2 1/9] Register the wm9712 DAIs on module load
Output with SOC DEBUG turned on: Advanced Linux Sound Architecture Driver Version 1.0.19. No device for DAI stac9766 analog Registered DAI 'stac9766 analog' No device for DAI stac9766 IEC958 Registered DAI 'stac9766 IEC958' No device for DAI tas5504 Registered DAI 'tas5504' Registered platform 'mpc5200-psc-audio' irq: irq 129 on host /soc5...@f000/interrupt-control...@500 mapped to virtual irq 129 irq: irq 194 on host /soc5...@f000/interrupt-control...@500 mapped to virtual irq 194 irq: irq 195 on host /soc5...@f000/interrupt-control...@500 mapped to virtual irq 195 Registered DAI 'AC97' Registered DAI 'SPDIF' mpc5200-psc-ac97 f0002000.ac97: Codec ID is 574d 4c12 soc-audio soc-audio.1: DAI AC97 HiFi not registered soc-audio soc-audio.1: Registered card 'pcm030' ALSA device list: No soundcards found. -- Jon Smirl jonsm...@gmail.com ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH V2 1/9] Register the wm9712 DAIs on module load
On Sun, May 24, 2009 at 7:11 AM, Mark Brown wrote: > On Sat, May 23, 2009 at 07:12:57PM -0400, Jon Smirl wrote: >> Register the wm9712 DAIs on module load > >> Signed-off-by: Jon Smirl > > Why do you wish to do this - ASoC does not require or use DAI registration > for AC97 CODECs? > Then what is wrong with my binding code? If I take out the registration my bind fails. static struct snd_soc_dai_link pcm030_fabric_dai[] = { { .name = "AC97", .stream_name = "AC97 Analog", .codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI], .cpu_dai = &psc_ac97_dai[MPC5200_AC97_NORMAL], }, { .name = "AC97", .stream_name = "AC97 IEC958", .codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX], .cpu_dai = &psc_ac97_dai[MPC5200_AC97_SPDIF], }, }; static __init int pcm030_fabric_init(void) { struct platform_device *pdev; int rc; if (!machine_is_compatible("phytec,pcm030")) return -ENODEV; card.platform = &mpc5200_audio_dma_platform; card.name = "pcm030"; card.dai_link = pcm030_fabric_dai; card.num_links = ARRAY_SIZE(pcm030_fabric_dai); device.card = &card; device.codec_dev = &soc_codec_dev_wm9712; pdev = platform_device_alloc("soc-audio", 1); if (!pdev) { pr_err("pcm030_fabric_init: platform_device_alloc() failed\n"); return -ENODEV; } platform_set_drvdata(pdev, &device); device.dev = &pdev->dev; rc = platform_device_add(pdev); if (rc) { pr_err("pcm030_fabric_init: platform_device_add() failed\n"); return -ENODEV; } return 0; } Advanced Linux Sound Architecture Driver Version 1.0.19. No device for DAI stac9766 analog No device for DAI stac9766 IEC958 No device for DAI tas5504 irq: irq 129 on host /soc5...@f000/interrupt-control...@500 mapped to virtual irq 129 irq: irq 194 on host /soc5...@f000/interrupt-control...@500 mapped to virtual irq 194 irq: irq 195 on host /soc5...@f000/interrupt-control...@500 mapped to virtual irq 195 mpc5200-psc-ac97 f0002000.ac97: Codec ID is 574d 4c12 ALSA device list: No soundcards found. -- Jon Smirl jonsm...@gmail.com ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH V2 1/9] Register the wm9712 DAIs on module load
On Sat, May 23, 2009 at 07:12:57PM -0400, Jon Smirl wrote: > Register the wm9712 DAIs on module load > Signed-off-by: Jon Smirl Why do you wish to do this - ASoC does not require or use DAI registration for AC97 CODECs? ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH V2 1/9] Register the wm9712 DAIs on module load
Register the wm9712 DAIs on module load Signed-off-by: Jon Smirl --- 0 files changed, 0 insertions(+), 0 deletions(-) diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 1fd4e88..49ad987 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c @@ -742,6 +742,18 @@ struct snd_soc_codec_device soc_codec_dev_wm9712 = { }; EXPORT_SYMBOL_GPL(soc_codec_dev_wm9712); +static int __init wm9712_modinit(void) +{ + return snd_soc_register_dais(wm9712_dai, ARRAY_SIZE(wm9712_dai)); +} +module_init(wm9712_modinit); + +static void __exit wm9712_exit(void) +{ + snd_soc_unregister_dais(wm9712_dai, ARRAY_SIZE(wm9712_dai)); +} +module_exit(wm9712_exit); + MODULE_DESCRIPTION("ASoC WM9711/WM9712 driver"); MODULE_AUTHOR("Liam Girdwood"); MODULE_LICENSE("GPL"); ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev