[alsa-devel] ASoC machine driver: use more than one at91 ssc
Hi,
I want to use more than one SSC (2 to be more accurate) to be able to do what is indicated at Figure 4 of page 10/13 of this document http://www.atmel.com/dyn/resources/prod_documents/doc6020.pdf (how to setup SSC with a I2S codec).
I saw in sound/soc/at91/eti_b1_wm8731.c use of 1 SSC.
Does I need more than one snd_soc_dai_link in my snd_soc_machine? But for what I understand for now, I need one SSC for sound output and 2 SSC for sound input.
I don't know if there is some example about how to do that.
Simon
Simon Tremblay <bidou <at> videotron.qc.ca> writes:
Hi,
I want to use more than one SSC (2 to be more accurate) to be able to do what
is
indicated at Figure 4 of page 10/13 of this document http://www.atmel.com/dyn/resources/prod_documents/doc6020.pdf (how to setup
SSC
with a I2S codec).
I saw in sound/soc/at91/eti_b1_wm8731.c use of 1 SSC.
Does I need more than one snd_soc_dai_link in my snd_soc_machine? But for
what I
understand for now, I need one SSC for sound output and 2 SSC for sound input.
I don't know if there is some example about how to do that.
Simon
I was thinking about that and maybe the best way to resolve this is to modify at91-ssc.c and add a new entry in at91_ssc_dai that supports ssc0 and ssc1 together (and modify / add some functions to support this new entry). Humm, I need to find a way to be able to reuse code here. What do you think about all of that ?
Thanks,
Simon
On Wed, Aug 13, 2008 at 06:03:40AM +0000, Simon Tremblay wrote:
Simon Tremblay <bidou <at> videotron.qc.ca> writes:
Does I need more than one snd_soc_dai_link in my snd_soc_machine? But for
what I
understand for now, I need one SSC for sound output and 2 SSC for sound input.
If the two SSCs were completely independant you'd have separate DAIs for SSC0 and SSC1 but it looks like you need to use both in a closely coupled configuration to get stereo record.
I don't know if there is some example about how to do that.
Not that spring to mind - the SoCs I'm aware of all support stereo natively.
I was thinking about that and maybe the best way to resolve this is to modify at91-ssc.c and add a new entry in at91_ssc_dai that supports ssc0 and ssc1 together (and modify / add some functions to support this new entry). Humm, I need to find a way to be able to reuse code here. What do you think about all of that ?
That looks like the best bet for this situation unless you treat the stereo signal as two mono channels. The WM8753 driver does something vaugely similar with the DAI mode configuration it offers, you might find some inspiration there, though in this case simply declaring an additional link and leaving it up to the machine driver to only register the desired one might be the best bet.
Code reuse shouldn't be too much of a problem - many of the DAI operations will be shared and at worst I'd expect you'll end up writing wrapper functions to pass through the operations to both DAIs.
Mark Brown <broonie <at> sirena.org.uk> writes:
On Wed, Aug 13, 2008 at 06:03:40AM +0000, Simon Tremblay wrote:
Simon Tremblay <bidou <at> videotron.qc.ca> writes:
Does I need more than one snd_soc_dai_link in my snd_soc_machine? But for
what I
understand for now, I need one SSC for sound output and 2 SSC for sound
input.
If the two SSCs were completely independant you'd have separate DAIs for SSC0 and SSC1 but it looks like you need to use both in a closely coupled configuration to get stereo record.
I don't know if there is some example about how to do that.
Not that spring to mind - the SoCs I'm aware of all support stereo natively.
I was thinking about that and maybe the best way to resolve this is to modify at91-ssc.c and add a new entry in at91_ssc_dai that supports ssc0 and ssc1 together (and modify / add some functions to support this new entry). Humm,
I
need to find a way to be able to reuse code here. What do you think about
all of
that ?
That looks like the best bet for this situation unless you treat the stereo signal as two mono channels. The WM8753 driver does something vaugely similar with the DAI mode configuration it offers, you might find some inspiration there, though in this case simply declaring an additional link and leaving it up to the machine driver to only register the desired one might be the best bet.
Code reuse shouldn't be too much of a problem - many of the DAI operations will be shared and at worst I'd expect you'll end up writing wrapper functions to pass through the operations to both DAIs.
Ok thank you for comments. Currently I'm working on that to be able to use my codec properly (because the two SSC are connected to my codec).
But just for to test, I activated only SSC1 and I got a weird problem. When my machine driver module is loaded, I hear something from my headphone like it "synced" with console serial output (I hear noise when characters are transmitted to console serial output). But I don't know if there is something about not activating SSC0 that could cause that...
On Wed, Aug 13, 2008 at 04:49:37PM +0000, Simon Tremblay wrote:
But just for to test, I activated only SSC1 and I got a weird problem. When my machine driver module is loaded, I hear something from my headphone like it "synced" with console serial output (I hear noise when characters are transmitted to console serial output). But I don't know if there is something about not activating SSC0 that could cause that...
That might be better addressed to an Atmel related list but (aside from hardware problems) one thing to check is if there are any multi-function pins they are all configured in the correct fashion.
participants (2)
-
Mark Brown
-
Simon Tremblay