[RFC PATCH 09/11] ALSA: mixer_audient: Add readback-free parameter set

From: Christian Ruppert

Date: Sat Oct 31 2026 - 20:07:11 EST


Add a flag to systematically force parameter writing without prior readback
to certain control types. In preparation of the id14 driver.

Signed-off-by: Christian Ruppert <arc@xxxxxx>
---
sound/usb/mixer_audient.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 803487ced997..7cb8245a64d0 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -37,6 +37,7 @@ static const DECLARE_TLV_DB_MINMAX_MUTE(snd_audient_tlv_mixer, -12800, 600);

#define SND_AUDIENT_CTYPE_FLAGS_SIGNED (1L << 0)
#define SND_AUDIENT_CTYPE_FLAGS_INIT_HW (1L << 1)
+#define SND_AUDIENT_CTYPE_FLAGS_FORCE_SET (1L << 2)

static const struct snd_audient_ctrl_type {
snd_ctl_elem_type_t type;
@@ -313,9 +314,13 @@ static int snd_audient_raw_set_one(struct usb_mixer_interface *const mixer,
int ret;
u32 buf;

- ret = snd_audient_raw_get_one(mixer, ctype, cidx, &buf);
- if (ret < 0)
- return ret;
+ if (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_FORCE_SET) {
+ buf = !value; /* just make it different */
+ } else {
+ ret = snd_audient_raw_get_one(mixer, ctype, cidx, &buf);
+ if (ret < 0)
+ return ret;
+ }

if (buf != value) {
buf = cpu_to_le32(value);
--
2.56.0