Re: [PATCH V2] ASoC: codecs: Add calibration function to aw88399 chip

From: Mark Brown
Date: Tue Jun 24 2025 - 07:40:46 EST


On Tue, Jun 24, 2025 at 02:57:48PM +0800, wangweidong.a@xxxxxxxxxx wrote:
> On Fri, Jun 20, 2025 at 14:21:25PM +0100, broonie@xxxxxxxxxx wrote:
> > On Fri, Jun 20, 2025 at 07:08:44PM +0800, wangweidong.a@xxxxxxxxxx wrote:

> >> + ret = aw_cali_svc_cali_re_mode_enable(aw_dev, true);

> >> + msleep(3000);

> > Callibration takes 3s which is a fairly long time.

> This time is because the chip needs to wait for
> the data to stabilise during calibration
> in order to ensure more accurate calibration values.
> I will reduce this time to 1s.

If you can do that safely that'd be great, but if it takes 3s then it
takes 3s - I was more noting this for context on the comments on how
callibration is triggered.

> > AFAICT it's triggered if the device is powered on and userspace reads
> > the control that reports the callibration value. That seems like it's a
> > bit too easy to trigger - something like running amixer would read the

> > BTW since the calibration is dynamically done the control should be
> > flagged as volatile.
> I will make the following two changes:
> 1.Add an additional "Calib Switch" Kcontrol to
> indicate whether calibration operations can be performed.
> 2.Add "Trigger Calib" to Kcontrol.
> This Kcontrol is write-only. When calibration is allowed,
> perform the calibration operation.

Great, that should work a lot better with diverse userspaces.

Attachment: signature.asc
Description: PGP signature