On Tue, 2010-04-27 at 10:28 -0500, Timur Tabi wrote:
Liam Girdwood wrote:
Iirc, the SSI and DMA controllers on your SoC mean that each DMA device can only do one direction (either Playback or Capture). So I'm thinking we create two DAI link entries for your sound card (one for playback and the other for capture) and they both use the same SSI device but each would have it's own DMA device.
Do you mean here:
machine_data->card.probe = mpc8610_hpcd_machine_probe; machine_data->card.remove = mpc8610_hpcd_machine_remove; machine_data->card.name = "MPC8610 HPCD"; machine_data->card.num_links = 1; machine_data->card.dai_link = &machine_data->dai;
So that num_links would be 2 instead of 1?
Yes.
I would need some way for fsl_dma_open() to get a pointer to private, DMA-specific data. I'm not sure how I can do that.
In multi-component we now have platform_data and device private data (from the regular driver model).
We also have stream snd_soc_dai_set_dma_data() for runtime DMA config.
So it depends on who is setting your DMA data. If it's DTS then it would be the of_ platform equivalent, if it's your DMA probe() then dev data otherwise you can use the snd_soc_dai_set_dma_data().
This would result in two separate pcm devices being exported to userspace i.e one for playback only and the other for capture only. I think this is also a more accurate representation of your hardware too (since we have different DMA devices for each pcm stream direction).
I can say for certain whether that will actually work. My gut tells me that I might run into problems trying to implement that. The only way to know for sure is to start hacking. Unfortunately, my window of opportunity to work on this just closed, and it may not open for a while. I know my current patch is less-than-ideal, but it does restore functionality to the 8610, and without needing any U-Boot or device-tree changes. So unless there are any real objections, I'd like it to be merged. Otherwise, 8610 audio will be broken in the next release.
Ok, I can live with this providing we can mark it as a TODO: and have a PPC Ack. It may be easier to fix in the future too as the ASoC card registration clean-up should be complete/in-progress (i.e. card platform_data and private_data will be available for passing in anything you like).
Thanks
Liam