[PATCH v2 0/2] ASoC: SOF: control: Check the volume and switch values
From: HyeongJun An
Date: Wed Nov 18 2026 - 04:38:54 EST
SOF volume and switch controls accept any value from user space. Patch 2
rejects values outside the range the info callbacks report.
Peter pointed out in v1 that snd_sof_volume_info(), which the controls
with more than two channels use, reports the maximum differently from
snd_soc_info_volsw(). Patch 1 makes it report the same range, and patch
2 checks against that range.
Patches 1 and 2 of Arnav Kapoor's series overlap with patch 2 here:
https://lore.kernel.org/all/20261117105953.188645-1-kapoorarnav43@xxxxxxxxx/
Changes in v2:
- Add patch 1 to align snd_sof_volume_info() with snd_soc_info_volsw()
(Peter Ujfalusi)
- Patch 2 takes the maximum from the helper added in patch 1
v1: https://lore.kernel.org/all/20261114021730.2349347-1-sammiee5311@xxxxxxxxx/
Tested on a Dell Latitude 9420 (Tiger Lake, SOF IPC3,
sof-tgl-rt711-rt1316-rt714.tplg) with only snd-sof replaced. The
mixer-test failures went from 9 to 0 and pcm-test is unchanged. Out of
range writes to the volumes and switches now fail with -EINVAL, and in
range writes still work. The laptop has no SOF control with more than
two channels, so patch 1 changes nothing there. The reported range of
every SOF control is the same before and after.
Prepared with Claude Code (Claude Opus 5.5).
HyeongJun An (2):
ASoC: SOF: control: Report the volume range as ASoC does
ASoC: SOF: control: Reject out of range volume and switch values
sound/soc/sof/control.c | 49 +++++++++++++++++++++++++++++++++++------
1 file changed, 42 insertions(+), 7 deletions(-)
--
2.43.0