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

From: Christian Ruppert

Date: Sun Nov 01 2026 - 19:37:46 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 70ec3274a5e4..f61f9fe61345 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -39,6 +39,7 @@ static const DECLARE_TLV_DB_MINMAX_MUTE(snd_audient_tlv_mixer, -12800, 600);

#define SND_AUDIENT_CTYPE_FLAGS_SIGNED BIT(0)
#define SND_AUDIENT_CTYPE_FLAGS_INIT_HW BIT(1)
+#define SND_AUDIENT_CTYPE_FLAGS_FORCE_SET BIT(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 val;

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

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