Re: [PATCH v4 2/2] ASoC: qcom: audioreach: Add support for VI Sense module
From: Konrad Dybcio
Date: Wed Dec 17 2025 - 05:57:51 EST
On 12/17/25 10:46 AM, Krzysztof Kozlowski wrote:
> VI Sense module in ADSP is responsible for feedback loop for measuring
> current and voltage of amplifiers, necessary for proper calibration of
> Speaker Protection algorightms. Implement parsing
> MODULE_ID_SPEAKER_PROTECTION_VI from Audioreach topology and sending it
> as command to the ADSP.
>
> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
>
> ---
[...]
> + cm_cfg->cfg.num_channels = num_channels * 2;
> + for (i = 0; i < num_channels; i++) {
> + /*
> + * Map speakers into Vsense and then Isense of each channel.
> + * E.g. for PCM_CHANNEL_FL and PCM_CHANNEL_FR to:
> + * [1, 2, 3, 4]
> + */
> + cm_cfg->cfg.channel_mapping[2 * i] = (mcfg->channel_map[i] - 1) * 2 + 1;
> + cm_cfg->cfg.channel_mapping[2 * i + 1] = (mcfg->channel_map[i] - 1) * 2 + 2;
Fly-by review, I don't really know - can't (channel_map[i] - 1) underflow?
Konrad