[alsa-devel] Supporting an unusual device
Hello,
I'm writing support for a slightly unusual device (which I intend to share later) and would like feedback on the best approach to take. The device is for a SOC which has two identical I2C connected codecs. Most codec drivers contain a snd_soc_dai structure - but as this contains instance specific data it would be necessary instead to produce (kmalloc) such structures for each instance (to ensure that both codecs can be treated and addressed independently). I.e. it seems that some codec drivers have been written with the assumption that there will only be one present on a system at any time. My view would be to implement such functionality (kmalloc'ing snd_soc_dai's) in one of the various platform specific directories as appropriate - e.g. atmel, blackfin, davinci, etc. Is this the best way forward? Are there any examples I've missed which do support multiple instances of the same codec?
Also - is it recommended to expose these two codecs to the outside world as two snd_soc_card devices - or a single card with multiple dai_links?
Thanks,
Andrew Murray
On Tue, Jul 26, 2011 at 05:45:44PM +0100, Andrew Murray wrote:
(kmalloc) such structures for each instance (to ensure that both codecs can be treated and addressed independently). I.e. it seems that some codec drivers have been written with the assumption that there will only be one present on a system at any time. My view would be to
What makes you say this? It's most certainly not the case with current kernel versions.
On 27 July 2011 10:22, Mark Brown broonie@opensource.wolfsonmicro.com wrote:
On Tue, Jul 26, 2011 at 05:45:44PM +0100, Andrew Murray wrote:
(kmalloc) such structures for each instance (to ensure that both codecs can be treated and addressed independently). I.e. it seems that some codec drivers have been written with the assumption that there will only be one present on a system at any time. My view would be to
What makes you say this? It's most certainly not the case with current kernel versions.
You are correct - I'm using an older kernel which doesn't yet have snd_soc_dai_driver - these changes http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=... look very helpful.
Thanks for the help.
Andrew Murray
participants (2)
-
Andrew Murray
-
Mark Brown