Skip to contentSkip to conversation

ASoC machine driver: use more than one at91 ssc

DISCUSSION Simon Tremblay 2 participants 5 messages Aug 12, 2008 – Aug 14, 2008

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 4 lines · 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

Quoted 2 lines

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

Quoted 5 lines

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

Quoted 6 lines

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

#2 lore raw
Quoted 5 lines · Simon Tremblay
Quoted 1 line · 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

Quoted 1 line

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.

Quoted 1 line
Quoted 1 line

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.

Quoted 5 lines

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.

#3 lore raw
Quoted 7 lines · Mark Brown <broonie <at> sirena.org.uk> writes:
Quoted 5 lines · Simon Tremblay
Quoted 1 line · 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

Quoted 1 line

understand for now, I need one SSC for sound output and 2 SSC for sound

input.

Quoted 13 lines

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.

Quoted 1 line
Quoted 1 line

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.

Quoted 3 lines

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

Quoted 1 line
Quoted 1 line

need to find a way to be able to reuse code here. What do you think about

all of

Quoted 9 lines
Quoted 1 line

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.

Quoted 4 lines

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...

#4 lore raw
Quoted 5 lines · Simon Tremblay

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.