[alsa-devel] [PATCH 4/4] ASoC: tlv320dac33: Support for turning off the codec in BIAS_STANDBY

Peter Ujfalusi peter.ujfalusi at nokia.com
Fri Apr 30 12:10:14 CEST 2010

On Friday 30 April 2010 12:56:37 ext Mark Brown wrote:
> > 
> > I will keep the current logic, but move it a bit with the idle_bias_off
> > change.
> Hrm, you need to do this any time playback is started? 

Yes, otherwise the codec might get confused.

> Then just use
> the hooks in the normal audio stream bringup/teardown surely?  It's
> possible that I'm missing something as a result of your list of use
> cases but I'd expect this to flow fairly naturally from the normal call
> flow.

The thing is, that I want to handle the chip power in one place, and 
dac33_set_bias_level is a really good place for that.

Now, when the codec was in off, and I start the playback:
[   31.705444] dac33_prepare_chip (0) // called from pcm_prepare
[   31.708953] Bias level: STANDBY
[   31.729278] dac33_hard_power: 1
[   31.726074] Bias level: PREPARE
[   31.833801] dac33_prepare_chip (1) // From set_bias_level
DAPM switching
[   32.075775] Bias level: ON
Workqueue kicks the codec (in FIFO enabled mode)

At the time when pcm_prepare is called the codec is still in OFF.
So I just postponed the dac33_prepare_chip call for later, when the codec 
switches BIAS level.
Than I enable the power and if there is a stream, than I do the preparation.
Note: the BIAS level change is still within the pcm_prepare call chain...

But, if the codec is still in _ON, and the stream is restarted, than the codec 
can be re-configured within the pcm_prepare call, since it is on.

In this way I don't need to do any additional housekeeping while managing the 
power of the codec.


More information about the Alsa-devel mailing list