mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ASoC: SOF: control: Check the volume and switch values
@ 2026-11-18  9:38 HyeongJun An
  2026-11-18  9:38 ` [PATCH v2 1/2] ASoC: SOF: control: Report the volume range as ASoC does HyeongJun An
  2026-11-18  9:38 ` [PATCH v2 2/2] ASoC: SOF: control: Reject out of range volume and switch values HyeongJun An
  0 siblings, 2 replies; 3+ messages in thread
From: HyeongJun An @ 2026-11-18  9:38 UTC (permalink / raw)
  To: Mark Brown
  Cc: Peter Ujfalusi, Liam Girdwood, Bard Liao, Daniel Baluta,
	Kai Vehmanen, Pierre-Louis Bossart, Vijendar Mukunda,
	Jaroslav Kysela, Takashi Iwai, Arnav Kapoor, sound-open-firmware,
	linux-sound, linux-kernel, HyeongJun An

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@gmail.com/

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@gmail.com/

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-18  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18  9:38 [PATCH v2 0/2] ASoC: SOF: control: Check the volume and switch values HyeongJun An
2026-11-18  9:38 ` [PATCH v2 1/2] ASoC: SOF: control: Report the volume range as ASoC does HyeongJun An
2026-11-18  9:38 ` [PATCH v2 2/2] ASoC: SOF: control: Reject out of range volume and switch values HyeongJun An

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®