On Tue, Mar 06, 2012 at 11:19:20AM -0700, Stephen Warren wrote:
In this case (and probably in the i.MX case, at a guess the structure is the same) I'd just have the DAI drivers kick off registration of the ASoC DMA stuff, it's all part of the ASoC driver for the hardware really.
How would that work when there are multiple DAIs, e.g. on a system with 2 I2S and 1 SPDIF DAI and they all want to register the PCM driver? I guess I could just add some utility function in the PCM driver file to ensure that the platform device only gets created once, and probably would also need to refcount it for when the DAIs get unloaded etc.
You could just create a DMA device per DAI since it's just a wrapper, you shouldn't even need to allocate a new struct device but just use the DAI device when registering the ASoC DMA driver.