* How to set TWL4030 to Option2
@ 2009-05-15 8:21 Lopez Cruz, Misael
2009-05-15 8:37 ` Peter Ujfalusi
2009-05-15 9:36 ` Joonyoung Shim
0 siblings, 2 replies; 11+ messages in thread
From: Lopez Cruz, Misael @ 2009-05-15 8:21 UTC (permalink / raw)
To: Peter Ujfalusi, Joonyoung Shim; +Cc: alsa-devel@alsa-project.org
I'm adding the voice dai to sdp3430 machine driver, but the codec's
"twl4030_voice_startup" function has a requirement for voice to work: the
codec has to be in option2. How can I switch the codec to option2 mode?
There is no control for doing that, and the only way I see is to
directly modify the reg cache, but I assume that is not the right way
to do it.
Could you please clarify?
-Misa
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 8:21 How to set TWL4030 to Option2 Lopez Cruz, Misael
@ 2009-05-15 8:37 ` Peter Ujfalusi
2009-05-15 9:36 ` Joonyoung Shim
1 sibling, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2009-05-15 8:37 UTC (permalink / raw)
To: ext Lopez Cruz, Misael; +Cc: alsa-devel@alsa-project.org, Joonyoung Shim
On Friday 15 May 2009 11:21:29 ext Lopez Cruz, Misael wrote:
> I'm adding the voice dai to sdp3430 machine driver, but the codec's
> "twl4030_voice_startup" function has a requirement for voice to work: the
> codec has to be in option2. How can I switch the codec to option2 mode?
> There is no control for doing that, and the only way I see is to
> directly modify the reg cache, but I assume that is not the right way
> to do it.
I have some complains about the current implementation of the voice dai in the
twl4030 codec (regarding on how the two dai works (or in fact should work)
with DAPM), but it is a different story.
I would suggest to add an enum to twl4030_snd_controls to select between
Option1 and Option2.
>
> Could you please clarify?
>
> -Misa
--
Péter
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 8:21 How to set TWL4030 to Option2 Lopez Cruz, Misael
2009-05-15 8:37 ` Peter Ujfalusi
@ 2009-05-15 9:36 ` Joonyoung Shim
2009-05-15 9:45 ` Mark Brown
1 sibling, 1 reply; 11+ messages in thread
From: Joonyoung Shim @ 2009-05-15 9:36 UTC (permalink / raw)
To: Lopez Cruz, Misael; +Cc: alsa-devel@alsa-project.org, Peter Ujfalusi
On 5/15/2009 5:21 PM, Lopez Cruz, Misael wrote:
> I'm adding the voice dai to sdp3430 machine driver, but the codec's
> "twl4030_voice_startup" function has a requirement for voice to work: the
> codec has to be in option2. How can I switch the codec to option2 mode?
> There is no control for doing that, and the only way I see is to
> directly modify the reg cache, but I assume that is not the right way
> to do it.
Hi,
In current code, as you say, you have to directly change the value of
the reg cache for setting to option2, also you have to modify the
REG_OPTION and REG_VOICE_IF reg for voice, but this is temporary method.
As Peter already say, we need additional controls.
Regards.
>
> Could you please clarify?
>
> -Misa
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 9:36 ` Joonyoung Shim
@ 2009-05-15 9:45 ` Mark Brown
2009-05-15 10:05 ` Lopez Cruz, Misael
2009-05-15 10:13 ` Joonyoung Shim
0 siblings, 2 replies; 11+ messages in thread
From: Mark Brown @ 2009-05-15 9:45 UTC (permalink / raw)
To: Joonyoung Shim
Cc: alsa-devel@alsa-project.org, Peter Ujfalusi, Lopez Cruz, Misael
On Fri, May 15, 2009 at 06:36:14PM +0900, Joonyoung Shim wrote:
> In current code, as you say, you have to directly change the value of
> the reg cache for setting to option2, also you have to modify the
> REG_OPTION and REG_VOICE_IF reg for voice, but this is temporary method.
This can be done with a register write from the DAI init() function in
the machine driver in order to avoid modifying twl4030.c itself.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 9:45 ` Mark Brown
@ 2009-05-15 10:05 ` Lopez Cruz, Misael
2009-05-15 11:00 ` Joonyoung Shim
2009-05-15 10:13 ` Joonyoung Shim
1 sibling, 1 reply; 11+ messages in thread
From: Lopez Cruz, Misael @ 2009-05-15 10:05 UTC (permalink / raw)
To: Mark Brown, Joonyoung Shim; +Cc: alsa-devel@alsa-project.org, Peter, Ujfalusi
> > In current code, as you say, you have to directly change
> > the value of the reg cache for setting to option2, also
> > you have to modify the REG_OPTION and REG_VOICE_IF reg for
> > voice, but this is temporary method.
> This can be done with a register write from the DAI init()
> function in the machine driver in order to avoid modifying
> twl4030.c itself.
For audio and voice interface, following things need to be configured:
Audio interface:
- Output pins state: high impendance or application mode
- Enable audio interface
Voice interface:
- Enable voice data input
- Enable voice data output
- Output pins state: high impedance or application mode
- Enable voice interface
I think that interfaces can be enabled in DAI init as Mark suggests,
but input/output should be enabled depending on whether we are doing
playback/capture or not, and then they should be handled in the codec
driver.
For the codec operation mode selection, I still think Peter's
advice is more appropriate because options1,2 are not really tight to
DAIs. For example, we can be in option2 (voice/audio) and do
transferences using both DAIs: I2S and PCM.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 10:05 ` Lopez Cruz, Misael
@ 2009-05-15 11:00 ` Joonyoung Shim
2009-05-15 11:09 ` Peter Ujfalusi
0 siblings, 1 reply; 11+ messages in thread
From: Joonyoung Shim @ 2009-05-15 11:00 UTC (permalink / raw)
To: Lopez Cruz, Misael
Cc: alsa-devel@alsa-project.org, Mark Brown, Peter Ujfalusi
On 5/15/2009 7:05 PM, Lopez Cruz, Misael wrote:
>>> In current code, as you say, you have to directly change
>>> the value of the reg cache for setting to option2, also
>>> you have to modify the REG_OPTION and REG_VOICE_IF reg for
>>> voice, but this is temporary method.
>
>> This can be done with a register write from the DAI init()
>> function in the machine driver in order to avoid modifying
>> twl4030.c itself.
>
> For audio and voice interface, following things need to be configured:
>
> Audio interface:
> - Output pins state: high impendance or application mode
> - Enable audio interface
>
> Voice interface:
> - Enable voice data input
> - Enable voice data output
> - Output pins state: high impedance or application mode
> - Enable voice interface
>
> I think that interfaces can be enabled in DAI init as Mark suggests,
Yes, but i worry about whether this reg value can be changed on the fly
or not.
> but input/output should be enabled depending on whether we are doing
> playback/capture or not, and then they should be handled in the codec
> driver.
Hmm, the twl4030 codec can do the voice communication at the same time
while doing playback/capture, is not it?
>
> For the codec operation mode selection, I still think Peter's
> advice is more appropriate because options1,2 are not really tight to
> DAIs. For example, we can be in option2 (voice/audio) and do
> transferences using both DAIs: I2S and PCM.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 11:00 ` Joonyoung Shim
@ 2009-05-15 11:09 ` Peter Ujfalusi
2009-05-15 16:58 ` Lopez Cruz, Misael
0 siblings, 1 reply; 11+ messages in thread
From: Peter Ujfalusi @ 2009-05-15 11:09 UTC (permalink / raw)
To: ext Joonyoung Shim
Cc: alsa-devel@alsa-project.org, Mark Brown, Lopez Cruz, Misael
On Friday 15 May 2009 14:00:07 ext Joonyoung Shim wrote:
> On 5/15/2009 7:05 PM, Lopez Cruz, Misael wrote:
> >>> In current code, as you say, you have to directly change
> >>> the value of the reg cache for setting to option2, also
> >>> you have to modify the REG_OPTION and REG_VOICE_IF reg for
> >>> voice, but this is temporary method.
> >>
> >> This can be done with a register write from the DAI init()
> >> function in the machine driver in order to avoid modifying
> >> twl4030.c itself.
> >
> > For audio and voice interface, following things need to be configured:
> >
> > Audio interface:
> > - Output pins state: high impendance or application mode
> > - Enable audio interface
> >
> > Voice interface:
> > - Enable voice data input
> > - Enable voice data output
> > - Output pins state: high impedance or application mode
> > - Enable voice interface
> >
> > I think that interfaces can be enabled in DAI init as Mark suggests,
>
> Yes, but i worry about whether this reg value can be changed on the fly
> or not.
I believe this needs codec off/on
>
> > but input/output should be enabled depending on whether we are doing
> > playback/capture or not, and then they should be handled in the codec
> > driver.
>
> Hmm, the twl4030 codec can do the voice communication at the same time
> while doing playback/capture, is not it?
I think he means the bits in the OPTION register.
The Option1 code toggles some of the bits in case of 4 channel mode.
Same thing can be done for Option2 voice operation I think.
>
> > For the codec operation mode selection, I still think Peter's
> > advice is more appropriate because options1,2 are not really tight to
> > DAIs. For example, we can be in option2 (voice/audio) and do
> > transferences using both DAIs: I2S and PCM.
--
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 11:09 ` Peter Ujfalusi
@ 2009-05-15 16:58 ` Lopez Cruz, Misael
0 siblings, 0 replies; 11+ messages in thread
From: Lopez Cruz, Misael @ 2009-05-15 16:58 UTC (permalink / raw)
To: Peter Ujfalusi, ext Joonyoung Shim
Cc: alsa-devel@alsa-project.org, Mark Brown
> > > I think that interfaces can be enabled in DAI init as Mark suggests,
> > Yes, but i worry about whether this reg value can be changed on the
> > fly or not.
> I believe this needs codec off/on
As per TRM, neither OPT_MODE nor sampling rates while affected filter
is running can't be change on-the-fly.
> > > but input/output should be enabled depending on whether
> > > we are doing playback/capture or not, and then they should
> > > be handled in the codec driver.
> > Hmm, the twl4030 codec can do the voice communication at
> > the same time while doing playback/capture, is not it?
> I think he means the bits in the OPTION register.
> The Option1 code toggles some of the bits in case of 4 channel mode.
> Same thing can be done for Option2 voice operation I think.
I meant that in option2, we can use I2S DAI and/or PCM DAI, not only
PCM/Voice DAI.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 9:45 ` Mark Brown
2009-05-15 10:05 ` Lopez Cruz, Misael
@ 2009-05-15 10:13 ` Joonyoung Shim
2009-05-15 10:35 ` Mark Brown
1 sibling, 1 reply; 11+ messages in thread
From: Joonyoung Shim @ 2009-05-15 10:13 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel@alsa-project.org, Peter Ujfalusi, Lopez Cruz, Misael
On 5/15/2009 6:45 PM, Mark Brown wrote:
> On Fri, May 15, 2009 at 06:36:14PM +0900, Joonyoung Shim wrote:
>
>> In current code, as you say, you have to directly change the value of
>> the reg cache for setting to option2, also you have to modify the
>> REG_OPTION and REG_VOICE_IF reg for voice, but this is temporary method.
>
> This can be done with a register write from the DAI init() function in
> the machine driver in order to avoid modifying twl4030.c itself.
>
Oh, i see, thanks. But because the startup() function of codec dai is
called earlier than startup() function of machine, i think that we need
an control to set option2.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 10:13 ` Joonyoung Shim
@ 2009-05-15 10:35 ` Mark Brown
2009-05-15 10:51 ` Joonyoung Shim
0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2009-05-15 10:35 UTC (permalink / raw)
To: Joonyoung Shim
Cc: alsa-devel@alsa-project.org, Peter Ujfalusi, Lopez Cruz, Misael
On Fri, May 15, 2009 at 07:13:06PM +0900, Joonyoung Shim wrote:
> Oh, i see, thanks. But because the startup() function of codec dai is
> called earlier than startup() function of machine, i think that we need
> an control to set option2.
init() is called when the DAI is instantiated, not during playback or
record.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: How to set TWL4030 to Option2
2009-05-15 10:35 ` Mark Brown
@ 2009-05-15 10:51 ` Joonyoung Shim
0 siblings, 0 replies; 11+ messages in thread
From: Joonyoung Shim @ 2009-05-15 10:51 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel@alsa-project.org, Peter Ujfalusi, Lopez Cruz, Misael
On 5/15/2009 7:35 PM, Mark Brown wrote:
> On Fri, May 15, 2009 at 07:13:06PM +0900, Joonyoung Shim wrote:
>
>> Oh, i see, thanks. But because the startup() function of codec dai is
>> called earlier than startup() function of machine, i think that we need
>> an control to set option2.
>
> init() is called when the DAI is instantiated, not during playback or
> record.
>
I confused the functions. :)
thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-05-15 16:58 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-15 8:21 How to set TWL4030 to Option2 Lopez Cruz, Misael
2009-05-15 8:37 ` Peter Ujfalusi
2009-05-15 9:36 ` Joonyoung Shim
2009-05-15 9:45 ` Mark Brown
2009-05-15 10:05 ` Lopez Cruz, Misael
2009-05-15 11:00 ` Joonyoung Shim
2009-05-15 11:09 ` Peter Ujfalusi
2009-05-15 16:58 ` Lopez Cruz, Misael
2009-05-15 10:13 ` Joonyoung Shim
2009-05-15 10:35 ` Mark Brown
2009-05-15 10:51 ` Joonyoung Shim
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.