[alsa-devel] How to set TWL4030 to Option2
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
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
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
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.
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.
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.
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.
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.
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.
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.
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.
participants (4)
-
Joonyoung Shim
-
Lopez Cruz, Misael
-
Mark Brown
-
Peter Ujfalusi