Re: [RFC PATCH 08/23] ASoC: qcom: audioreach: run VI module in calibration mode with per-speaker events

From: Srinivas Kandagatla

Date: Sun Nov 15 2026 - 16:04:16 EST


On 11/15/26 5:36 PM, Mark Brown wrote:
>> Put the speaker protection and VI modules in calibration mode and
>> register for EVENT_ID_VI_PER_SPKR_CALIBRATION, so each speaker's state
>> and measured resistance are reported on their own.
>>
>> Number the V/I channel pairs consecutively, as the VI capture packs one
>> pair per speaker without gaps.
>
>> @@ -1483,9 +1513,20 @@ static int audioreach_speaker_protection_vi(struct q6apm_graph *graph,
>> return -EINVAL;
>> }
>>
>> - op_sz = APM_SP_VI_OP_MODE_CFG_PSIZE(num_channels);
>> + /* One 32-bit V/I word per speaker, so channels == speakers */
>> + num_speakers = num_channels;
>> + if (!num_speakers) {
>> + dev_err(graph->dev, "Error: VI needs at least one channel\n");
>> + return -EINVAL;
>> + }
>> +
>> + rc = audioreach_register_events(graph, module);
>
> What unregisters these registrations, or does it just not matter that we
> do this a bunch?
These events get automatically removed after the graph gets closed which
is on every stream close.

--srini
>