Discuss to review question [PATCH V2 1/2] ASoc:codes:Add Awinic AW883XX audio amplifier driver
wangweidong.a at awinic.com
wangweidong.a at awinic.com
Mon Oct 24 04:41:03 CEST 2022
HI: Mark Brown
First of all, thank you for your review.
I still have a question I'd like to discuss with you
On Mon, Oct 17, 2022 at 04:09:12PM +0800, wangweidong.a at awinic.com wrote:
> Hi: Mark Brown
>
> Thank you for your suggestion. I will fix the problem you raised in
> the next patch, but there is still a question here and I want to
> discuss it with you
>
> This is rather too big to go through in one go so the review here is
> very high level but that's probably a good level for initial review
> here as there
> Please fix your mail client to clearly identify quoted text, as you can
see above it's very dificult for me to tell where you've replied to my mail.
> > + if (mute) {
> > + aw883xx->pstream = AW883XX_STREAM_CLOSE;
> > + cancel_delayed_work_sync(&aw883xx->start_work);
> > + mutex_lock(&aw883xx->lock);
> > + aw883xx_device_stop(aw883xx->aw_pa);
> > + mutex_unlock(&aw883xx->lock);
> > + } else {
> > + aw883xx->pstream = AW883XX_STREAM_OPEN;
> > + mutex_lock(&aw883xx->lock);
> > + aw883xx_start(aw883xx, AW_ASYNC_START);
> > + aw883xx_hold_dsp_spin_st(&aw883xx->aw_pa->spin_desc);
> > + mutex_unlock(&aw883xx->lock);
> > + }
>
> This doesn't look like a mute operation, it looks like it's starting
> and stopping the DSP.
>
> Answer: This is a mute operation ,aw883xx_device_stop is called in th
> aw883xx_mute function. This function not only executes the mute
> function aw883xx_dev_mute, but also disables dsp and power down. This
> is for the aw883xx chip low power optimization.
> Then it's not a mute function, the goal of the mute function is to run
before all the power management code to minimise glitches during power
management. Just implement the power management via the standard ASoC power
> management APIs.
The essence of calling mute is not switch dsp, but switch PA. We think that
PA has only two states. When no audio stream enters, turn off the PA and
turn off the PA's dsp. When the audio stream enters, the PA is turned on,
and the dsp is turned on at the same time
Best regards
Weidong Wang
More information about the Alsa-devel
mailing list