[RFC PATCH 10/23] ASoC: qcom: audioreach: support up to four speakers in VI feedback

From: Srinivas Kandagatla

Date: Fri Oct 23 2026 - 13:21:38 EST


From: Ravi Hothi <ravi.hothi@xxxxxxxxxxxxxxxx>

audioreach_speaker_protection_vi() rejects more than two channels,
although the rest of the function scales with the channel count.
Laptops with four speakers need four.

Raise the limit to MAX_SP_VI_SPEAKERS (4).

Signed-off-by: Ravi Hothi <ravi.hothi@xxxxxxxxxxxxxxxx>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
---
sound/soc/qcom/qdsp6/audioreach.c | 2 +-
sound/soc/qcom/qdsp6/audioreach.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c
index 75995426b9f6..24198cde8158 100644
--- a/sound/soc/qcom/qdsp6/audioreach.c
+++ b/sound/soc/qcom/qdsp6/audioreach.c
@@ -1508,7 +1508,7 @@ static int audioreach_speaker_protection_vi(struct q6apm_graph *graph,
u32 num_speakers;
void *p;

- if (num_channels > 2) {
+ if (num_channels > MAX_SP_VI_SPEAKERS) {
dev_err(graph->dev, "Error: Invalid channels (%d)!\n", num_channels);
return -EINVAL;
}
diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audioreach.h
index 4744d3117010..c8c7fa4f6f70 100644
--- a/sound/soc/qcom/qdsp6/audioreach.h
+++ b/sound/soc/qcom/qdsp6/audioreach.h
@@ -696,6 +696,8 @@ struct param_id_sp_op_mode {

/* Speaker Protection VI */

+#define MAX_SP_VI_SPEAKERS 4
+
#define PARAM_ID_SP_VI_OP_MODE_CFG 0x080011f4
#define PARAM_ID_SP_VI_OP_MODE_NORMAL 0
#define PARAM_ID_SP_VI_OP_MODE_CALIBRATION 1
--
2.47.3