mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support
@ 2026-11-30 16:44 Will Porter
  2026-11-30 16:44 ` [PATCH v2 01/21] ALSA: mixer_evo: Remove double end marker device list Will Porter
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

This series makes mixer_evo, the EVO4 driver, the shared driver for
Audient USB devices, and adds the Audient iD14 MkI (2708:0002) to it.

- Patches 1 to 4 (Christian) are his four pending mixer_evo fixes,
  unchanged (see "Base" below).
- Patches 5 to 15 (Christian) rename mixer_evo to mixer_audient and
  extend its control types. They add integer range checks, init at
  probe, write-only controls, a value cache in usb_mixer_elem_info
  and a matrix built from a name list. Patch 5 also renames the
  MAINTAINERS entry and adds me as a second maintainer.
- Patches 16 and 17 (Will) add a step size for integer controls and
  add enumerated controls.
- Patch 18 gives the iD14 MkI its own mixer map. The MkII keeps the
  shared one.
- Patch 19 adds the iD14 MkI tables: monitor section, routing, mixer
  matrix and the write-only controls.
- Patch 20 (Christian) merges the type-specific get and put into one
  get and one put.
- Patch 21 replaces the generic FU 12 control of the iD14 MkI. GET
  CUR on that unit returns a reply buffer that the device shares
  with other units, so the control is a new type with GET_BROKEN.

v1 was a separate driver for the iD14 MkI only:
https://lore.kernel.org/r/20261019230159.834954-1-mrwillporter@gmail.com
Christian and I then agreed to share one driver, and worked it out
in RFC rounds on linux-sound. RFC V4:
https://lore.kernel.org/r/20261115214336.17917-1-arc@gmx.li

Changes since RFC V4:
- Christian's four mixer_evo fixes are now patches 1 to 4.
- I folded the changes from Christian's review of RFC V4 patches
  12 to 16 into the patches they change. RFC V4 carried them as
  patch 17.
- Patch 14: the channel bound check is ">=", and two comments now
  name GET_BROKEN.
- Patch 20: the get sends no GET for channels at or above the
  number of hardware channels, as the type-specific gets did before.
  I also corrected its comment on -ENODATA.
- Patch 21 combines RFC V4 patches 16 and 19 on top of the unified
  get and put, and adds GET_BROKEN to the FU 12 type. It now comes
  after patch 20.

Patch 21 has my authorship and Christian's Co-developed-by and
Signed-off-by: most of its code is from his RFC V4 patch 19.

Tests: Christian tested RFC V4 and the changes above on an EVO4 on
7.3.4. I tested this version on an iD14 MkI, with the sound/usb
directory of this series built for Linux 7.2.15: every
control reads and writes as expected, and change events arrive as
expected. Each patch builds on its own with W=1 without warnings.

Base: sound for-next 486060b97284. Patches 1 to 4 are Christian's
four mixer_evo fixes (Patchwork series 1193966, "ALSA: mixer_evo:
minor fixes and tlv addition"), unchanged. They are not in for-next
yet, so I carry them here and the series applies on its own.

Not in this series (agreed with Christian, to follow later):
- FU 12 as a plain integer control, with a mask of the channels
  that the driver must not write.
- The EVO4 channels that are marked software-only are in fact
  read-only. The driver does not handle them as read-only yet.
- A variable 0 to 10 dB mic boost on the iD14 MkI. This series
  keeps it a switch, because the iD14 documentation describes a
  fixed +10 dB boost.

Tool use: I wrote the iD14 MkI patches and my changes to Christian's
patches with an LLM coding assistant (Claude). I read and reviewed
all of it, and I tested the series on the iD14 MkI. Earlier revisions
carried Assisted-by tags; I removed them after commit 1e035297ffda
("docs: remove Assisted-by references").

Christian Ruppert (16):
  ALSA: mixer_evo: Remove double end marker device list
  ALSA: mixer_evo: Fix endianness of boolean inversion
  ALSA: mixer_evo: Add tlv for mixer channels
  ALSA: mixer_evo: Add missing snd_usb_lock calls
  ALSA: rename mixer_evo to mixer_audient
  ALSA: mixer_audient: explicitly define full control names
  ALSA: mixer_audient: clarify USB control message definition
  ALSA: mixer_audient: Add length check to USB transfer
  ALSA: mixer_audient: make USB control transfer size configurable
  ALSA: mixer_audient: Allow arbitrary boolean control values
  ALSA: mixer_audient: Add integer range checks
  ALSA: mixer_audient: Add control initialization at probe
  ALSA: mixer_audient: Add readback-free parameter set
  ALSA: mixer_audient: add control value caching
  ALSA: mixer_audient: Create matrix programmatically
  ALSA: mixer_audient: Unify snd_audient_*_set/get functions for
    different types

Will Porter (5):
  ALSA: mixer_audient: Add a step size to integer controls
  ALSA: mixer_audient: Add enumerated controls
  ALSA: usb-audio: Give the Audient iD14 MkI its own mixer map
  ALSA: mixer_audient: Add Audient iD14 MkI controls
  ALSA: mixer_audient: Replace the Audient iD14 MkI FU 12 control

 MAINTAINERS               |    7 +-
 sound/usb/Makefile        |    2 +-
 sound/usb/mixer_audient.c | 1122 +++++++++++++++++++++++++++++++++++++
 sound/usb/mixer_audient.h |   13 +
 sound/usb/mixer_evo.c     |  505 -----------------
 sound/usb/mixer_evo.h     |   12 -
 sound/usb/mixer_maps.c    |   10 +-
 sound/usb/mixer_quirks.c  |    5 +-
 8 files changed, 1152 insertions(+), 524 deletions(-)
 create mode 100644 sound/usb/mixer_audient.c
 create mode 100644 sound/usb/mixer_audient.h
 delete mode 100644 sound/usb/mixer_evo.c
 delete mode 100644 sound/usb/mixer_evo.h


base-commit: 486060b97284c95384744f030706f89e1980a46e
-- 
2.47.3


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

* [PATCH v2 01/21] ALSA: mixer_evo: Remove double end marker device list
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 02/21] ALSA: mixer_evo: Fix endianness of boolean inversion Will Porter
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

The evo_devinfo array accidentally contained two end-of-array markers.
This isn't harmful but not very clean. Remove one of them.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_evo.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/usb/mixer_evo.c b/sound/usb/mixer_evo.c
index c327b82c8d2d6..26846108a3e1a 100644
--- a/sound/usb/mixer_evo.c
+++ b/sound/usb/mixer_evo.c
@@ -196,10 +196,6 @@ static const struct evo_devinfo {
 		.usb_id = USB_ID(USB_AUDIENT_VID, USB_EVO4_PID),
 		.controls = evo4_controls,
 	},
-	{
-		.usb_id = USB_ID(USB_AUDIENT_VID, USB_EVO4_PID),
-		.controls = NULL,
-	},
 	{ 0 } /* sentinel */
 };
 
-- 
2.47.3


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

* [PATCH v2 02/21] ALSA: mixer_evo: Fix endianness of boolean inversion
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
  2026-11-30 16:44 ` [PATCH v2 01/21] ALSA: mixer_evo: Remove double end marker device list Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 03/21] ALSA: mixer_evo: Add tlv for mixer channels Will Porter
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Bugfix: The optional inversion in snd_ctl_evo_boolean_get was in the
wrong endianness domain (CPU).
Move it to LE domain to make it work on all machines.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_evo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/mixer_evo.c b/sound/usb/mixer_evo.c
index 26846108a3e1a..dc1bec71779ca 100644
--- a/sound/usb/mixer_evo.c
+++ b/sound/usb/mixer_evo.c
@@ -318,7 +318,7 @@ static int snd_ctl_evo_boolean_set(struct snd_kcontrol *kctl,
 		int ret;
 
 		if (ctype->invert)
-			buf ^= 0x1;
+			buf ^= cpu_to_le32(0x1);
 
 		ret = snd_evo_get_cur(mixer, value + i, index,
 				      &rbuf, sizeof(rbuf));
-- 
2.47.3


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

* [PATCH v2 03/21] ALSA: mixer_evo: Add tlv for mixer channels
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
  2026-11-30 16:44 ` [PATCH v2 01/21] ALSA: mixer_evo: Remove double end marker device list Will Porter
  2026-11-30 16:44 ` [PATCH v2 02/21] ALSA: mixer_evo: Fix endianness of boolean inversion Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 04/21] ALSA: mixer_evo: Add missing snd_usb_lock calls Will Porter
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

mixer_evo didn't declare tlv for the recording mixer matrix which seems to
confuse some userland programs. Add tlv definitions to fix this.

We still do not add tlv for the crossfader (generally labelled "mixer")
because there doesn't seem to be a way to declare this so that userland
programs just keep it as linear as it is and should be.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_evo.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/usb/mixer_evo.c b/sound/usb/mixer_evo.c
index dc1bec71779ca..29b41c9ce1c4f 100644
--- a/sound/usb/mixer_evo.c
+++ b/sound/usb/mixer_evo.c
@@ -14,6 +14,7 @@
 #include <linux/slab.h>
 #include <sound/core.h>
 #include <sound/control.h>
+#include <sound/tlv.h>
 
 #include "usbaudio.h"
 #include "mixer.h"
@@ -31,6 +32,9 @@ enum snd_evo_type {
 	SND_EVO_TYPE_NCTYPES
 };
 
+/* Mixer matrix: -128dB (mute) to +6dB */
+static const DECLARE_TLV_DB_MINMAX_MUTE(snd_evo_tlv_mixer, -12800, 600);
+
 static const struct snd_evo_ctrl_type {
 	snd_ctl_elem_type_t type;
 	bool invert;
@@ -40,6 +44,7 @@ static const struct snd_evo_ctrl_type {
 	union {
 		int integer;
 	} max;
+	const unsigned int *tlv;
 	u16 wValue;
 	u16 wIndex;
 } snd_evo_ctypes[SND_EVO_TYPE_NCTYPES] = {
@@ -49,6 +54,7 @@ static const struct snd_evo_ctrl_type {
 		.max.integer = 127,
 		.wValue = 0x0000,
 		.wIndex = 0x3800,
+		/* no TLV here because we can't describe the cross-fader */
 	},
 	[SND_EVO_TYPE_PHANTOM] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
@@ -80,6 +86,7 @@ static const struct snd_evo_ctrl_type {
 		.max.integer = 6 * 256,
 		.wValue = 0x0100,
 		.wIndex = 0x3C00,
+		.tlv = snd_evo_tlv_mixer,
 	},
 };
 
@@ -415,8 +422,6 @@ static int snd_ctl_evo_info(struct snd_kcontrol *kctl,
 	const struct snd_evo_ctrl_type *const ctype = snd_evo_kctl_type(kctl);
 
 	uinfo->type = ctype->type;
-	uinfo->access = SNDRV_CTL_ELEM_ACCESS_READWRITE
-			| SNDRV_CTL_ELEM_ACCESS_VOLATILE;
 	uinfo->count = snd_evo_kctl_channels(kctl);
 	uinfo->value.integer.min = ctype->min.integer;
 	uinfo->value.integer.max = ctype->max.integer;
@@ -438,6 +443,10 @@ static int snd_evo_add_ctrl(struct usb_mixer_interface *mixer,
 	knew.info = snd_ctl_evo_info;
 	knew.private_value = snd_evo_kctl_priv(ctrl->type, ctrl->val_offs,
 					       ctrl->hwchannels);
+	knew.tlv.p = ctype->tlv;
+	knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE
+			| SNDRV_CTL_ELEM_ACCESS_VOLATILE
+			| (ctype->tlv ? SNDRV_CTL_ELEM_ACCESS_TLV_READ : 0);
 
 	switch (ctype->type) {
 	case SNDRV_CTL_ELEM_TYPE_INTEGER:
-- 
2.47.3


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

* [PATCH v2 04/21] ALSA: mixer_evo: Add missing snd_usb_lock calls
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (2 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 03/21] ALSA: mixer_evo: Add tlv for mixer channels Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 05/21] ALSA: rename mixer_evo to mixer_audient Will Porter
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Bugfix: Add missing snd_usb_lock_shutdown calls to mixer_evo.c.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_evo.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sound/usb/mixer_evo.c b/sound/usb/mixer_evo.c
index 29b41c9ce1c4f..c1e0332232f2d 100644
--- a/sound/usb/mixer_evo.c
+++ b/sound/usb/mixer_evo.c
@@ -282,6 +282,10 @@ static int snd_ctl_evo_boolean_get(struct snd_kcontrol *kctl,
 
 	int i;
 
+	CLASS(snd_usb_lock, pm)(mixer->chip);
+	if (pm.err < 0)
+		return pm.err;
+
 	for (i = 0; i < hwchan; i++) {
 		u32 buf;
 		int ret;
@@ -319,6 +323,10 @@ static int snd_ctl_evo_boolean_set(struct snd_kcontrol *kctl,
 	int changed = 0;
 	int i;
 
+	CLASS(snd_usb_lock, pm)(mixer->chip);
+	if (pm.err < 0)
+		return pm.err;
+
 	for (i = 0; i < hwchan; i++) {
 		u32 rbuf;
 		u32 buf = cpu_to_le32(ctl_val->value.integer.value[i] ? 1 : 0);
@@ -359,6 +367,10 @@ static int snd_ctl_evo_integer_get(struct snd_kcontrol *kctl,
 
 	int i;
 
+	CLASS(snd_usb_lock, pm)(mixer->chip);
+	if (pm.err < 0)
+		return pm.err;
+
 	for (i = 0; i < hwchan; i++) {
 		u16 buf;
 		s16 val;
@@ -393,6 +405,10 @@ static int snd_ctl_evo_integer_set(struct snd_kcontrol *kctl,
 	int changed = 0;
 	int i;
 
+	CLASS(snd_usb_lock, pm)(mixer->chip);
+	if (pm.err < 0)
+		return pm.err;
+
 	for (i = 0; i < hwchan; i++) {
 		s16 rbuf;
 		s16 buf = cpu_to_le16(ctl_val->value.integer.value[i]);
-- 
2.47.3


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

* [PATCH v2 05/21] ALSA: rename mixer_evo to mixer_audient
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (3 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 04/21] ALSA: mixer_evo: Add missing snd_usb_lock calls Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 06/21] ALSA: mixer_audient: explicitly define full control names Will Porter
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Rename mixer_evo files and functions to *_audient in preparation of a more
generic driver for audient devices.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 MAINTAINERS                                |   7 +-
 sound/usb/Makefile                         |   2 +-
 sound/usb/{mixer_evo.c => mixer_audient.c} | 249 +++++++++++----------
 sound/usb/mixer_audient.h                  |  12 +
 sound/usb/mixer_evo.h                      |  12 -
 sound/usb/mixer_quirks.c                   |   4 +-
 6 files changed, 148 insertions(+), 138 deletions(-)
 rename sound/usb/{mixer_evo.c => mixer_audient.c} (54%)
 create mode 100644 sound/usb/mixer_audient.h
 delete mode 100644 sound/usb/mixer_evo.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 2ce1f5b71db72..283eb2ea6e042 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4448,12 +4448,13 @@ F:	drivers/net/ieee802154/at86rf230.h
 F:	drivers/net/ieee802154/atusb.c
 F:	drivers/net/ieee802154/atusb.h
 
-AUDIENT EVO MIXER DRIVER
+AUDIENT MIXER DRIVER
 M:	Christian Ruppert <arc@gmx.li>
+M:	Will Porter <mrwillporter@gmail.com>
 L:	linux-sound@vger.kernel.org
 S:	Maintained
-F:	sound/usb/mixer_evo.c
-F:	sound/usb/mixer_evo.h
+F:	sound/usb/mixer_audient.c
+F:	sound/usb/mixer_audient.h
 
 AUDIT SUBSYSTEM
 M:	Paul Moore <paul@paul-moore.com>
diff --git a/sound/usb/Makefile b/sound/usb/Makefile
index 2e842dcc73de1..44f4e4c820fb3 100644
--- a/sound/usb/Makefile
+++ b/sound/usb/Makefile
@@ -11,7 +11,7 @@ snd-usb-audio-y := 	card.o \
 			helper.o \
 			implicit.o \
 			mixer.o \
-			mixer_evo.o \
+			mixer_audient.o \
 			mixer_quirks.o \
 			mixer_scarlett.o \
 			mixer_scarlett2.o \
diff --git a/sound/usb/mixer_evo.c b/sound/usb/mixer_audient.c
similarity index 54%
rename from sound/usb/mixer_evo.c
rename to sound/usb/mixer_audient.c
index c1e0332232f2d..e2700b08cf803 100644
--- a/sound/usb/mixer_evo.c
+++ b/sound/usb/mixer_audient.c
@@ -1,9 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Audient EVO driver for ALSA
+ * Audient driver for ALSA
  * Copyright (C) 2026 Christian Ruppert <arc@gmx.li>
  *
- * Based on the work of Ivan Hazucha for audient-evo-py.
+ * EVO4 support is based on the work of Ivan Hazucha for audient-evo-py.
  * https://github.com/vanzaho/audient-evo-py/
  */
 
@@ -20,22 +20,22 @@
 #include "mixer.h"
 #include "mixer_quirks.h"
 #include "helper.h"
-#include "mixer_evo.h"
+#include "mixer_audient.h"
 
 
-enum snd_evo_type {
-	SND_EVO_TYPE_MONITOR = 0,
-	SND_EVO_TYPE_PHANTOM,
-	SND_EVO_TYPE_MUTE,
-	SND_EVO_TYPE_MUTE_OUT,
-	SND_EVO_TYPE_MIXER,
-	SND_EVO_TYPE_NCTYPES
+enum snd_audient_type {
+	SND_AUDIENT_TYPE_MONITOR = 0,
+	SND_AUDIENT_TYPE_PHANTOM,
+	SND_AUDIENT_TYPE_MUTE,
+	SND_AUDIENT_TYPE_MUTE_OUT,
+	SND_AUDIENT_TYPE_MIXER,
+	SND_AUDIENT_TYPE_NCTYPES
 };
 
 /* Mixer matrix: -128dB (mute) to +6dB */
-static const DECLARE_TLV_DB_MINMAX_MUTE(snd_evo_tlv_mixer, -12800, 600);
+static const DECLARE_TLV_DB_MINMAX_MUTE(snd_audient_tlv_mixer, -12800, 600);
 
-static const struct snd_evo_ctrl_type {
+static const struct snd_audient_ctrl_type {
 	snd_ctl_elem_type_t type;
 	bool invert;
 	union {
@@ -47,8 +47,8 @@ static const struct snd_evo_ctrl_type {
 	const unsigned int *tlv;
 	u16 wValue;
 	u16 wIndex;
-} snd_evo_ctypes[SND_EVO_TYPE_NCTYPES] = {
-	[SND_EVO_TYPE_MONITOR] = {
+} snd_audient_ctypes[SND_AUDIENT_TYPE_NCTYPES] = {
+	[SND_AUDIENT_TYPE_MONITOR] = {
 		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,
 		.min.integer = 0,
 		.max.integer = 127,
@@ -56,7 +56,7 @@ static const struct snd_evo_ctrl_type {
 		.wIndex = 0x3800,
 		/* no TLV here because we can't describe the cross-fader */
 	},
-	[SND_EVO_TYPE_PHANTOM] = {
+	[SND_AUDIENT_TYPE_PHANTOM] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = false,
 		.min.integer = 0,
@@ -64,7 +64,7 @@ static const struct snd_evo_ctrl_type {
 		.wValue = 0x0000,
 		.wIndex = 0x3A00,
 	},
-	[SND_EVO_TYPE_MUTE] = {
+	[SND_AUDIENT_TYPE_MUTE] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = true,
 		.min.integer = 0,
@@ -72,7 +72,7 @@ static const struct snd_evo_ctrl_type {
 		.wValue = 0x0200,
 		.wIndex = 0x3A00,
 	},
-	[SND_EVO_TYPE_MUTE_OUT] = {
+	[SND_AUDIENT_TYPE_MUTE_OUT] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = true,
 		.min.integer = 0,
@@ -80,135 +80,135 @@ static const struct snd_evo_ctrl_type {
 		.wValue = 0x0100,
 		.wIndex = 0x3B00,
 	},
-	[SND_EVO_TYPE_MIXER] = {
+	[SND_AUDIENT_TYPE_MIXER] = {
 		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,
 		.min.integer = -128 * 256,
 		.max.integer = 6 * 256,
 		.wValue = 0x0100,
 		.wIndex = 0x3C00,
-		.tlv = snd_evo_tlv_mixer,
+		.tlv = snd_audient_tlv_mixer,
 	},
 };
 
-#define SND_EVO_FLAGS_DIRECTION (1L<<0)
-#define SND_EVO_FLAGS_CAPTURE (1L<<0)
-#define SND_EVO_FLAGS_PLAYBACK (0L<<0)
+#define SND_AUDIENT_FLAGS_DIRECTION (1L<<0)
+#define SND_AUDIENT_FLAGS_CAPTURE (1L<<0)
+#define SND_AUDIENT_FLAGS_PLAYBACK (0L<<0)
 
-struct snd_evo_ctrl {
+struct snd_audient_ctrl {
 	char *basename;
-	enum snd_evo_type type;
+	enum snd_audient_type type;
 	unsigned int channels;
 	unsigned int hwchannels;
 	unsigned int val_offs;
 	unsigned long flags;
 };
 
-static const struct snd_evo_ctrl evo4_controls[] = {
+static const struct snd_audient_ctrl snd_audient_evo4_controls[] = {
 	{
 		.basename = "Master",
-		.type = SND_EVO_TYPE_MUTE_OUT,
+		.type = SND_AUDIENT_TYPE_MUTE_OUT,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 0,
-		.flags = SND_EVO_FLAGS_PLAYBACK,
+		.flags = SND_AUDIENT_FLAGS_PLAYBACK,
 	},
 	{
 		.basename = "Mic",
-		.type = SND_EVO_TYPE_MUTE,
+		.type = SND_AUDIENT_TYPE_MUTE,
 		.channels = 4,
 		.hwchannels = 2,
 		.val_offs = 0,
-		.flags = SND_EVO_FLAGS_PLAYBACK,
+		.flags = SND_AUDIENT_FLAGS_PLAYBACK,
 	},
 	{
 		.basename = "Monitor",
-		.type = SND_EVO_TYPE_MONITOR,
+		.type = SND_AUDIENT_TYPE_MONITOR,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 0,
-		.flags = SND_EVO_FLAGS_PLAYBACK,
+		.flags = SND_AUDIENT_FLAGS_PLAYBACK,
 	},
 	{
 		.basename = "Mic 1",
-		.type = SND_EVO_TYPE_MIXER,
+		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 0,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
 		.basename = "Mic 2",
-		.type = SND_EVO_TYPE_MIXER,
+		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 2,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
 		.basename = "Master Left",
-		.type = SND_EVO_TYPE_MIXER,
+		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 4,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
 		.basename = "Master Right",
-		.type = SND_EVO_TYPE_MIXER,
+		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 6,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
 		.basename = "Loopback Left",
-		.type = SND_EVO_TYPE_MIXER,
+		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 8,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
 		.basename = "Loopback Right",
-		.type = SND_EVO_TYPE_MIXER,
+		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 10,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
 		.basename = "Mic 1 Phantom",
-		.type = SND_EVO_TYPE_PHANTOM,
+		.type = SND_AUDIENT_TYPE_PHANTOM,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 0,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
 		.basename = "Mic 2 Phantom",
-		.type = SND_EVO_TYPE_PHANTOM,
+		.type = SND_AUDIENT_TYPE_PHANTOM,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 1,
-		.flags = SND_EVO_FLAGS_CAPTURE,
+		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{ 0 }, /* sentinel */
 };
 
-static const struct evo_devinfo {
+static const struct audient_devinfo {
 	u32 usb_id;
-	const struct snd_evo_ctrl *controls;
-} evo_devinfo[] = {
+	const struct snd_audient_ctrl *controls;
+} audient_devinfo[] = {
 	{
 		.usb_id = USB_ID(USB_AUDIENT_VID, USB_EVO4_PID),
-		.controls = evo4_controls,
+		.controls = snd_audient_evo4_controls,
 	},
 	{ 0 } /* sentinel */
 };
 
 
-static inline unsigned long snd_evo_kctl_priv(enum snd_evo_type type,
-					      u8 valoffs, u8 hwchannels)
+static inline unsigned long snd_audient_kctl_priv(enum snd_audient_type type,
+						  u8 valoffs, u8 hwchannels)
 {
 	unsigned long type_l = type & 0xFF;
 	unsigned long valoffs_l = valoffs & 0xFF;
@@ -218,22 +218,24 @@ static inline unsigned long snd_evo_kctl_priv(enum snd_evo_type type,
 }
 
 static __always_inline
-const struct snd_evo_ctrl_type *snd_evo_kctl_type(struct snd_kcontrol *kctl)
+const struct snd_audient_ctrl_type *snd_audient_kctl_type(struct snd_kcontrol
+							  *kctl)
 {
-	return &snd_evo_ctypes[kctl->private_value & 0xFF];
+	return &snd_audient_ctypes[kctl->private_value & 0xFF];
 }
 
-static __always_inline u16 snd_evo_kctl_valoffs(struct snd_kcontrol *kctl)
+static __always_inline u16 snd_audient_kctl_valoffs(struct snd_kcontrol *kctl)
 {
 	return (kctl->private_value >> 8) & 0xFF;
 }
 
-static __always_inline u16 snd_evo_kctl_hwchannels(struct snd_kcontrol *kctl)
+static __always_inline
+u16 snd_audient_kctl_hwchannels(struct snd_kcontrol *kctl)
 {
 	return (kctl->private_value >> 16) & 0xFF;
 }
 
-static inline u16 snd_evo_kctl_channels(struct snd_kcontrol *kctl)
+static inline u16 snd_audient_kctl_channels(struct snd_kcontrol *kctl)
 {
 	struct usb_mixer_elem_info *info = kctl->private_data;
 
@@ -241,43 +243,45 @@ static inline u16 snd_evo_kctl_channels(struct snd_kcontrol *kctl)
 }
 
 
-#define EVO_REQ_CUR (0x01)
-#define EVO_REQTYPE_SET (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE)
-#define EVO_REQTYPE_GET (USB_DIR_IN  | USB_TYPE_CLASS | USB_RECIP_INTERFACE)
+#define AUDIENT_REQTYPE_SET (USB_DIR_OUT | USB_TYPE_CLASS \
+					 | USB_RECIP_INTERFACE)
+#define AUDIENT_REQTYPE_GET (USB_DIR_IN  | USB_TYPE_CLASS \
+					 | USB_RECIP_INTERFACE)
 
-static inline int snd_evo_get_cur(struct usb_mixer_interface *mixer,
-				  u16 value, u16 index,
-				  void *buf, size_t len)
+static inline int snd_audient_get_cur(struct usb_mixer_interface *mixer,
+				      u16 value, u16 index,
+				      void *buf, size_t len)
 {
 	struct usb_device *const dev = mixer->chip->dev;
 
 	return snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
-			       EVO_REQ_CUR, EVO_REQTYPE_GET,
+			       UAC2_CS_CUR, AUDIENT_REQTYPE_GET,
 			       value, index, buf, len);
 }
 
-static inline int snd_evo_set_cur(struct usb_mixer_interface *mixer,
-				  u16 value, u16 index,
-				  void *buf, size_t len)
+static inline int snd_audient_set_cur(struct usb_mixer_interface *mixer,
+				      u16 value, u16 index,
+				      void *buf, size_t len)
 {
 	struct usb_device *const dev = mixer->chip->dev;
 
 	return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
-			       EVO_REQ_CUR, EVO_REQTYPE_SET,
+			       UAC2_CS_CUR, AUDIENT_REQTYPE_SET,
 			       value, index, buf, len);
 }
 
 
-static int snd_ctl_evo_boolean_get(struct snd_kcontrol *kctl,
-				   struct snd_ctl_elem_value *ctl_val)
+static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
+				       struct snd_ctl_elem_value *ctl_val)
 {
 	struct usb_mixer_elem_list *const list = snd_kcontrol_chip(kctl);
 	struct usb_mixer_interface *const mixer = list->mixer;
 
-	const unsigned int nchan = snd_evo_kctl_channels(kctl);
-	const unsigned int hwchan = snd_evo_kctl_hwchannels(kctl);
-	const struct snd_evo_ctrl_type *const ctype = snd_evo_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_evo_kctl_valoffs(kctl);
+	const unsigned int nchan = snd_audient_kctl_channels(kctl);
+	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
+	const struct snd_audient_ctrl_type *const ctype
+						= snd_audient_kctl_type(kctl);
+	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
 	const u16 index = ctype->wIndex;
 
 	int i;
@@ -290,8 +294,8 @@ static int snd_ctl_evo_boolean_get(struct snd_kcontrol *kctl,
 		u32 buf;
 		int ret;
 
-		ret = snd_evo_get_cur(mixer, value + i, index,
-				      &buf, sizeof(buf));
+		ret = snd_audient_get_cur(mixer, value + i, index,
+					  &buf, sizeof(buf));
 		if (ret < 0)
 			return ret;
 
@@ -309,15 +313,16 @@ static int snd_ctl_evo_boolean_get(struct snd_kcontrol *kctl,
 	return 0;
 }
 
-static int snd_ctl_evo_boolean_set(struct snd_kcontrol *kctl,
-				   struct snd_ctl_elem_value *ctl_val)
+static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
+				       struct snd_ctl_elem_value *ctl_val)
 {
 	struct usb_mixer_elem_list *list = snd_kcontrol_chip(kctl);
 	struct usb_mixer_interface *mixer = list->mixer;
 
-	const unsigned int hwchan = snd_evo_kctl_hwchannels(kctl);
-	const struct snd_evo_ctrl_type *const ctype = snd_evo_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_evo_kctl_valoffs(kctl);
+	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
+	const struct snd_audient_ctrl_type *const ctype
+						= snd_audient_kctl_type(kctl);
+	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
 	const u16 index = ctype->wIndex;
 
 	int changed = 0;
@@ -335,7 +340,7 @@ static int snd_ctl_evo_boolean_set(struct snd_kcontrol *kctl,
 		if (ctype->invert)
 			buf ^= cpu_to_le32(0x1);
 
-		ret = snd_evo_get_cur(mixer, value + i, index,
+		ret = snd_audient_get_cur(mixer, value + i, index,
 				      &rbuf, sizeof(rbuf));
 		if (ret < 0)
 			return ret;
@@ -343,8 +348,8 @@ static int snd_ctl_evo_boolean_set(struct snd_kcontrol *kctl,
 		if (rbuf != buf) {
 			changed = 1;
 
-			ret = snd_evo_set_cur(mixer, value + i, index,
-					      &buf, sizeof(buf));
+			ret = snd_audient_set_cur(mixer, value + i, index,
+						  &buf, sizeof(buf));
 			if (ret < 0)
 				return ret;
 		}
@@ -353,16 +358,17 @@ static int snd_ctl_evo_boolean_set(struct snd_kcontrol *kctl,
 	return changed;
 }
 
-static int snd_ctl_evo_integer_get(struct snd_kcontrol *kctl,
+static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 				   struct snd_ctl_elem_value *ctl_val)
 {
 	struct usb_mixer_elem_list *const list = snd_kcontrol_chip(kctl);
 	struct usb_mixer_interface *const mixer = list->mixer;
 
-	const unsigned int nchan = snd_evo_kctl_channels(kctl);
-	const unsigned int hwchan = snd_evo_kctl_hwchannels(kctl);
-	const struct snd_evo_ctrl_type *const ctype = snd_evo_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_evo_kctl_valoffs(kctl);
+	const unsigned int nchan = snd_audient_kctl_channels(kctl);
+	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
+	const struct snd_audient_ctrl_type *const ctype
+						= snd_audient_kctl_type(kctl);
+	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
 	const u16 index = ctype->wIndex;
 
 	int i;
@@ -376,8 +382,8 @@ static int snd_ctl_evo_integer_get(struct snd_kcontrol *kctl,
 		s16 val;
 		int ret;
 
-		ret = snd_evo_get_cur(mixer, value + i, index,
-				      &buf, sizeof(buf));
+		ret = snd_audient_get_cur(mixer, value + i, index,
+					  &buf, sizeof(buf));
 		if (ret < 0)
 			return ret;
 
@@ -391,15 +397,16 @@ static int snd_ctl_evo_integer_get(struct snd_kcontrol *kctl,
 	return 0;
 }
 
-static int snd_ctl_evo_integer_set(struct snd_kcontrol *kctl,
+static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 				   struct snd_ctl_elem_value *ctl_val)
 {
 	struct usb_mixer_elem_list *list = snd_kcontrol_chip(kctl);
 	struct usb_mixer_interface *mixer = list->mixer;
 
-	const unsigned int hwchan = snd_evo_kctl_hwchannels(kctl);
-	const struct snd_evo_ctrl_type *const ctype = snd_evo_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_evo_kctl_valoffs(kctl);
+	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
+	const struct snd_audient_ctrl_type *const ctype
+						= snd_audient_kctl_type(kctl);
+	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
 	const u16 index = ctype->wIndex;
 
 	int changed = 0;
@@ -414,16 +421,16 @@ static int snd_ctl_evo_integer_set(struct snd_kcontrol *kctl,
 		s16 buf = cpu_to_le16(ctl_val->value.integer.value[i]);
 		int ret;
 
-		ret = snd_evo_get_cur(mixer, value + i, index,
-				      &rbuf, sizeof(rbuf));
+		ret = snd_audient_get_cur(mixer, value + i, index,
+					  &rbuf, sizeof(rbuf));
 		if (ret < 0)
 			return ret;
 
 		if (rbuf != buf) {
 			changed = 1;
 
-			ret = snd_evo_set_cur(mixer, value + i, index,
-					      &buf, sizeof(buf));
+			ret = snd_audient_set_cur(mixer, value + i, index,
+						  &buf, sizeof(buf));
 			if (ret < 0)
 				return ret;
 		}
@@ -432,23 +439,25 @@ static int snd_ctl_evo_integer_set(struct snd_kcontrol *kctl,
 	return changed;
 }
 
-static int snd_ctl_evo_info(struct snd_kcontrol *kctl,
+static int snd_ctl_audient_info(struct snd_kcontrol *kctl,
 			    struct snd_ctl_elem_info *uinfo)
 {
-	const struct snd_evo_ctrl_type *const ctype = snd_evo_kctl_type(kctl);
+	const struct snd_audient_ctrl_type *const ctype
+						= snd_audient_kctl_type(kctl);
 
 	uinfo->type = ctype->type;
-	uinfo->count = snd_evo_kctl_channels(kctl);
+	uinfo->count = snd_audient_kctl_channels(kctl);
 	uinfo->value.integer.min = ctype->min.integer;
 	uinfo->value.integer.max = ctype->max.integer;
 	return 0;
 }
 
 
-static int snd_evo_add_ctrl(struct usb_mixer_interface *mixer,
-			    const struct snd_evo_ctrl *ctrl)
+static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
+			    const struct snd_audient_ctrl *ctrl)
 {
-	const struct snd_evo_ctrl_type *ctype = &snd_evo_ctypes[ctrl->type];
+	const struct snd_audient_ctrl_type *ctype
+					= &snd_audient_ctypes[ctrl->type];
 	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
 	struct snd_kcontrol_new knew = { 0 };
 	struct snd_kcontrol *kctl;
@@ -456,9 +465,9 @@ static int snd_evo_add_ctrl(struct usb_mixer_interface *mixer,
 
 	knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
 	knew.name = name;
-	knew.info = snd_ctl_evo_info;
-	knew.private_value = snd_evo_kctl_priv(ctrl->type, ctrl->val_offs,
-					       ctrl->hwchannels);
+	knew.info = snd_ctl_audient_info;
+	knew.private_value = snd_audient_kctl_priv(ctrl->type, ctrl->val_offs,
+						   ctrl->hwchannels);
 	knew.tlv.p = ctype->tlv;
 	knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE
 			| SNDRV_CTL_ELEM_ACCESS_VOLATILE
@@ -466,20 +475,20 @@ static int snd_evo_add_ctrl(struct usb_mixer_interface *mixer,
 
 	switch (ctype->type) {
 	case SNDRV_CTL_ELEM_TYPE_INTEGER:
-		knew.get = snd_ctl_evo_integer_get;
-		knew.put = snd_ctl_evo_integer_set;
+		knew.get = snd_ctl_audient_integer_get;
+		knew.put = snd_ctl_audient_integer_set;
 		break;
 	case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
-		knew.get = snd_ctl_evo_boolean_get;
-		knew.put = snd_ctl_evo_boolean_set;
+		knew.get = snd_ctl_audient_boolean_get;
+		knew.put = snd_ctl_audient_boolean_set;
 		break;
 	default:
 		return -EINVAL;
 	}
 
 	snprintf(name, sizeof(name), "%s %s %s", ctrl->basename,
-		 ((ctrl->flags & SND_EVO_FLAGS_DIRECTION)
-			== SND_EVO_FLAGS_CAPTURE) ? "Capture" : "Playback",
+		 ((ctrl->flags & SND_AUDIENT_FLAGS_DIRECTION)
+			== SND_AUDIENT_FLAGS_CAPTURE) ? "Capture" : "Playback",
 		 (ctype->type == SNDRV_CTL_ELEM_TYPE_BOOLEAN)
 			? "Switch" : "Volume");
 
@@ -503,12 +512,12 @@ static int snd_evo_add_ctrl(struct usb_mixer_interface *mixer,
 
 
 /* called from mixer_quirks.c */
-int snd_evo_controls_create(struct usb_mixer_interface *mixer)
+int snd_audient_controls_create(struct usb_mixer_interface *mixer)
 {
-	const struct evo_devinfo *info;
-	const struct snd_evo_ctrl *ctrl;
+	const struct audient_devinfo *info;
+	const struct snd_audient_ctrl *ctrl;
 
-	for (info = evo_devinfo; info->controls; info++)
+	for (info = audient_devinfo; info->controls; info++)
 		if (info->usb_id == mixer->chip->usb_id)
 			break;
 
@@ -516,7 +525,7 @@ int snd_evo_controls_create(struct usb_mixer_interface *mixer)
 		return -ENODEV;
 
 	for (ctrl = info->controls; ctrl->basename; ctrl++) {
-		const int ret = snd_evo_add_ctrl(mixer, ctrl);
+		const int ret = snd_audient_add_ctrl(mixer, ctrl);
 
 		if (ret < 0)
 			return ret;
diff --git a/sound/usb/mixer_audient.h b/sound/usb/mixer_audient.h
new file mode 100644
index 0000000000000..db4f31e02b5e1
--- /dev/null
+++ b/sound/usb/mixer_audient.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __USB_MIXER_AUDIENT_H
+#define __USB_MIXER_AUDIENT_H
+
+#include "mixer.h"
+
+#define USB_AUDIENT_VID (0x2708)
+#define USB_EVO4_PID (0x0006)
+
+int snd_audient_controls_create(struct usb_mixer_interface *mixer);
+
+#endif /* __USB_MIXER_AUDIENT_H */
diff --git a/sound/usb/mixer_evo.h b/sound/usb/mixer_evo.h
deleted file mode 100644
index 7fe7e197185cf..0000000000000
--- a/sound/usb/mixer_evo.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __USB_MIXER_EVO_H
-#define __USB_MIXER_EVO_H
-
-#include "mixer.h"
-
-#define USB_AUDIENT_VID (0x2708)
-#define USB_EVO4_PID (0x0006)
-
-int snd_evo_controls_create(struct usb_mixer_interface *mixer);
-
-#endif /* __USB_MIXER_EVO_H */
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 4c7d68311f204..c250ebea5af51 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -39,7 +39,7 @@
 #include "mixer_scarlett2.h"
 #include "mixer_us16x08.h"
 #include "mixer_s1810c.h"
-#include "mixer_evo.h"
+#include "mixer_audient.h"
 #include "helper.h"
 #include "fcp.h"
 
@@ -4781,7 +4781,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
 		break;
 
 	case USB_ID(USB_AUDIENT_VID, USB_EVO4_PID): /* Audient EVO 4 */
-		err = snd_evo_controls_create(mixer);
+		err = snd_audient_controls_create(mixer);
 		break;
 
 	case USB_ID(0x041e, 0x323b): /* Creative Sound Blaster E1 */
-- 
2.47.3


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

* [PATCH v2 06/21] ALSA: mixer_audient: explicitly define full control names
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (4 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 05/21] ALSA: rename mixer_evo to mixer_audient Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 07/21] ALSA: mixer_audient: clarify USB control message definition Will Porter
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Previously, control names were dynamically created depending if the
control was an input or an output, a volume or a switch. Get rid of this
logic by simply defining the full name in the control structure.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 50 +++++++++++----------------------------
 1 file changed, 14 insertions(+), 36 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index e2700b08cf803..2afef52a12d9a 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -90,107 +90,92 @@ static const struct snd_audient_ctrl_type {
 	},
 };
 
-#define SND_AUDIENT_FLAGS_DIRECTION (1L<<0)
-#define SND_AUDIENT_FLAGS_CAPTURE (1L<<0)
-#define SND_AUDIENT_FLAGS_PLAYBACK (0L<<0)
 
 struct snd_audient_ctrl {
-	char *basename;
+	char *name;
 	enum snd_audient_type type;
 	unsigned int channels;
 	unsigned int hwchannels;
 	unsigned int val_offs;
-	unsigned long flags;
 };
 
 static const struct snd_audient_ctrl snd_audient_evo4_controls[] = {
 	{
-		.basename = "Master",
+		.name = "Master Playback Switch",
 		.type = SND_AUDIENT_TYPE_MUTE_OUT,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 0,
-		.flags = SND_AUDIENT_FLAGS_PLAYBACK,
 	},
 	{
-		.basename = "Mic",
+		.name = "Mic Playback Switch",
 		.type = SND_AUDIENT_TYPE_MUTE,
 		.channels = 4,
 		.hwchannels = 2,
 		.val_offs = 0,
-		.flags = SND_AUDIENT_FLAGS_PLAYBACK,
 	},
 	{
-		.basename = "Monitor",
+		.name = "Monitor Playback Volume",
 		.type = SND_AUDIENT_TYPE_MONITOR,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 0,
-		.flags = SND_AUDIENT_FLAGS_PLAYBACK,
 	},
 	{
-		.basename = "Mic 1",
+		.name = "Mic 1 Capture Volume",
 		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 0,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
-		.basename = "Mic 2",
+		.name = "Mic 2 Capture Volume",
 		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 2,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
-		.basename = "Master Left",
+		.name = "Master Left Capture Volume",
 		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 4,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
-		.basename = "Master Right",
+		.name = "Master Right Capture Volume",
 		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 6,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
-		.basename = "Loopback Left",
+		.name = "Loopback Left Capture Volume",
 		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 8,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
-		.basename = "Loopback Right",
+		.name = "Loopback Right Capture Volume",
 		.type = SND_AUDIENT_TYPE_MIXER,
 		.channels = 2,
 		.hwchannels = 2,
 		.val_offs = 10,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
-		.basename = "Mic 1 Phantom",
+		.name = "Mic 1 Phantom Capture Switch",
 		.type = SND_AUDIENT_TYPE_PHANTOM,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 0,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{
-		.basename = "Mic 2 Phantom",
+		.name = "Mic 2 Phantom Capture Switch",
 		.type = SND_AUDIENT_TYPE_PHANTOM,
 		.channels = 1,
 		.hwchannels = 1,
 		.val_offs = 1,
-		.flags = SND_AUDIENT_FLAGS_CAPTURE,
 	},
 	{ 0 }, /* sentinel */
 };
@@ -458,13 +443,12 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 {
 	const struct snd_audient_ctrl_type *ctype
 					= &snd_audient_ctypes[ctrl->type];
-	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
 	struct snd_kcontrol_new knew = { 0 };
 	struct snd_kcontrol *kctl;
 	struct usb_mixer_elem_info *elem;
 
 	knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
-	knew.name = name;
+	knew.name = ctrl->name;
 	knew.info = snd_ctl_audient_info;
 	knew.private_value = snd_audient_kctl_priv(ctrl->type, ctrl->val_offs,
 						   ctrl->hwchannels);
@@ -486,12 +470,6 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 		return -EINVAL;
 	}
 
-	snprintf(name, sizeof(name), "%s %s %s", ctrl->basename,
-		 ((ctrl->flags & SND_AUDIENT_FLAGS_DIRECTION)
-			== SND_AUDIENT_FLAGS_CAPTURE) ? "Capture" : "Playback",
-		 (ctype->type == SNDRV_CTL_ELEM_TYPE_BOOLEAN)
-			? "Switch" : "Volume");
-
 	elem = kzalloc_obj(*elem);
 	if (!elem)
 		return -ENOMEM;
@@ -524,7 +502,7 @@ int snd_audient_controls_create(struct usb_mixer_interface *mixer)
 	if (!info->controls)
 		return -ENODEV;
 
-	for (ctrl = info->controls; ctrl->basename; ctrl++) {
+	for (ctrl = info->controls; ctrl->name; ctrl++) {
 		const int ret = snd_audient_add_ctrl(mixer, ctrl);
 
 		if (ret < 0)
-- 
2.47.3


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

* [PATCH v2 07/21] ALSA: mixer_audient: clarify USB control message definition
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (5 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 06/21] ALSA: mixer_audient: explicitly define full control names Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 08/21] ALSA: mixer_audient: Add length check to USB transfer Will Porter
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Previously, base values for wIndex and wValue were directly given in the
control type. Construct them from a unit ID and selector for clarity.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 76 +++++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 35 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 2afef52a12d9a..63714d00592c7 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -45,15 +45,15 @@ static const struct snd_audient_ctrl_type {
 		int integer;
 	} max;
 	const unsigned int *tlv;
-	u16 wValue;
-	u16 wIndex;
+	u8 unit;
+	u8 sel;
 } snd_audient_ctypes[SND_AUDIENT_TYPE_NCTYPES] = {
 	[SND_AUDIENT_TYPE_MONITOR] = {
 		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,
 		.min.integer = 0,
 		.max.integer = 127,
-		.wValue = 0x0000,
-		.wIndex = 0x3800,
+		.unit = 0x38,
+		.sel = 0x00,
 		/* no TLV here because we can't describe the cross-fader */
 	},
 	[SND_AUDIENT_TYPE_PHANTOM] = {
@@ -61,31 +61,31 @@ static const struct snd_audient_ctrl_type {
 		.invert = false,
 		.min.integer = 0,
 		.max.integer = 1,
-		.wValue = 0x0000,
-		.wIndex = 0x3A00,
+		.unit = 0x3A,
+		.sel = 0x00,
 	},
 	[SND_AUDIENT_TYPE_MUTE] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = true,
 		.min.integer = 0,
 		.max.integer = 1,
-		.wValue = 0x0200,
-		.wIndex = 0x3A00,
+		.unit = 0x3A,
+		.sel = 0x02,
 	},
 	[SND_AUDIENT_TYPE_MUTE_OUT] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = true,
 		.min.integer = 0,
 		.max.integer = 1,
-		.wValue = 0x0100,
-		.wIndex = 0x3B00,
+		.unit = 0x3B,
+		.sel = 0x01,
 	},
 	[SND_AUDIENT_TYPE_MIXER] = {
 		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,
 		.min.integer = -128 * 256,
 		.max.integer = 6 * 256,
-		.wValue = 0x0100,
-		.wIndex = 0x3C00,
+		.unit = 0x3C,
+		.sel = 0x01,
 		.tlv = snd_audient_tlv_mixer,
 	},
 };
@@ -209,7 +209,7 @@ const struct snd_audient_ctrl_type *snd_audient_kctl_type(struct snd_kcontrol
 	return &snd_audient_ctypes[kctl->private_value & 0xFF];
 }
 
-static __always_inline u16 snd_audient_kctl_valoffs(struct snd_kcontrol *kctl)
+static __always_inline u16 snd_audient_kctl_cidxoffs(struct snd_kcontrol *kctl)
 {
 	return (kctl->private_value >> 8) & 0xFF;
 }
@@ -233,11 +233,16 @@ static inline u16 snd_audient_kctl_channels(struct snd_kcontrol *kctl)
 #define AUDIENT_REQTYPE_GET (USB_DIR_IN  | USB_TYPE_CLASS \
 					 | USB_RECIP_INTERFACE)
 
+#define U8_U8(HI, LO) ((((u16)(HI)) << 8) | ((LO) & 0xFF))
+
 static inline int snd_audient_get_cur(struct usb_mixer_interface *mixer,
-				      u16 value, u16 index,
-				      void *buf, size_t len)
+				      const u8 unit, const u8 sel,
+				      const u8 cidx,
+				      void *const buf, const size_t len)
 {
 	struct usb_device *const dev = mixer->chip->dev;
+	const u16 value = U8_U8(sel, cidx);
+	const u16 index = U8_U8(unit, mixer->hostif->desc.bInterfaceNumber);
 
 	return snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
 			       UAC2_CS_CUR, AUDIENT_REQTYPE_GET,
@@ -245,10 +250,13 @@ static inline int snd_audient_get_cur(struct usb_mixer_interface *mixer,
 }
 
 static inline int snd_audient_set_cur(struct usb_mixer_interface *mixer,
-				      u16 value, u16 index,
-				      void *buf, size_t len)
+				      const u8 unit, const u8 sel,
+				      const u8 cidx,
+				      void *const buf, const size_t len)
 {
 	struct usb_device *const dev = mixer->chip->dev;
+	const u16 value = U8_U8(sel, cidx);
+	const u16 index = U8_U8(unit, mixer->hostif->desc.bInterfaceNumber);
 
 	return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
 			       UAC2_CS_CUR, AUDIENT_REQTYPE_SET,
@@ -266,8 +274,7 @@ static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
 	const struct snd_audient_ctrl_type *const ctype
 						= snd_audient_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
-	const u16 index = ctype->wIndex;
+	const u8 base = snd_audient_kctl_cidxoffs(kctl);
 
 	int i;
 
@@ -279,8 +286,8 @@ static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 		u32 buf;
 		int ret;
 
-		ret = snd_audient_get_cur(mixer, value + i, index,
-					  &buf, sizeof(buf));
+		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
+					  base + i, &buf, sizeof(buf));
 		if (ret < 0)
 			return ret;
 
@@ -307,8 +314,7 @@ static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
 	const struct snd_audient_ctrl_type *const ctype
 						= snd_audient_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
-	const u16 index = ctype->wIndex;
+	const u8 base = snd_audient_kctl_cidxoffs(kctl);
 
 	int changed = 0;
 	int i;
@@ -325,15 +331,16 @@ static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 		if (ctype->invert)
 			buf ^= cpu_to_le32(0x1);
 
-		ret = snd_audient_get_cur(mixer, value + i, index,
-				      &rbuf, sizeof(rbuf));
+		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
+					  base + i, &rbuf, sizeof(rbuf));
 		if (ret < 0)
 			return ret;
 
 		if (rbuf != buf) {
 			changed = 1;
 
-			ret = snd_audient_set_cur(mixer, value + i, index,
+			ret = snd_audient_set_cur(mixer, ctype->unit,
+						  ctype->sel, base + i,
 						  &buf, sizeof(buf));
 			if (ret < 0)
 				return ret;
@@ -353,8 +360,7 @@ static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
 	const struct snd_audient_ctrl_type *const ctype
 						= snd_audient_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
-	const u16 index = ctype->wIndex;
+	const u8 base = snd_audient_kctl_cidxoffs(kctl);
 
 	int i;
 
@@ -367,8 +373,8 @@ static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 		s16 val;
 		int ret;
 
-		ret = snd_audient_get_cur(mixer, value + i, index,
-					  &buf, sizeof(buf));
+		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
+					  base + i, &buf, sizeof(buf));
 		if (ret < 0)
 			return ret;
 
@@ -391,8 +397,7 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
 	const struct snd_audient_ctrl_type *const ctype
 						= snd_audient_kctl_type(kctl);
-	const u16 value = ctype->wValue + snd_audient_kctl_valoffs(kctl);
-	const u16 index = ctype->wIndex;
+	const u8 base = snd_audient_kctl_cidxoffs(kctl);
 
 	int changed = 0;
 	int i;
@@ -406,15 +411,16 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 		s16 buf = cpu_to_le16(ctl_val->value.integer.value[i]);
 		int ret;
 
-		ret = snd_audient_get_cur(mixer, value + i, index,
-					  &rbuf, sizeof(rbuf));
+		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
+					  base + i, &rbuf, sizeof(rbuf));
 		if (ret < 0)
 			return ret;
 
 		if (rbuf != buf) {
 			changed = 1;
 
-			ret = snd_audient_set_cur(mixer, value + i, index,
+			ret = snd_audient_set_cur(mixer, ctype->unit,
+						  ctype->sel, base + i,
 						  &buf, sizeof(buf));
 			if (ret < 0)
 				return ret;
-- 
2.47.3


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

* [PATCH v2 08/21] ALSA: mixer_audient: Add length check to USB transfer
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (6 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 07/21] ALSA: mixer_audient: clarify USB control message definition Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 09/21] ALSA: mixer_audient: make USB control transfer size configurable Will Porter
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Check USB control transfers not only for errors but also for expected
length and return -EIO in case of error.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 63714d00592c7..1f3744a7c10a7 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -244,9 +244,14 @@ static inline int snd_audient_get_cur(struct usb_mixer_interface *mixer,
 	const u16 value = U8_U8(sel, cidx);
 	const u16 index = U8_U8(unit, mixer->hostif->desc.bInterfaceNumber);
 
-	return snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
-			       UAC2_CS_CUR, AUDIENT_REQTYPE_GET,
-			       value, index, buf, len);
+	const int ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
+					UAC2_CS_CUR, AUDIENT_REQTYPE_GET,
+					value, index, buf, len);
+
+	if ((ret >= 0) && (ret != len))
+		return -EIO;
+
+	return ret;
 }
 
 static inline int snd_audient_set_cur(struct usb_mixer_interface *mixer,
@@ -258,9 +263,14 @@ static inline int snd_audient_set_cur(struct usb_mixer_interface *mixer,
 	const u16 value = U8_U8(sel, cidx);
 	const u16 index = U8_U8(unit, mixer->hostif->desc.bInterfaceNumber);
 
-	return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
-			       UAC2_CS_CUR, AUDIENT_REQTYPE_SET,
-			       value, index, buf, len);
+	const int ret = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
+					UAC2_CS_CUR, AUDIENT_REQTYPE_SET,
+					value, index, buf, len);
+
+	if ((ret >= 0) && (ret != len))
+		return -EIO;
+
+	return ret;
 }
 
 
-- 
2.47.3


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

* [PATCH v2 09/21] ALSA: mixer_audient: make USB control transfer size configurable
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (7 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 08/21] ALSA: mixer_audient: Add length check to USB transfer Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 10/21] ALSA: mixer_audient: Allow arbitrary boolean control values Will Porter
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Previously, the USB transfer size was hardcoded in the datatype get/set
functions. Make it configurable in the ctype structure in preparation of
new control types for the id14.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 131 ++++++++++++++++++++++++--------------
 1 file changed, 84 insertions(+), 47 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 1f3744a7c10a7..57d856d252716 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -12,6 +12,8 @@
 #include <linux/usb.h>
 #include <linux/usb/audio-v2.h>
 #include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/bitops.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/tlv.h>
@@ -35,8 +37,12 @@ enum snd_audient_type {
 /* Mixer matrix: -128dB (mute) to +6dB */
 static const DECLARE_TLV_DB_MINMAX_MUTE(snd_audient_tlv_mixer, -12800, 600);
 
+#define SND_AUDIENT_CTYPE_FLAGS_SIGNED		BIT(0)
+
 static const struct snd_audient_ctrl_type {
 	snd_ctl_elem_type_t type;
+	unsigned long flags;
+	size_t len;		/* datatype size, can be 1, 2 or 4 bytes */
 	bool invert;
 	union {
 		int integer;
@@ -50,6 +56,7 @@ static const struct snd_audient_ctrl_type {
 } snd_audient_ctypes[SND_AUDIENT_TYPE_NCTYPES] = {
 	[SND_AUDIENT_TYPE_MONITOR] = {
 		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,
+		.len = 2,
 		.min.integer = 0,
 		.max.integer = 127,
 		.unit = 0x38,
@@ -59,6 +66,7 @@ static const struct snd_audient_ctrl_type {
 	[SND_AUDIENT_TYPE_PHANTOM] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = false,
+		.len = 4,
 		.min.integer = 0,
 		.max.integer = 1,
 		.unit = 0x3A,
@@ -67,6 +75,7 @@ static const struct snd_audient_ctrl_type {
 	[SND_AUDIENT_TYPE_MUTE] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = true,
+		.len = 4,
 		.min.integer = 0,
 		.max.integer = 1,
 		.unit = 0x3A,
@@ -75,6 +84,7 @@ static const struct snd_audient_ctrl_type {
 	[SND_AUDIENT_TYPE_MUTE_OUT] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
 		.invert = true,
+		.len = 4,
 		.min.integer = 0,
 		.max.integer = 1,
 		.unit = 0x3B,
@@ -82,6 +92,8 @@ static const struct snd_audient_ctrl_type {
 	},
 	[SND_AUDIENT_TYPE_MIXER] = {
 		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,
+		.flags = SND_AUDIENT_CTYPE_FLAGS_SIGNED,
+		.len = 2,
 		.min.integer = -128 * 256,
 		.max.integer = 6 * 256,
 		.unit = 0x3C,
@@ -236,44 +248,91 @@ static inline u16 snd_audient_kctl_channels(struct snd_kcontrol *kctl)
 #define U8_U8(HI, LO) ((((u16)(HI)) << 8) | ((LO) & 0xFF))
 
 static inline int snd_audient_get_cur(struct usb_mixer_interface *mixer,
-				      const u8 unit, const u8 sel,
-				      const u8 cidx,
-				      void *const buf, const size_t len)
+			const struct snd_audient_ctrl_type *const ctype,
+			const u8 cidx, void *const buf)
 {
 	struct usb_device *const dev = mixer->chip->dev;
-	const u16 value = U8_U8(sel, cidx);
-	const u16 index = U8_U8(unit, mixer->hostif->desc.bInterfaceNumber);
+	const u16 value = U8_U8(ctype->sel, cidx);
+	const u16 index = U8_U8(ctype->unit,
+				mixer->hostif->desc.bInterfaceNumber);
 
 	const int ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
 					UAC2_CS_CUR, AUDIENT_REQTYPE_GET,
-					value, index, buf, len);
+					value, index, buf, ctype->len);
 
-	if ((ret >= 0) && (ret != len))
+	if ((ret >= 0) && (ret != ctype->len))
 		return -EIO;
 
 	return ret;
 }
 
 static inline int snd_audient_set_cur(struct usb_mixer_interface *mixer,
-				      const u8 unit, const u8 sel,
-				      const u8 cidx,
-				      void *const buf, const size_t len)
+			const struct snd_audient_ctrl_type *const ctype,
+			const u8 cidx, void *const buf)
 {
 	struct usb_device *const dev = mixer->chip->dev;
-	const u16 value = U8_U8(sel, cidx);
-	const u16 index = U8_U8(unit, mixer->hostif->desc.bInterfaceNumber);
+	const u16 value = U8_U8(ctype->sel, cidx);
+	const u16 index = U8_U8(ctype->unit,
+				mixer->hostif->desc.bInterfaceNumber);
 
 	const int ret = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
 					UAC2_CS_CUR, AUDIENT_REQTYPE_SET,
-					value, index, buf, len);
+					value, index, buf, ctype->len);
 
-	if ((ret >= 0) && (ret != len))
+	if ((ret >= 0) && (ret != ctype->len))
 		return -EIO;
 
 	return ret;
 }
 
 
+static int snd_audient_raw_get_one(struct usb_mixer_interface *const mixer,
+			const struct snd_audient_ctrl_type *const ctype,
+			const u8 cidx, u32 *const value)
+{
+	int ret;
+	__le32 buf = 0;
+	s32 val;
+
+	ret = snd_audient_get_cur(mixer, ctype, cidx, &buf);
+	if (ret < 0)
+		return ret;
+
+	val = le32_to_cpu(buf);
+
+	if (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_SIGNED)
+		val = sign_extend32(val, 8 * ctype->len - 1);
+
+	*value = val;
+
+	return ret;
+}
+
+static int snd_audient_raw_set_one(struct usb_mixer_interface *const mixer,
+			const struct snd_audient_ctrl_type *const ctype,
+			const u8 cidx, const u32 value)
+{
+	int ret;
+	u32 val;
+
+	ret = snd_audient_raw_get_one(mixer, ctype, cidx, &val);
+	if (ret < 0)
+		return ret;
+
+	if (val != value) {
+		__le32 buf = cpu_to_le32(value);
+
+		ret = snd_audient_set_cur(mixer, ctype, cidx, &buf);
+		if (ret < 0)
+			return ret;
+
+		return 1;
+	}
+
+	return 0;
+}
+
+
 static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 				       struct snd_ctl_elem_value *ctl_val)
 {
@@ -296,12 +355,11 @@ static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 		u32 buf;
 		int ret;
 
-		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
-					  base + i, &buf, sizeof(buf));
+		ret = snd_audient_raw_get_one(mixer, ctype, base + i, &buf);
 		if (ret < 0)
 			return ret;
 
-		ctl_val->value.integer.value[i] = le32_to_cpu(buf) ? 1 : 0;
+		ctl_val->value.integer.value[i] = buf ? 1 : 0;
 
 		if (ctype->invert)
 			ctl_val->value.integer.value[i] ^= 0x1;
@@ -334,27 +392,18 @@ static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 		return pm.err;
 
 	for (i = 0; i < hwchan; i++) {
-		u32 rbuf;
-		u32 buf = cpu_to_le32(ctl_val->value.integer.value[i] ? 1 : 0);
+		u32 buf = ctl_val->value.integer.value[i] ? 1 : 0;
 		int ret;
 
 		if (ctype->invert)
-			buf ^= cpu_to_le32(0x1);
+			buf ^= 0x1;
 
-		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
-					  base + i, &rbuf, sizeof(rbuf));
+		ret = snd_audient_raw_set_one(mixer, ctype, base + i, buf);
 		if (ret < 0)
 			return ret;
 
-		if (rbuf != buf) {
+		if (ret)
 			changed = 1;
-
-			ret = snd_audient_set_cur(mixer, ctype->unit,
-						  ctype->sel, base + i,
-						  &buf, sizeof(buf));
-			if (ret < 0)
-				return ret;
-		}
 	}
 
 	return changed;
@@ -379,16 +428,13 @@ static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 		return pm.err;
 
 	for (i = 0; i < hwchan; i++) {
-		u16 buf;
-		s16 val;
+		s32 val;
 		int ret;
 
-		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
-					  base + i, &buf, sizeof(buf));
+		ret = snd_audient_raw_get_one(mixer, ctype, base + i, &val);
 		if (ret < 0)
 			return ret;
 
-		val = le16_to_cpu(buf);
 		ctl_val->value.integer.value[i] = val;
 	}
 
@@ -417,24 +463,15 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 		return pm.err;
 
 	for (i = 0; i < hwchan; i++) {
-		s16 rbuf;
-		s16 buf = cpu_to_le16(ctl_val->value.integer.value[i]);
+		s32 val = ctl_val->value.integer.value[i];
 		int ret;
 
-		ret = snd_audient_get_cur(mixer, ctype->unit, ctype->sel,
-					  base + i, &rbuf, sizeof(rbuf));
+		ret = snd_audient_raw_set_one(mixer, ctype, base + i, val);
 		if (ret < 0)
 			return ret;
 
-		if (rbuf != buf) {
+		if (ret)
 			changed = 1;
-
-			ret = snd_audient_set_cur(mixer, ctype->unit,
-						  ctype->sel, base + i,
-						  &buf, sizeof(buf));
-			if (ret < 0)
-				return ret;
-		}
 	}
 
 	return changed;
-- 
2.47.3


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

* [PATCH v2 10/21] ALSA: mixer_audient: Allow arbitrary boolean control values
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (8 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 09/21] ALSA: mixer_audient: make USB control transfer size configurable Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 11/21] ALSA: mixer_audient: Add integer range checks Will Porter
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

In preparation of id14 support, allow arbitrary values for true and false
of boolean switches. This also rids us of the tedious invert flag.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 43 ++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 23 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 57d856d252716..4b20db9a82e24 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -43,13 +43,12 @@ static const struct snd_audient_ctrl_type {
 	snd_ctl_elem_type_t type;
 	unsigned long flags;
 	size_t len;		/* datatype size, can be 1, 2 or 4 bytes */
-	bool invert;
 	union {
 		int integer;
-	} min;
+	} min;		/* for booleans holds physical int value for false */
 	union {
 		int integer;
-	} max;
+	} max;		/* for booleans holds physical int value for true */
 	const unsigned int *tlv;
 	u8 unit;
 	u8 sel;
@@ -65,7 +64,6 @@ static const struct snd_audient_ctrl_type {
 	},
 	[SND_AUDIENT_TYPE_PHANTOM] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
-		.invert = false,
 		.len = 4,
 		.min.integer = 0,
 		.max.integer = 1,
@@ -74,19 +72,17 @@ static const struct snd_audient_ctrl_type {
 	},
 	[SND_AUDIENT_TYPE_MUTE] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
-		.invert = true,
 		.len = 4,
-		.min.integer = 0,
-		.max.integer = 1,
+		.min.integer = 1,
+		.max.integer = 0,
 		.unit = 0x3A,
 		.sel = 0x02,
 	},
 	[SND_AUDIENT_TYPE_MUTE_OUT] = {
 		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
-		.invert = true,
 		.len = 4,
-		.min.integer = 0,
-		.max.integer = 1,
+		.min.integer = 1,
+		.max.integer = 0,
 		.unit = 0x3B,
 		.sel = 0x01,
 	},
@@ -359,16 +355,12 @@ static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 		if (ret < 0)
 			return ret;
 
-		ctl_val->value.integer.value[i] = buf ? 1 : 0;
-
-		if (ctype->invert)
-			ctl_val->value.integer.value[i] ^= 0x1;
+		ctl_val->value.integer.value[i] = (buf == ctype->min.integer)
+						  ? false : true;
 	}
 
 	for (; i < nchan; i++)
-		ctl_val->value.integer.value[i] = ctype->invert
-							? ctype->max.integer
-							: ctype->min.integer;
+		ctl_val->value.integer.value[i] = 0;
 
 	return 0;
 }
@@ -392,12 +384,10 @@ static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 		return pm.err;
 
 	for (i = 0; i < hwchan; i++) {
-		u32 buf = ctl_val->value.integer.value[i] ? 1 : 0;
+		u32 buf = ctl_val->value.integer.value[i] ? ctype->max.integer
+							  : ctype->min.integer;
 		int ret;
 
-		if (ctype->invert)
-			buf ^= 0x1;
-
 		ret = snd_audient_raw_set_one(mixer, ctype, base + i, buf);
 		if (ret < 0)
 			return ret;
@@ -485,8 +475,15 @@ static int snd_ctl_audient_info(struct snd_kcontrol *kctl,
 
 	uinfo->type = ctype->type;
 	uinfo->count = snd_audient_kctl_channels(kctl);
-	uinfo->value.integer.min = ctype->min.integer;
-	uinfo->value.integer.max = ctype->max.integer;
+
+	if (ctype->type == SNDRV_CTL_ELEM_TYPE_BOOLEAN) {
+		uinfo->value.integer.min = 0;
+		uinfo->value.integer.max = 1;
+	} else {
+		uinfo->value.integer.min = ctype->min.integer;
+		uinfo->value.integer.max = ctype->max.integer;
+	}
+
 	return 0;
 }
 
-- 
2.47.3


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

* [PATCH v2 11/21] ALSA: mixer_audient: Add integer range checks
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (9 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 10/21] ALSA: mixer_audient: Allow arbitrary boolean control values Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 12/21] ALSA: mixer_audient: Add control initialization at probe Will Porter
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Add range checks to integer parameters to improve error management:
- Reject out-of-range write attempts with -EINVAL
- Prune out-of-range values returned by the device to the range limits

Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 4b20db9a82e24..433bb5479d8ef 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -44,10 +44,10 @@ static const struct snd_audient_ctrl_type {
 	unsigned long flags;
 	size_t len;		/* datatype size, can be 1, 2 or 4 bytes */
 	union {
-		int integer;
+		long integer;
 	} min;		/* for booleans holds physical int value for false */
 	union {
-		int integer;
+		long integer;
 	} max;		/* for booleans holds physical int value for true */
 	const unsigned int *tlv;
 	u8 unit;
@@ -425,6 +425,12 @@ static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 		if (ret < 0)
 			return ret;
 
+		if (val < ctype->min.integer)
+			val = ctype->min.integer;
+
+		if (val > ctype->max.integer)
+			val = ctype->max.integer;
+
 		ctl_val->value.integer.value[i] = val;
 	}
 
@@ -448,6 +454,13 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 	int changed = 0;
 	int i;
 
+	for (i = 0; i < hwchan; i++) {
+		long val = ctl_val->value.integer.value[i];
+
+		if ((val < ctype->min.integer) || (val > ctype->max.integer))
+			return -EINVAL;
+	}
+
 	CLASS(snd_usb_lock, pm)(mixer->chip);
 	if (pm.err < 0)
 		return pm.err;
-- 
2.47.3


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

* [PATCH v2 12/21] ALSA: mixer_audient: Add control initialization at probe
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (10 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 11/21] ALSA: mixer_audient: Add integer range checks Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 13/21] ALSA: mixer_audient: Add readback-free parameter set Will Porter
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Add the possibility to initialize certain control types to known values at
probe time. This is particularly useful for controls which initially read
wrong values and for controls which cannot be read at all.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Co-developed-by: Will Porter <mrwillporter@gmail.com>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 433bb5479d8ef..70ec3274a5e4c 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -38,6 +38,7 @@ enum snd_audient_type {
 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)
 
 static const struct snd_audient_ctrl_type {
 	snd_ctl_elem_type_t type;
@@ -49,6 +50,7 @@ static const struct snd_audient_ctrl_type {
 	union {
 		long integer;
 	} max;		/* for booleans holds physical int value for true */
+	u32 init;
 	const unsigned int *tlv;
 	u8 unit;
 	u8 sel;
@@ -533,6 +535,20 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 		return -EINVAL;
 	}
 
+	if (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_INIT_HW) {
+		int i;
+
+		for (i = 0; i < ctrl->hwchannels; i++) {
+			int ret = snd_audient_raw_set_one(mixer, ctype,
+							  ctrl->val_offs + i,
+							  ctype->init);
+			if (ret < 0)
+				usb_audio_warn(mixer->chip,
+					       "%s: cannot set channel %d (%d)\n",
+					       ctrl->name, i, ret);
+		}
+	}
+
 	elem = kzalloc_obj(*elem);
 	if (!elem)
 		return -ENOMEM;
-- 
2.47.3


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

* [PATCH v2 13/21] ALSA: mixer_audient: Add readback-free parameter set
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (11 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 12/21] ALSA: mixer_audient: Add control initialization at probe Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 14/21] ALSA: mixer_audient: add control value caching Will Porter
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

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@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 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 70ec3274a5e4c..bdfcb7fcf531b 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_GET_BROKEN	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_GET_BROKEN) {
+		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.47.3


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

* [PATCH v2 14/21] ALSA: mixer_audient: add control value caching
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (12 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 13/21] ALSA: mixer_audient: Add readback-free parameter set Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 15/21] ALSA: mixer_audient: Create matrix programmatically Will Porter
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

In preparation of id14 support, add control value caching.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Co-developed-by: Will Porter <mrwillporter@gmail.com>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 144 +++++++++++++++++++++++++++-----------
 1 file changed, 105 insertions(+), 39 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index bdfcb7fcf531b..6c625b4734c47 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -40,6 +40,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_GET_BROKEN	BIT(2)
+#define SND_AUDIENT_CTYPE_FLAGS_CACHE		BIT(3)
 
 static const struct snd_audient_ctrl_type {
 	snd_ctl_elem_type_t type;
@@ -51,7 +52,7 @@ static const struct snd_audient_ctrl_type {
 	union {
 		long integer;
 	} max;		/* for booleans holds physical int value for true */
-	u32 init;
+	u32 init;	/* hardware and cache are initialized to this value */
 	const unsigned int *tlv;
 	u8 unit;
 	u8 sel;
@@ -91,7 +92,8 @@ static const struct snd_audient_ctrl_type {
 	},
 	[SND_AUDIENT_TYPE_MIXER] = {
 		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,
-		.flags = SND_AUDIENT_CTYPE_FLAGS_SIGNED,
+		.flags = SND_AUDIENT_CTYPE_FLAGS_SIGNED
+			 | SND_AUDIENT_CTYPE_FLAGS_CACHE,
 		.len = 2,
 		.min.integer = -128 * 256,
 		.max.integer = 6 * 256,
@@ -285,14 +287,33 @@ static inline int snd_audient_set_cur(struct usb_mixer_interface *mixer,
 }
 
 
-static int snd_audient_raw_get_one(struct usb_mixer_interface *const mixer,
+static int snd_audient_raw_get_one(struct usb_mixer_elem_info *const elem,
 			const struct snd_audient_ctrl_type *const ctype,
-			const u8 cidx, u32 *const value)
+			const unsigned int cidx, u32 *const value)
 {
+	struct usb_mixer_interface *const mixer = elem->head.mixer;
 	int ret;
 	__le32 buf = 0;
 	s32 val;
 
+	if (cidx >= MAX_CHANNELS)
+		return -EINVAL;
+
+	if (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_CACHE) {
+		if (test_bit(cidx, elem->cached)) {
+			*value = elem->cache_val[cidx];
+
+			return ctype->len;
+		} else if (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN) {
+			/*
+			 * GET_BROKEN controls are write-only: an invalid
+			 * cache entry does not trigger a GET.
+			 */
+			return -ENODATA;
+		}
+	}
+
+
 	ret = snd_audient_get_cur(mixer, ctype, cidx, &buf);
 	if (ret < 0)
 		return ret;
@@ -304,43 +325,55 @@ static int snd_audient_raw_get_one(struct usb_mixer_interface *const mixer,
 
 	*value = val;
 
+	set_bit(cidx, elem->cached);
+	elem->cache_val[cidx] = val;
+
 	return ret;
 }
 
-static int snd_audient_raw_set_one(struct usb_mixer_interface *const mixer,
+static int snd_audient_raw_set_one(struct usb_mixer_elem_info *const elem,
 			const struct snd_audient_ctrl_type *const ctype,
-			const u8 cidx, const u32 value)
+			const unsigned int cidx, const u32 value, bool force)
 {
+	struct usb_mixer_interface *const mixer = elem->head.mixer;
 	int ret;
 	u32 val;
 
-	if (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN) {
+	if (cidx >= MAX_CHANNELS)
+		return -EINVAL;
+
+	if (force) {
 		val = !value;		/* just make it different */
 	} else {
-		ret = snd_audient_raw_get_one(mixer, ctype, cidx, &val);
-		if (ret < 0)
+		ret = snd_audient_raw_get_one(elem, ctype, cidx, &val);
+		if (ret == -ENODATA)	/* GET_BROKEN and not cached yet */
+			val = !value;	/* just make it different */
+		else if (ret < 0)
 			return ret;
 	}
 
-	if (val != value) {
+	force = force || (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN);
+
+	if (force || (val != value)) {
 		__le32 buf = cpu_to_le32(value);
 
 		ret = snd_audient_set_cur(mixer, ctype, cidx, &buf);
 		if (ret < 0)
 			return ret;
 
-		return 1;
+		set_bit(cidx, elem->cached);
+		elem->cache_val[cidx] = value;
 	}
 
-	return 0;
+	return val != value;
 }
 
 
 static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 				       struct snd_ctl_elem_value *ctl_val)
 {
-	struct usb_mixer_elem_list *const list = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *const mixer = list->mixer;
+	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
+	struct usb_mixer_interface *const mixer = elem->head.mixer;
 
 	const unsigned int nchan = snd_audient_kctl_channels(kctl);
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
@@ -353,13 +386,17 @@ static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 	CLASS(snd_usb_lock, pm)(mixer->chip);
 	if (pm.err < 0)
 		return pm.err;
+	/* serializes the transfers and the cache, also between gets */
+	guard(mutex)(&mixer->lock);
 
 	for (i = 0; i < hwchan; i++) {
 		u32 buf;
 		int ret;
 
-		ret = snd_audient_raw_get_one(mixer, ctype, base + i, &buf);
-		if (ret < 0)
+		ret = snd_audient_raw_get_one(elem, ctype, base + i, &buf);
+		if (ret == -ENODATA)	/* unknown write-only value: off */
+			buf = ctype->min.integer;
+		else if (ret < 0)
 			return ret;
 
 		ctl_val->value.integer.value[i] = (buf == ctype->min.integer)
@@ -375,8 +412,8 @@ static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
 static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 				       struct snd_ctl_elem_value *ctl_val)
 {
-	struct usb_mixer_elem_list *list = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *mixer = list->mixer;
+	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
+	struct usb_mixer_interface *const mixer = elem->head.mixer;
 
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
 	const struct snd_audient_ctrl_type *const ctype
@@ -389,13 +426,16 @@ static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 	CLASS(snd_usb_lock, pm)(mixer->chip);
 	if (pm.err < 0)
 		return pm.err;
+	/* serializes the transfers and the cache, also between gets */
+	guard(mutex)(&mixer->lock);
 
 	for (i = 0; i < hwchan; i++) {
 		u32 buf = ctl_val->value.integer.value[i] ? ctype->max.integer
 							  : ctype->min.integer;
 		int ret;
 
-		ret = snd_audient_raw_set_one(mixer, ctype, base + i, buf);
+		ret = snd_audient_raw_set_one(elem, ctype, base + i, buf,
+					      false);
 		if (ret < 0)
 			return ret;
 
@@ -409,8 +449,8 @@ static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 				   struct snd_ctl_elem_value *ctl_val)
 {
-	struct usb_mixer_elem_list *const list = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *const mixer = list->mixer;
+	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
+	struct usb_mixer_interface *const mixer = elem->head.mixer;
 
 	const unsigned int nchan = snd_audient_kctl_channels(kctl);
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
@@ -423,13 +463,17 @@ static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 	CLASS(snd_usb_lock, pm)(mixer->chip);
 	if (pm.err < 0)
 		return pm.err;
+	/* serializes the transfers and the cache, also between gets */
+	guard(mutex)(&mixer->lock);
 
 	for (i = 0; i < hwchan; i++) {
 		s32 val;
 		int ret;
 
-		ret = snd_audient_raw_get_one(mixer, ctype, base + i, &val);
-		if (ret < 0)
+		ret = snd_audient_raw_get_one(elem, ctype, base + i, &val);
+		if (ret == -ENODATA)	/* unknown write-only value: minimum */
+			val = ctype->min.integer;
+		else if (ret < 0)
 			return ret;
 
 		if (val < ctype->min.integer)
@@ -450,8 +494,8 @@ static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 				   struct snd_ctl_elem_value *ctl_val)
 {
-	struct usb_mixer_elem_list *list = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *mixer = list->mixer;
+	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
+	struct usb_mixer_interface *mixer = elem->head.mixer;
 
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
 	const struct snd_audient_ctrl_type *const ctype
@@ -471,12 +515,15 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 	CLASS(snd_usb_lock, pm)(mixer->chip);
 	if (pm.err < 0)
 		return pm.err;
+	/* serializes the transfers and the cache, also between gets */
+	guard(mutex)(&mixer->lock);
 
 	for (i = 0; i < hwchan; i++) {
 		s32 val = ctl_val->value.integer.value[i];
 		int ret;
 
-		ret = snd_audient_raw_set_one(mixer, ctype, base + i, val);
+		ret = snd_audient_raw_set_one(elem, ctype, base + i, val,
+					      false);
 		if (ret < 0)
 			return ret;
 
@@ -517,6 +564,8 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 	struct snd_kcontrol *kctl;
 	struct usb_mixer_elem_info *elem;
 
+	int ret;
+
 	knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
 	knew.name = ctrl->name;
 	knew.info = snd_ctl_audient_info;
@@ -524,7 +573,9 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 						   ctrl->hwchannels);
 	knew.tlv.p = ctype->tlv;
 	knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE
-			| SNDRV_CTL_ELEM_ACCESS_VOLATILE
+			| ((ctype->flags & SND_AUDIENT_CTYPE_FLAGS_CACHE)
+			   ? 0
+			   : SNDRV_CTL_ELEM_ACCESS_VOLATILE)
 			| (ctype->tlv ? SNDRV_CTL_ELEM_ACCESS_TLV_READ : 0);
 
 	switch (ctype->type) {
@@ -540,13 +591,30 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 		return -EINVAL;
 	}
 
+	elem = kzalloc_obj(*elem);
+	if (!elem)
+		return -ENOMEM;
+
+	elem->head.mixer = mixer;
+	elem->channels = ctrl->channels;
+	elem->head.id = ctype->unit;
+	elem->control = ctype->sel;
+	elem->get_cur_broken = (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_CACHE)
+			&& (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN);
+
+	/*
+	 * A failed probe transfer must not fail the card: warn and keep the
+	 * control.
+	 * We don't initialize the cache: This will be done implicitly when
+	 * the control is first successfully accessed.
+	 */
 	if (ctype->flags & SND_AUDIENT_CTYPE_FLAGS_INIT_HW) {
 		int i;
 
 		for (i = 0; i < ctrl->hwchannels; i++) {
-			int ret = snd_audient_raw_set_one(mixer, ctype,
-							  ctrl->val_offs + i,
-							  ctype->init);
+			ret = snd_audient_raw_set_one(elem, ctype,
+						      ctrl->val_offs + i,
+						      ctype->init, true);
 			if (ret < 0)
 				usb_audio_warn(mixer->chip,
 					       "%s: cannot set channel %d (%d)\n",
@@ -554,22 +622,20 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 		}
 	}
 
-	elem = kzalloc_obj(*elem);
-	if (!elem)
-		return -ENOMEM;
-
-	elem->head.mixer = mixer;
-	elem->channels = ctrl->channels;
-
 	kctl = snd_ctl_new1(&knew, elem);
 	if (!kctl) {
-		kfree(elem);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto free_elem;
 	}
 
 	kctl->private_free = snd_usb_mixer_elem_free;
 
 	return snd_usb_mixer_add_control(&elem->head, kctl);
+
+free_elem:
+	kfree(elem);
+
+	return ret;
 }
 
 
-- 
2.47.3


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

* [PATCH v2 15/21] ALSA: mixer_audient: Create matrix programmatically
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (13 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 14/21] ALSA: mixer_audient: add control value caching Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 16/21] ALSA: mixer_audient: Add a step size to integer controls Will Porter
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

Most Audient devices seem to have a similar mixer matrix with many
identical channels. The only difference between devices seems to be
the matrix' dimension. Create it programmatically in a loop rather
than from the controls table.

Signed-off-by: Christian Ruppert <arc@gmx.li>
Co-developed-by: Will Porter <mrwillporter@gmail.com>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 77 +++++++++++++++++----------------------
 1 file changed, 34 insertions(+), 43 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 6c625b4734c47..56a9b9c04b369 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -105,7 +105,7 @@ static const struct snd_audient_ctrl_type {
 
 
 struct snd_audient_ctrl {
-	char *name;
+	const char *const name;
 	enum snd_audient_type type;
 	unsigned int channels;
 	unsigned int hwchannels;
@@ -134,48 +134,6 @@ static const struct snd_audient_ctrl snd_audient_evo4_controls[] = {
 		.hwchannels = 1,
 		.val_offs = 0,
 	},
-	{
-		.name = "Mic 1 Capture Volume",
-		.type = SND_AUDIENT_TYPE_MIXER,
-		.channels = 2,
-		.hwchannels = 2,
-		.val_offs = 0,
-	},
-	{
-		.name = "Mic 2 Capture Volume",
-		.type = SND_AUDIENT_TYPE_MIXER,
-		.channels = 2,
-		.hwchannels = 2,
-		.val_offs = 2,
-	},
-	{
-		.name = "Master Left Capture Volume",
-		.type = SND_AUDIENT_TYPE_MIXER,
-		.channels = 2,
-		.hwchannels = 2,
-		.val_offs = 4,
-	},
-	{
-		.name = "Master Right Capture Volume",
-		.type = SND_AUDIENT_TYPE_MIXER,
-		.channels = 2,
-		.hwchannels = 2,
-		.val_offs = 6,
-	},
-	{
-		.name = "Loopback Left Capture Volume",
-		.type = SND_AUDIENT_TYPE_MIXER,
-		.channels = 2,
-		.hwchannels = 2,
-		.val_offs = 8,
-	},
-	{
-		.name = "Loopback Right Capture Volume",
-		.type = SND_AUDIENT_TYPE_MIXER,
-		.channels = 2,
-		.hwchannels = 2,
-		.val_offs = 10,
-	},
 	{
 		.name = "Mic 1 Phantom Capture Switch",
 		.type = SND_AUDIENT_TYPE_PHANTOM,
@@ -193,13 +151,27 @@ static const struct snd_audient_ctrl snd_audient_evo4_controls[] = {
 	{ 0 }, /* sentinel */
 };
 
+static const char *const snd_audient_evo4_matrix[] = {
+	"Mic 1 Capture Volume",
+	"Mic 2 Capture Volume",
+	"Master Left Capture Volume",
+	"Master Right Capture Volume",
+	"Loopback Left Capture Volume",
+	"Loopback Right Capture Volume",
+	NULL
+};
+
 static const struct audient_devinfo {
 	u32 usb_id;
 	const struct snd_audient_ctrl *controls;
+	const char *const *const matrix_names;
+	const unsigned int matrix_channels;
 } audient_devinfo[] = {
 	{
 		.usb_id = USB_ID(USB_AUDIENT_VID, USB_EVO4_PID),
 		.controls = snd_audient_evo4_controls,
+		.matrix_names = snd_audient_evo4_matrix,
+		.matrix_channels = 2,
 	},
 	{ 0 } /* sentinel */
 };
@@ -645,6 +617,8 @@ int snd_audient_controls_create(struct usb_mixer_interface *mixer)
 	const struct audient_devinfo *info;
 	const struct snd_audient_ctrl *ctrl;
 
+	int i;
+
 	for (info = audient_devinfo; info->controls; info++)
 		if (info->usb_id == mixer->chip->usb_id)
 			break;
@@ -659,5 +633,22 @@ int snd_audient_controls_create(struct usb_mixer_interface *mixer)
 			return ret;
 	}
 
+	if (info->matrix_names) {
+		for (i = 0; info->matrix_names[i]; i++) {
+			const struct snd_audient_ctrl c = {
+				.name = info->matrix_names[i],
+				.type = SND_AUDIENT_TYPE_MIXER,
+				.channels = info->matrix_channels,
+				.hwchannels = info->matrix_channels,
+				.val_offs = i * info->matrix_channels,
+			};
+
+			const int ret = snd_audient_add_ctrl(mixer, &c);
+
+			if (ret < 0)
+				return ret;
+		}
+	}
+
 	return 0;
 }
-- 
2.47.3


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

* [PATCH v2 16/21] ALSA: mixer_audient: Add a step size to integer controls
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (14 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 15/21] ALSA: mixer_audient: Create matrix programmatically Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 17/21] ALSA: mixer_audient: Add enumerated controls Will Porter
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

The iD14 level controls use s16 values in 1/256 dB. Expose them in
1 dB steps, matching the volume knob's adjustment. Let a control type
give a step size: the control then counts steps from the minimum, as
the generic USB mixer does with the RANGE resolution. A device value
between two steps reads as the nearest step, clamped to the maximum.
Types without a step size keep the device value.

Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 57 ++++++++++++++++++++++++++++++---------
 1 file changed, 45 insertions(+), 12 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 56a9b9c04b369..12b430ebed9e3 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -53,6 +53,7 @@ static const struct snd_audient_ctrl_type {
 		long integer;
 	} max;		/* for booleans holds physical int value for true */
 	u32 init;	/* hardware and cache are initialized to this value */
+	unsigned int res;	/* integers: device units per control step, 0 = 1 */
 	const unsigned int *tlv;
 	u8 unit;
 	u8 sel;
@@ -418,6 +419,41 @@ static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
 	return changed;
 }
 
+/*
+ * With a step size (res), an integer control counts steps from min:
+ * 0 ... (max - min) / res. Without one it shows the device value.
+ */
+static inline long
+snd_audient_int_max(const struct snd_audient_ctrl_type *ctype)
+{
+	return ctype->res ? (ctype->max.integer - ctype->min.integer) / ctype->res
+			  : ctype->max.integer;
+}
+
+static inline long
+snd_audient_int_min(const struct snd_audient_ctrl_type *ctype)
+{
+	return ctype->res ? 0 : ctype->min.integer;
+}
+
+static long snd_audient_int_to_ctl(const struct snd_audient_ctrl_type *ctype,
+				   long val)
+{
+	val = clamp(val, ctype->min.integer, ctype->max.integer);
+	if (!ctype->res)
+		return val;
+
+	/* round a device value between two steps to the nearest one */
+	return min(DIV_ROUND_CLOSEST(val - ctype->min.integer, (long)ctype->res),
+		   snd_audient_int_max(ctype));
+}
+
+static inline long
+snd_audient_int_from_ctl(const struct snd_audient_ctrl_type *ctype, long val)
+{
+	return ctype->res ? ctype->min.integer + val * ctype->res : val;
+}
+
 static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 				   struct snd_ctl_elem_value *ctl_val)
 {
@@ -448,17 +484,12 @@ static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
 		else if (ret < 0)
 			return ret;
 
-		if (val < ctype->min.integer)
-			val = ctype->min.integer;
-
-		if (val > ctype->max.integer)
-			val = ctype->max.integer;
-
-		ctl_val->value.integer.value[i] = val;
+		ctl_val->value.integer.value[i] =
+			snd_audient_int_to_ctl(ctype, val);
 	}
 
 	for (; i < nchan; i++)
-		ctl_val->value.integer.value[i] = ctype->min.integer;
+		ctl_val->value.integer.value[i] = snd_audient_int_min(ctype);
 
 	return 0;
 }
@@ -480,7 +511,8 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 	for (i = 0; i < hwchan; i++) {
 		long val = ctl_val->value.integer.value[i];
 
-		if ((val < ctype->min.integer) || (val > ctype->max.integer))
+		if (val < snd_audient_int_min(ctype) ||
+		    val > snd_audient_int_max(ctype))
 			return -EINVAL;
 	}
 
@@ -491,7 +523,8 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 	guard(mutex)(&mixer->lock);
 
 	for (i = 0; i < hwchan; i++) {
-		s32 val = ctl_val->value.integer.value[i];
+		s32 val = snd_audient_int_from_ctl(ctype,
+						   ctl_val->value.integer.value[i]);
 		int ret;
 
 		ret = snd_audient_raw_set_one(elem, ctype, base + i, val,
@@ -519,8 +552,8 @@ static int snd_ctl_audient_info(struct snd_kcontrol *kctl,
 		uinfo->value.integer.min = 0;
 		uinfo->value.integer.max = 1;
 	} else {
-		uinfo->value.integer.min = ctype->min.integer;
-		uinfo->value.integer.max = ctype->max.integer;
+		uinfo->value.integer.min = snd_audient_int_min(ctype);
+		uinfo->value.integer.max = snd_audient_int_max(ctype);
 	}
 
 	return 0;
-- 
2.47.3


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

* [PATCH v2 17/21] ALSA: mixer_audient: Add enumerated controls
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (15 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 16/21] ALSA: mixer_audient: Add a step size to integer controls Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 18/21] ALSA: usb-audio: Give the Audient iD14 MkI its own mixer map Will Porter
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

The iD14 has selectors with a fixed set of device values: output
routing, mono mode, the iD key function, talkback source and the
digital input mode. Add an enumerated control type with a value list.

A get of a device value outside the list returns -EIO. Mapping it to
an item would show a wrong value: on the iD14, an unknown routing
value shown as Main Mix could hide a route that bypasses the speaker
volume, cut and dim. A write-only value that no transfer has
confirmed reads as the init value, as a write-only switch reads off.

Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 139 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 134 insertions(+), 5 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 12b430ebed9e3..77f48d9a74917 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -42,6 +42,25 @@ static const DECLARE_TLV_DB_MINMAX_MUTE(snd_audient_tlv_mixer, -12800, 600);
 #define SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN	BIT(2)
 #define SND_AUDIENT_CTYPE_FLAGS_CACHE		BIT(3)
 
+/*
+ * An enumerated control: item i sends values[i]. A get of a device value
+ * outside the list returns -EIO; it does not show a wrong item.
+ */
+struct snd_audient_enum {
+	const char *const *texts;
+	const u32 *values;
+	unsigned int items;
+};
+
+#define SND_AUDIENT_ENUM(name, texts_, ...)				\
+	static const u32 name##_values[] = { __VA_ARGS__ };		\
+	static const struct snd_audient_enum name = {			\
+		.texts = texts_,					\
+		.values = name##_values,				\
+		.items = ARRAY_SIZE(name##_values),			\
+	};								\
+	static_assert(ARRAY_SIZE(texts_) == ARRAY_SIZE(name##_values))
+
 static const struct snd_audient_ctrl_type {
 	snd_ctl_elem_type_t type;
 	unsigned long flags;
@@ -54,6 +73,7 @@ static const struct snd_audient_ctrl_type {
 	} max;		/* for booleans holds physical int value for true */
 	u32 init;	/* hardware and cache are initialized to this value */
 	unsigned int res;	/* integers: device units per control step, 0 = 1 */
+	const struct snd_audient_enum *enumeration;
 	const unsigned int *tlv;
 	u8 unit;
 	u8 sel;
@@ -539,23 +559,128 @@ static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
 	return changed;
 }
 
+/* The item index of a device value, or -EIO if the value is not in the list */
+static int snd_audient_enum_item(const struct snd_audient_enum *e, u32 value)
+{
+	unsigned int item;
+
+	for (item = 0; item < e->items; item++)
+		if (e->values[item] == value)
+			return item;
+
+	return -EIO;
+}
+
+static int snd_ctl_audient_enum_get(struct snd_kcontrol *kctl,
+				    struct snd_ctl_elem_value *ctl_val)
+{
+	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
+	struct usb_mixer_interface *const mixer = elem->head.mixer;
+
+	const unsigned int nchan = snd_audient_kctl_channels(kctl);
+	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
+	const struct snd_audient_ctrl_type *const ctype
+						= snd_audient_kctl_type(kctl);
+	const u8 base = snd_audient_kctl_cidxoffs(kctl);
+
+	unsigned int i;
+
+	CLASS(snd_usb_lock, pm)(mixer->chip);
+	if (pm.err < 0)
+		return pm.err;
+	/* serializes the transfers and the cache, also between gets */
+	guard(mutex)(&mixer->lock);
+
+	for (i = 0; i < hwchan; i++) {
+		u32 val;
+		int item;
+		int ret;
+
+		ret = snd_audient_raw_get_one(elem, ctype, base + i, &val);
+		if (ret == -ENODATA)	/* unknown write-only value: init */
+			val = ctype->init;
+		else if (ret < 0)
+			return ret;
+
+		item = snd_audient_enum_item(ctype->enumeration, val);
+		if (item < 0)
+			return item;
+
+		ctl_val->value.enumerated.item[i] = item;
+	}
+
+	for (; i < nchan; i++)
+		ctl_val->value.enumerated.item[i] = 0;
+
+	return 0;
+}
+
+static int snd_ctl_audient_enum_set(struct snd_kcontrol *kctl,
+				    struct snd_ctl_elem_value *ctl_val)
+{
+	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
+	struct usb_mixer_interface *const mixer = elem->head.mixer;
+
+	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
+	const struct snd_audient_ctrl_type *const ctype
+						= snd_audient_kctl_type(kctl);
+	const struct snd_audient_enum *const e = ctype->enumeration;
+	const u8 base = snd_audient_kctl_cidxoffs(kctl);
+
+	unsigned int i;
+	int changed = 0;
+
+	for (i = 0; i < hwchan; i++)
+		if (ctl_val->value.enumerated.item[i] >= e->items)
+			return -EINVAL;
+
+	CLASS(snd_usb_lock, pm)(mixer->chip);
+	if (pm.err < 0)
+		return pm.err;
+	/* serializes the transfers and the cache, also between gets */
+	guard(mutex)(&mixer->lock);
+
+	for (i = 0; i < hwchan; i++) {
+		const unsigned int item = ctl_val->value.enumerated.item[i];
+		int ret;
+
+		ret = snd_audient_raw_set_one(elem, ctype, base + i,
+					      e->values[item], false);
+		if (ret < 0)
+			return ret;
+
+		if (ret)
+			changed = 1;
+	}
+
+	return changed;
+}
+
 static int snd_ctl_audient_info(struct snd_kcontrol *kctl,
 			    struct snd_ctl_elem_info *uinfo)
 {
 	const struct snd_audient_ctrl_type *const ctype
 						= snd_audient_kctl_type(kctl);
 
-	uinfo->type = ctype->type;
-	uinfo->count = snd_audient_kctl_channels(kctl);
-
-	if (ctype->type == SNDRV_CTL_ELEM_TYPE_BOOLEAN) {
+	switch (ctype->type) {
+	case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
+		return snd_ctl_enum_info(uinfo,
+					 snd_audient_kctl_channels(kctl),
+					 ctype->enumeration->items,
+					 ctype->enumeration->texts);
+	case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
 		uinfo->value.integer.min = 0;
 		uinfo->value.integer.max = 1;
-	} else {
+		break;
+	default:
 		uinfo->value.integer.min = snd_audient_int_min(ctype);
 		uinfo->value.integer.max = snd_audient_int_max(ctype);
+		break;
 	}
 
+	uinfo->type = ctype->type;
+	uinfo->count = snd_audient_kctl_channels(kctl);
+
 	return 0;
 }
 
@@ -592,6 +717,10 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 		knew.get = snd_ctl_audient_boolean_get;
 		knew.put = snd_ctl_audient_boolean_set;
 		break;
+	case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
+		knew.get = snd_ctl_audient_enum_get;
+		knew.put = snd_ctl_audient_enum_set;
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
2.47.3


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

* [PATCH v2 18/21] ALSA: usb-audio: Give the Audient iD14 MkI its own mixer map
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (16 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 17/21] ALSA: mixer_audient: Add enumerated controls Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 19/21] ALSA: mixer_audient: Add Audient iD14 MkI controls Will Porter
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

The iD14 MkI (2708:0002) and MkII (2708:0008) share audient_id14_map.
Later commits add MkI vendor controls that replace some of the generic
MkI controls. The MkII keeps the generic controls. Give the MkI its own
copy of the map.

No functional change.

Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_maps.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
index 9218ca6314ad7..31f8d02534373 100644
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -540,6 +540,12 @@ static const struct usbmix_name_map audient_id14_map[] = {
 	{}
 };
 
+/* Audient iD14 MkI: model-specific control map. */
+static const struct usbmix_name_map audient_id14_mk1_map[] = {
+	{ 12, "Monitor Mix Playback" },	/* FU, partial coverage */
+	{}
+};
+
 /*
  * Audient iD24: feature unit 12 ("Speaker Playback Volume") sits in the
  * monitor-mixer branch and does not apply volume to all of its channels;
@@ -652,7 +658,7 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = {
 	{
 		/* Audient iD14 MkI */
 		.id = USB_ID(0x2708, 0x0002),
-		.map = audient_id14_map,
+		.map = audient_id14_mk1_map,
 	},
 	{
 		/* Audient EVO4 MkI */
-- 
2.47.3


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

* [PATCH v2 19/21] ALSA: mixer_audient: Add Audient iD14 MkI controls
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (17 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 18/21] ALSA: usb-audio: Give the Audient iD14 MkI its own mixer map Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 20/21] ALSA: mixer_audient: Unify snd_audient_*_set/get functions for different types Will Porter
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

The iD14 MkI (2708:0002) has its monitor controller on extension unit
54 and its output routing on extension unit 51. The headphone level is
on feature unit 10 (CN 3-4, which the descriptor does not declare).
The mixer is mixer unit 60. The generic driver cannot find the vendor
controls and creates wrong controls for mixer unit 60 and feature unit
11. Add the MkI as a device with these tables. Apart from the tables
and their macros, the patch adds the device ID, its case in
mixer_quirks.c and the map entries that hide the generic controls.

Monitor and routing controls: speaker volume, cut, dim, dim level,
mono, mono mode, polarity, talkback, headphone volume and mute, and
one routing selector per output channel. All of them read the device
on every get: the front panel knob changes the volumes and the cut and
mute states.

The volumes are s16 values in 1/256 dB from -128 to 0 dB, in the 1 dB
steps of the knob. -128 dB does not mute the headphones, so the TLV
does not declare a mute.

DAW Thru plays the USB stream past the monitor controller, so the main
output selectors name it "DAW Thru (full scale)". The headphone volume
and mute still act on every headphone source, so the headphone
selectors name it "DAW Thru".

Mixer matrix: mixer unit 60 mixes 14 inputs (Mic 1-2, Digi 1-8, DAW
1-4) into four outputs (Main L/R, Cue L/R), CN = input * 4 + output.
GET RANGE reports -127 to 0 dB in 1 dB steps, so the generic driver
creates four "Analogue 4 Volume" controls with values from 0 to 127.
The crosspoints take -128 dB (mute) to +6 dB in 1/256 dB steps, as on
the EVO4, so they use the same control type. Add one stereo control
per input and output pair: "Mix Main <input> Playback Volume" and "Mix
Cue <input> Playback Volume". Hide the generic controls in the MkI
map. The driver reads each crosspoint at probe and writes nothing to
the mixer.

Write-only controls: some MkI controls cannot be read back:
- GET stalls for the input gain boost and polarity (feature unit 11),
  the iD key function and the digital input mode.
- GET of the talkback source answers 0, whatever value a SET wrote.

For FU 11 the generic driver creates "Input Gain Control" and "Phase
Inverter Control" and logs "cannot get min/max values". Add:
- Mic 1/2 Boost Capture Switch (+10 dB)
- Mic 1/2 and Digi 1/2 Polarity Invert Capture Switch
- iD Key Function Playback Enum (ScrollControl, Mono, Mono + Polarity,
  Dim, Talkback)
- Talkback Source Capture Enum (None, Mic 1-2, Digi 1-8)
- Digital In Mode Capture Enum (ADAT, S/PDIF)

and hide the generic FU 11 controls in the MkI map. The device refuses
polarity on Digi 3-8 with EPIPE, in ADAT and in S/PDIF mode, so Digi
3-8 have no polarity control.

These controls use the cache, init and force-set flags: they show the
last value written, every put sends its value, and the probe writes
each one once so that the value shown is true:
- boost and polarity off, iD key ScrollControl, talkback source None
- S/PDIF: the MkI's measured power-on mode

If a probe write fails, the card still registers and the kernel log
names the control. Until a put succeeds, the control reads its probe
value, which the device may not hold.

The probe write replaces any value the device kept. On mains power the
device keeps its values across a replug, so the controls return to the
probe values until alsactl restore runs.

Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 316 ++++++++++++++++++++++++++++++++++++++
 sound/usb/mixer_audient.h |   1 +
 sound/usb/mixer_maps.c    |   2 +
 sound/usb/mixer_quirks.c  |   1 +
 4 files changed, 320 insertions(+)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 77f48d9a74917..62f87283485d0 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -3,6 +3,10 @@
  * Audient driver for ALSA
  * Copyright (C) 2026 Christian Ruppert <arc@gmx.li>
  *
+ * Supported models: EVO4 (2708:0006), iD14 MkI (2708:0002).
+ * The iD14 MkII and other iD models keep the generic driver: their units
+ * may differ.
+ *
  * EVO4 support is based on the work of Ivan Hazucha for audient-evo-py.
  * https://github.com/vanzaho/audient-evo-py/
  */
@@ -10,6 +14,7 @@
 
 #include <asm/byteorder.h>
 #include <linux/usb.h>
+#include <linux/usb/audio.h>
 #include <linux/usb/audio-v2.h>
 #include <linux/slab.h>
 #include <linux/types.h>
@@ -31,6 +36,25 @@ enum snd_audient_type {
 	SND_AUDIENT_TYPE_MUTE,
 	SND_AUDIENT_TYPE_MUTE_OUT,
 	SND_AUDIENT_TYPE_MIXER,
+	SND_AUDIENT_TYPE_ID14_MON_VOLUME,
+	SND_AUDIENT_TYPE_ID14_MON_CUT,
+	SND_AUDIENT_TYPE_ID14_MON_DIM,
+	SND_AUDIENT_TYPE_ID14_MON_DIM_LEVEL,
+	SND_AUDIENT_TYPE_ID14_MON_MONO,
+	SND_AUDIENT_TYPE_ID14_MON_MONO_MODE,
+	SND_AUDIENT_TYPE_ID14_MON_POLARITY,
+	SND_AUDIENT_TYPE_ID14_MON_TALKBACK,
+	SND_AUDIENT_TYPE_ID14_HP_VOLUME,
+	SND_AUDIENT_TYPE_ID14_HP_MUTE,
+	SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_L,
+	SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_R,
+	SND_AUDIENT_TYPE_ID14_ROUTE_HP_L,
+	SND_AUDIENT_TYPE_ID14_ROUTE_HP_R,
+	SND_AUDIENT_TYPE_ID14_IN_BOOST,
+	SND_AUDIENT_TYPE_ID14_IN_POLARITY,
+	SND_AUDIENT_TYPE_ID14_MON_ID_KEY,
+	SND_AUDIENT_TYPE_ID14_MON_TALKBACK_SRC,
+	SND_AUDIENT_TYPE_ID14_OPTICAL_MODE,
 	SND_AUDIENT_TYPE_NCTYPES
 };
 
@@ -61,6 +85,154 @@ struct snd_audient_enum {
 	};								\
 	static_assert(ARRAY_SIZE(texts_) == ARRAY_SIZE(name##_values))
 
+/*
+ * iD14 MkI units. The monitor controller, output routing, headphone level,
+ * input options and the mixer sit on extension units and on feature units
+ * whose descriptors declare no controls; the generic driver cannot find them.
+ */
+#define ID14_IT_DIGITAL		0x01	/* input terminal: optical and coaxial */
+#define ID14_FU_OUT		0x0a	/* before the outputs: CN 3-4 headphones */
+#define ID14_FU_IN		0x0b	/* inputs: CN 1-2 Mic, 3-10 Digi */
+#define ID14_FU_MIX		0x0c	/* after the mixer: CN 1-2 Main, 3-4 Cue */
+#define ID14_ROUTE		0x33	/* routing XU: CN = destination */
+#define ID14_MON		0x36	/* monitor controller XU */
+
+/* Monitor controller selectors */
+#define ID14_MON_MONO		0x00
+#define ID14_MON_MONO_MODE	0x01
+#define ID14_MON_POLARITY	0x03
+#define ID14_MON_CUT		0x04
+#define ID14_MON_DIM		0x05
+#define ID14_MON_DIM_LEVEL	0x06	/* s16, 1/256 dB */
+#define ID14_MON_TALKBACK	0x07
+#define ID14_MON_TALKBACK_SRC	0x08	/* GET always returns 0 */
+#define ID14_MON_ID_KEY		0x10	/* u16: the selector the iD key toggles */
+#define ID14_MON_VOLUME		0x12	/* s16, 1/256 dB; the knob also sets it */
+
+#define ID14_IN_BOOST		0x0b	/* s16: 0x0a00 = +10 dB, 0 = off */
+#define ID14_IN_POLARITY	0x0d
+#define ID14_IT_OPTICAL_MODE	0x00	/* u32: 0 ADAT, 1 S/PDIF */
+
+#define ID14_ROUTE_SOURCE	0x06	/* u8: source of the destination */
+
+/*
+ * iD14 volumes: s16 in 1/256 dB, -128 ... 0 dB, in the 1 dB steps of the
+ * front panel knob. Control value 0 is -128 dB, 128 is 0 dB. -128 dB is not
+ * a mute: on the headphones the level stops falling at a small residual.
+ */
+static const DECLARE_TLV_DB_SCALE(snd_audient_tlv_id14_vol, -12800, 100, 0);
+
+/* Mono mode: one-speaker sum (Left, Right) or phantom centre */
+static const char *const snd_audient_id14_mono_mode_texts[] = {
+	"Left", "Centre", "Right",
+};
+SND_AUDIENT_ENUM(snd_audient_id14_mono_mode,
+		 snd_audient_id14_mono_mode_texts, 1, 0, 2);
+
+/*
+ * Output routing. Main Mix is 0x14/0x15 on the main outputs and 0x18/0x19
+ * on the headphones; DAW Thru on destination n plays DAW n + 1. DAW Thru
+ * bypasses the monitor controller (speaker volume, cut and dim), so the
+ * main outputs play the USB stream at full scale. The headphone volume and
+ * mute still act on every headphone source.
+ */
+static const char *const snd_audient_id14_route_main_texts[] = {
+	"Main Mix", "Cue Mix", "DAW Thru (full scale)",
+};
+static const char *const snd_audient_id14_route_hp_texts[] = {
+	"Main Mix", "Cue Mix", "DAW Thru",
+};
+SND_AUDIENT_ENUM(snd_audient_id14_route_main_l,
+		 snd_audient_id14_route_main_texts, 0x14, 0x10, 0x00);
+SND_AUDIENT_ENUM(snd_audient_id14_route_main_r,
+		 snd_audient_id14_route_main_texts, 0x15, 0x11, 0x01);
+SND_AUDIENT_ENUM(snd_audient_id14_route_hp_l,
+		 snd_audient_id14_route_hp_texts, 0x18, 0x10, 0x02);
+SND_AUDIENT_ENUM(snd_audient_id14_route_hp_r,
+		 snd_audient_id14_route_hp_texts, 0x19, 0x11, 0x03);
+
+/*
+ * iD key function: the value is the monitor controller selector the key
+ * toggles. ScrollControl (0xffff) toggles nothing: the knob then scrolls
+ * through the HID interface.
+ */
+static const char *const snd_audient_id14_id_key_texts[] = {
+	"ScrollControl", "Mono", "Mono + Polarity", "Dim", "Talkback",
+};
+SND_AUDIENT_ENUM(snd_audient_id14_id_key, snd_audient_id14_id_key_texts,
+		 0xffff, ID14_MON_MONO, ID14_MON_POLARITY, ID14_MON_DIM,
+		 ID14_MON_TALKBACK);
+
+/* Talkback source: the routing source number of the input; none = 0xff */
+static const char *const snd_audient_id14_talkback_texts[] = {
+	"None", "Mic 1", "Mic 2", "Digi 1", "Digi 2", "Digi 3", "Digi 4",
+	"Digi 5", "Digi 6", "Digi 7", "Digi 8",
+};
+SND_AUDIENT_ENUM(snd_audient_id14_talkback, snd_audient_id14_talkback_texts,
+		 0xff, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
+
+static const char *const snd_audient_id14_optical_texts[] = {
+	"ADAT", "S/PDIF",
+};
+SND_AUDIENT_ENUM(snd_audient_id14_optical, snd_audient_id14_optical_texts,
+		 0, 1);
+
+/*
+ * Write-only: GET stalls or does not report writes. Show the last value
+ * written, write the init value at probe, and send every put.
+ */
+#define ID14_WO	(SND_AUDIENT_CTYPE_FLAGS_CACHE		\
+		 | SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN	\
+		 | SND_AUDIENT_CTYPE_FLAGS_INIT_HW)
+
+#define ID14_BOOL(unit_, sel_)				\
+	{						\
+		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,	\
+		.len = 1,				\
+		.min.integer = 0,			\
+		.max.integer = 1,			\
+		.unit = (unit_),			\
+		.sel = (sel_),				\
+	}
+
+/* 1 = cut or mute: shown as a switch that is off */
+#define ID14_BOOL_INV(unit_, sel_)			\
+	{						\
+		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,	\
+		.len = 1,				\
+		.min.integer = 1,			\
+		.max.integer = 0,			\
+		.unit = (unit_),			\
+		.sel = (sel_),				\
+	}
+
+#define ID14_VOLUME(unit_, sel_)			\
+	{						\
+		.type = SNDRV_CTL_ELEM_TYPE_INTEGER,	\
+		.flags = SND_AUDIENT_CTYPE_FLAGS_SIGNED,	\
+		.len = 2,				\
+		.min.integer = -128 * 256,		\
+		.max.integer = 0,			\
+		.res = 256,				\
+		.tlv = snd_audient_tlv_id14_vol,	\
+		.unit = (unit_),			\
+		.sel = (sel_),				\
+	}
+
+/*
+ * A readable enum. It has no cache entry, so a get always reads the device
+ * and never uses init. Write-only enums set .init and .flags without this
+ * macro.
+ */
+#define ID14_ENUM(unit_, sel_, len_, enum_)		\
+	{						\
+		.type = SNDRV_CTL_ELEM_TYPE_ENUMERATED,	\
+		.len = (len_),				\
+		.enumeration = &(enum_),		\
+		.unit = (unit_),			\
+		.sel = (sel_),				\
+	}
+
 static const struct snd_audient_ctrl_type {
 	snd_ctl_elem_type_t type;
 	unsigned long flags;
@@ -122,6 +294,88 @@ static const struct snd_audient_ctrl_type {
 		.sel = 0x01,
 		.tlv = snd_audient_tlv_mixer,
 	},
+	[SND_AUDIENT_TYPE_ID14_MON_VOLUME] =
+		ID14_VOLUME(ID14_MON, ID14_MON_VOLUME),
+	[SND_AUDIENT_TYPE_ID14_MON_CUT] =
+		ID14_BOOL_INV(ID14_MON, ID14_MON_CUT),
+	[SND_AUDIENT_TYPE_ID14_MON_DIM] =
+		ID14_BOOL(ID14_MON, ID14_MON_DIM),
+	[SND_AUDIENT_TYPE_ID14_MON_DIM_LEVEL] =
+		ID14_VOLUME(ID14_MON, ID14_MON_DIM_LEVEL),
+	[SND_AUDIENT_TYPE_ID14_MON_MONO] =
+		ID14_BOOL(ID14_MON, ID14_MON_MONO),
+	[SND_AUDIENT_TYPE_ID14_MON_MONO_MODE] =
+		ID14_ENUM(ID14_MON, ID14_MON_MONO_MODE, 1,
+			  snd_audient_id14_mono_mode),
+	[SND_AUDIENT_TYPE_ID14_MON_POLARITY] =
+		ID14_BOOL(ID14_MON, ID14_MON_POLARITY),
+	[SND_AUDIENT_TYPE_ID14_MON_TALKBACK] =
+		ID14_BOOL(ID14_MON, ID14_MON_TALKBACK),
+	[SND_AUDIENT_TYPE_ID14_HP_VOLUME] =
+		ID14_VOLUME(ID14_FU_OUT, UAC_FU_VOLUME),
+	[SND_AUDIENT_TYPE_ID14_HP_MUTE] =
+		ID14_BOOL_INV(ID14_FU_OUT, UAC_FU_MUTE),
+	[SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_L] =
+		ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1,
+			  snd_audient_id14_route_main_l),
+	[SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_R] =
+		ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1,
+			  snd_audient_id14_route_main_r),
+	[SND_AUDIENT_TYPE_ID14_ROUTE_HP_L] =
+		ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1,
+			  snd_audient_id14_route_hp_l),
+	[SND_AUDIENT_TYPE_ID14_ROUTE_HP_R] =
+		ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1,
+			  snd_audient_id14_route_hp_r),
+	/* the documented boost is a fixed +10 dB */
+	[SND_AUDIENT_TYPE_ID14_IN_BOOST] = {
+		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
+		.flags = ID14_WO,
+		.len = 2,
+		.min.integer = 0,
+		.max.integer = 10 * 256,
+		.init = 0,
+		.unit = ID14_FU_IN,
+		.sel = ID14_IN_BOOST,
+	},
+	[SND_AUDIENT_TYPE_ID14_IN_POLARITY] = {
+		.type = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
+		.flags = ID14_WO,
+		.len = 1,
+		.min.integer = 0,
+		.max.integer = 1,
+		.init = 0,
+		.unit = ID14_FU_IN,
+		.sel = ID14_IN_POLARITY,
+	},
+	[SND_AUDIENT_TYPE_ID14_MON_ID_KEY] = {
+		.type = SNDRV_CTL_ELEM_TYPE_ENUMERATED,
+		.flags = ID14_WO,
+		.len = 2,
+		.init = 0xffff,		/* ScrollControl */
+		.enumeration = &snd_audient_id14_id_key,
+		.unit = ID14_MON,
+		.sel = ID14_MON_ID_KEY,
+	},
+	[SND_AUDIENT_TYPE_ID14_MON_TALKBACK_SRC] = {
+		.type = SNDRV_CTL_ELEM_TYPE_ENUMERATED,
+		.flags = ID14_WO,
+		.len = 1,
+		.init = 0xff,		/* None */
+		.enumeration = &snd_audient_id14_talkback,
+		.unit = ID14_MON,
+		.sel = ID14_MON_TALKBACK_SRC,
+	},
+	/* the power-on mode is S/PDIF */
+	[SND_AUDIENT_TYPE_ID14_OPTICAL_MODE] = {
+		.type = SNDRV_CTL_ELEM_TYPE_ENUMERATED,
+		.flags = ID14_WO,
+		.len = 4,
+		.init = 1,		/* S/PDIF */
+		.enumeration = &snd_audient_id14_optical,
+		.unit = ID14_IT_DIGITAL,
+		.sel = ID14_IT_OPTICAL_MODE,
+	},
 };
 
 
@@ -182,6 +436,62 @@ static const char *const snd_audient_evo4_matrix[] = {
 	NULL
 };
 
+#define ID14_CTRL(name_, type_, offs_, chans_)		\
+	{						\
+		.name = (name_),			\
+		.type = SND_AUDIENT_TYPE_ID14_##type_,	\
+		.channels = (chans_),			\
+		.hwchannels = (chans_),			\
+		.val_offs = (offs_),			\
+	}
+
+static const struct snd_audient_ctrl snd_audient_id14_mk1_controls[] = {
+	ID14_CTRL("Monitor Speaker Playback Volume", MON_VOLUME, 0, 1),
+	ID14_CTRL("Monitor Speaker Playback Switch", MON_CUT, 0, 1),
+	ID14_CTRL("Monitor Dim Playback Switch", MON_DIM, 0, 1),
+	ID14_CTRL("Monitor Dim Level Playback Volume", MON_DIM_LEVEL, 0, 1),
+	ID14_CTRL("Monitor Mono Playback Switch", MON_MONO, 0, 1),
+	ID14_CTRL("Monitor Mono Mode Playback Enum", MON_MONO_MODE, 0, 1),
+	ID14_CTRL("Monitor Polarity Invert Playback Switch", MON_POLARITY, 0, 1),
+	ID14_CTRL("Monitor Headphone Playback Volume", HP_VOLUME, 3, 2),
+	ID14_CTRL("Monitor Headphone Playback Switch", HP_MUTE, 3, 2),
+	ID14_CTRL("Talkback Playback Switch", MON_TALKBACK, 0, 1),
+	ID14_CTRL("Main Out L Source Playback Enum", ROUTE_MAIN_L, 0, 1),
+	ID14_CTRL("Main Out R Source Playback Enum", ROUTE_MAIN_R, 1, 1),
+	ID14_CTRL("Headphone L Source Playback Enum", ROUTE_HP_L, 2, 1),
+	ID14_CTRL("Headphone R Source Playback Enum", ROUTE_HP_R, 3, 1),
+	ID14_CTRL("Mic 1 Boost Capture Switch", IN_BOOST, 1, 1),
+	ID14_CTRL("Mic 2 Boost Capture Switch", IN_BOOST, 2, 1),
+	ID14_CTRL("Mic 1 Polarity Invert Capture Switch", IN_POLARITY, 1, 1),
+	ID14_CTRL("Mic 2 Polarity Invert Capture Switch", IN_POLARITY, 2, 1),
+	/* Digi 3-8 refuse polarity (CN 5-10 stall) */
+	ID14_CTRL("Digi 1 Polarity Invert Capture Switch", IN_POLARITY, 3, 1),
+	ID14_CTRL("Digi 2 Polarity Invert Capture Switch", IN_POLARITY, 4, 1),
+	ID14_CTRL("iD Key Function Playback Enum", MON_ID_KEY, 0, 1),
+	ID14_CTRL("Talkback Source Capture Enum", MON_TALKBACK_SRC, 0, 1),
+	ID14_CTRL("Digital In Mode Capture Enum", OPTICAL_MODE, 0, 1),
+	{ 0 }, /* sentinel */
+};
+
+/*
+ * iD14 MkI mixer: unit 60, 14 inputs x 4 outputs, CN = input * 4 + output
+ * (outputs Main L, Main R, Cue L, Cue R). Each input has a Main and a Cue
+ * pair, so with 2 channels per element, element n starts at CN 2 * n.
+ */
+#define ID14_MIX(in) "Mix Main " in " Playback Volume",	\
+		     "Mix Cue " in " Playback Volume"
+
+static const char *const snd_audient_id14_mk1_matrix[] = {
+	ID14_MIX("Mic 1"), ID14_MIX("Mic 2"),
+	ID14_MIX("Digi 1"), ID14_MIX("Digi 2"),
+	ID14_MIX("Digi 3"), ID14_MIX("Digi 4"),
+	ID14_MIX("Digi 5"), ID14_MIX("Digi 6"),
+	ID14_MIX("Digi 7"), ID14_MIX("Digi 8"),
+	ID14_MIX("DAW 1"), ID14_MIX("DAW 2"),
+	ID14_MIX("DAW 3"), ID14_MIX("DAW 4"),
+	NULL
+};
+
 static const struct audient_devinfo {
 	u32 usb_id;
 	const struct snd_audient_ctrl *controls;
@@ -194,6 +504,12 @@ static const struct audient_devinfo {
 		.matrix_names = snd_audient_evo4_matrix,
 		.matrix_channels = 2,
 	},
+	{
+		.usb_id = USB_ID(USB_AUDIENT_VID, USB_ID14_MK1_PID),
+		.controls = snd_audient_id14_mk1_controls,
+		.matrix_names = snd_audient_id14_mk1_matrix,
+		.matrix_channels = 2,
+	},
 	{ 0 } /* sentinel */
 };
 
diff --git a/sound/usb/mixer_audient.h b/sound/usb/mixer_audient.h
index db4f31e02b5e1..5d705ffe2cfa1 100644
--- a/sound/usb/mixer_audient.h
+++ b/sound/usb/mixer_audient.h
@@ -6,6 +6,7 @@
 
 #define USB_AUDIENT_VID (0x2708)
 #define USB_EVO4_PID (0x0006)
+#define USB_ID14_MK1_PID (0x0002)
 
 int snd_audient_controls_create(struct usb_mixer_interface *mixer);
 
diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
index 31f8d02534373..b88244b12a98a 100644
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -542,7 +542,9 @@ static const struct usbmix_name_map audient_id14_map[] = {
 
 /* Audient iD14 MkI: model-specific control map. */
 static const struct usbmix_name_map audient_id14_mk1_map[] = {
+	{ 11, NULL },			/* FU, see mixer_audient.c */
 	{ 12, "Monitor Mix Playback" },	/* FU, partial coverage */
+	{ 60, NULL },			/* MU, see mixer_audient.c */
 	{}
 };
 
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index c250ebea5af51..c68aa6f17e454 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -4781,6 +4781,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
 		break;
 
 	case USB_ID(USB_AUDIENT_VID, USB_EVO4_PID): /* Audient EVO 4 */
+	case USB_ID(USB_AUDIENT_VID, USB_ID14_MK1_PID): /* Audient iD14 MkI */
 		err = snd_audient_controls_create(mixer);
 		break;
 
-- 
2.47.3


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

* [PATCH v2 20/21] ALSA: mixer_audient: Unify snd_audient_*_set/get functions for different types
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (18 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 19/21] ALSA: mixer_audient: Add Audient iD14 MkI controls Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 16:44 ` [PATCH v2 21/21] ALSA: mixer_audient: Replace the Audient iD14 MkI FU 12 control Will Porter
  2026-11-30 18:08 ` [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

From: Christian Ruppert <arc@gmx.li>

The set/get functions were originally type specific. With more and more
types needed we reached the threshold where it makes sense to merge them
into one function for get and one for set and handle the type differences
in a switch statement. Perform this merge to reduce code duplication.

Signed-off-by: Christian Ruppert <arc@gmx.li>
[will: send no GET for channels the device does not have]
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 304 ++++++++++++--------------------------
 1 file changed, 95 insertions(+), 209 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index 62f87283485d0..cc33ccf83c1c2 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -678,83 +678,6 @@ static int snd_audient_raw_set_one(struct usb_mixer_elem_info *const elem,
 }
 
 
-static int snd_ctl_audient_boolean_get(struct snd_kcontrol *kctl,
-				       struct snd_ctl_elem_value *ctl_val)
-{
-	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *const mixer = elem->head.mixer;
-
-	const unsigned int nchan = snd_audient_kctl_channels(kctl);
-	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
-	const struct snd_audient_ctrl_type *const ctype
-						= snd_audient_kctl_type(kctl);
-	const u8 base = snd_audient_kctl_cidxoffs(kctl);
-
-	int i;
-
-	CLASS(snd_usb_lock, pm)(mixer->chip);
-	if (pm.err < 0)
-		return pm.err;
-	/* serializes the transfers and the cache, also between gets */
-	guard(mutex)(&mixer->lock);
-
-	for (i = 0; i < hwchan; i++) {
-		u32 buf;
-		int ret;
-
-		ret = snd_audient_raw_get_one(elem, ctype, base + i, &buf);
-		if (ret == -ENODATA)	/* unknown write-only value: off */
-			buf = ctype->min.integer;
-		else if (ret < 0)
-			return ret;
-
-		ctl_val->value.integer.value[i] = (buf == ctype->min.integer)
-						  ? false : true;
-	}
-
-	for (; i < nchan; i++)
-		ctl_val->value.integer.value[i] = 0;
-
-	return 0;
-}
-
-static int snd_ctl_audient_boolean_set(struct snd_kcontrol *kctl,
-				       struct snd_ctl_elem_value *ctl_val)
-{
-	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *const mixer = elem->head.mixer;
-
-	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
-	const struct snd_audient_ctrl_type *const ctype
-						= snd_audient_kctl_type(kctl);
-	const u8 base = snd_audient_kctl_cidxoffs(kctl);
-
-	int changed = 0;
-	int i;
-
-	CLASS(snd_usb_lock, pm)(mixer->chip);
-	if (pm.err < 0)
-		return pm.err;
-	/* serializes the transfers and the cache, also between gets */
-	guard(mutex)(&mixer->lock);
-
-	for (i = 0; i < hwchan; i++) {
-		u32 buf = ctl_val->value.integer.value[i] ? ctype->max.integer
-							  : ctype->min.integer;
-		int ret;
-
-		ret = snd_audient_raw_set_one(elem, ctype, base + i, buf,
-					      false);
-		if (ret < 0)
-			return ret;
-
-		if (ret)
-			changed = 1;
-	}
-
-	return changed;
-}
-
 /*
  * With a step size (res), an integer control counts steps from min:
  * 0 ... (max - min) / res. Without one it shows the device value.
@@ -773,8 +696,9 @@ snd_audient_int_min(const struct snd_audient_ctrl_type *ctype)
 }
 
 static long snd_audient_int_to_ctl(const struct snd_audient_ctrl_type *ctype,
-				   long val)
+				   u32 buf)
 {
+	s32 val = (s32)buf;
 	val = clamp(val, ctype->min.integer, ctype->max.integer);
 	if (!ctype->res)
 		return val;
@@ -784,96 +708,19 @@ static long snd_audient_int_to_ctl(const struct snd_audient_ctrl_type *ctype,
 		   snd_audient_int_max(ctype));
 }
 
-static inline long
+static inline u32
 snd_audient_int_from_ctl(const struct snd_audient_ctrl_type *ctype, long val)
 {
-	return ctype->res ? ctype->min.integer + val * ctype->res : val;
-}
+	s32 ret;
 
-static int snd_ctl_audient_integer_get(struct snd_kcontrol *kctl,
-				   struct snd_ctl_elem_value *ctl_val)
-{
-	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *const mixer = elem->head.mixer;
-
-	const unsigned int nchan = snd_audient_kctl_channels(kctl);
-	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
-	const struct snd_audient_ctrl_type *const ctype
-						= snd_audient_kctl_type(kctl);
-	const u8 base = snd_audient_kctl_cidxoffs(kctl);
-
-	int i;
+	if (ctype->res)
+		ret = ctype->min.integer + val * ctype->res;
+	else
+		ret = val;
 
-	CLASS(snd_usb_lock, pm)(mixer->chip);
-	if (pm.err < 0)
-		return pm.err;
-	/* serializes the transfers and the cache, also between gets */
-	guard(mutex)(&mixer->lock);
-
-	for (i = 0; i < hwchan; i++) {
-		s32 val;
-		int ret;
-
-		ret = snd_audient_raw_get_one(elem, ctype, base + i, &val);
-		if (ret == -ENODATA)	/* unknown write-only value: minimum */
-			val = ctype->min.integer;
-		else if (ret < 0)
-			return ret;
-
-		ctl_val->value.integer.value[i] =
-			snd_audient_int_to_ctl(ctype, val);
-	}
-
-	for (; i < nchan; i++)
-		ctl_val->value.integer.value[i] = snd_audient_int_min(ctype);
-
-	return 0;
+	return (u32)ret;
 }
 
-static int snd_ctl_audient_integer_set(struct snd_kcontrol *kctl,
-				   struct snd_ctl_elem_value *ctl_val)
-{
-	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
-	struct usb_mixer_interface *mixer = elem->head.mixer;
-
-	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
-	const struct snd_audient_ctrl_type *const ctype
-						= snd_audient_kctl_type(kctl);
-	const u8 base = snd_audient_kctl_cidxoffs(kctl);
-
-	int changed = 0;
-	int i;
-
-	for (i = 0; i < hwchan; i++) {
-		long val = ctl_val->value.integer.value[i];
-
-		if (val < snd_audient_int_min(ctype) ||
-		    val > snd_audient_int_max(ctype))
-			return -EINVAL;
-	}
-
-	CLASS(snd_usb_lock, pm)(mixer->chip);
-	if (pm.err < 0)
-		return pm.err;
-	/* serializes the transfers and the cache, also between gets */
-	guard(mutex)(&mixer->lock);
-
-	for (i = 0; i < hwchan; i++) {
-		s32 val = snd_audient_int_from_ctl(ctype,
-						   ctl_val->value.integer.value[i]);
-		int ret;
-
-		ret = snd_audient_raw_set_one(elem, ctype, base + i, val,
-					      false);
-		if (ret < 0)
-			return ret;
-
-		if (ret)
-			changed = 1;
-	}
-
-	return changed;
-}
 
 /* The item index of a device value, or -EIO if the value is not in the list */
 static int snd_audient_enum_item(const struct snd_audient_enum *e, u32 value)
@@ -887,8 +734,9 @@ static int snd_audient_enum_item(const struct snd_audient_enum *e, u32 value)
 	return -EIO;
 }
 
-static int snd_ctl_audient_enum_get(struct snd_kcontrol *kctl,
-				    struct snd_ctl_elem_value *ctl_val)
+
+static int snd_ctl_audient_get(struct snd_kcontrol *kctl,
+				       struct snd_ctl_elem_value *ctl_val)
 {
 	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
 	struct usb_mixer_interface *const mixer = elem->head.mixer;
@@ -899,7 +747,7 @@ static int snd_ctl_audient_enum_get(struct snd_kcontrol *kctl,
 						= snd_audient_kctl_type(kctl);
 	const u8 base = snd_audient_kctl_cidxoffs(kctl);
 
-	unsigned int i;
+	int i;
 
 	CLASS(snd_usb_lock, pm)(mixer->chip);
 	if (pm.err < 0)
@@ -907,32 +755,57 @@ static int snd_ctl_audient_enum_get(struct snd_kcontrol *kctl,
 	/* serializes the transfers and the cache, also between gets */
 	guard(mutex)(&mixer->lock);
 
-	for (i = 0; i < hwchan; i++) {
-		u32 val;
-		int item;
-		int ret;
-
-		ret = snd_audient_raw_get_one(elem, ctype, base + i, &val);
-		if (ret == -ENODATA)	/* unknown write-only value: init */
-			val = ctype->init;
-		else if (ret < 0)
-			return ret;
-
-		item = snd_audient_enum_item(ctype->enumeration, val);
-		if (item < 0)
-			return item;
+	for (i = 0; i < nchan; i++) {
+		u32 buf = 0;
+		long ret;
+
+		/* channels the device does not have are not read */
+		if (i < hwchan) {
+			ret = snd_audient_raw_get_one(elem, ctype, base + i,
+						      &buf);
+			if (ret == -ENODATA)	/* unknown write-only value */
+				buf = ctype->init;
+			else if (ret < 0)
+				return ret;
+		}
 
-		ctl_val->value.enumerated.item[i] = item;
+		switch (ctype->type) {
+		case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
+			if (i >= hwchan)
+				ctl_val->value.integer.value[i] = 0;
+			else if (buf == ctype->min.integer)
+				ctl_val->value.integer.value[i] = false;
+			else
+				ctl_val->value.integer.value[i] = true;
+			break;
+		case SNDRV_CTL_ELEM_TYPE_INTEGER:
+			if (i >= hwchan)
+				ctl_val->value.integer.value[i] =
+					snd_audient_int_min(ctype);
+			else
+				ctl_val->value.integer.value[i] =
+					snd_audient_int_to_ctl(ctype, buf);
+			break;
+		case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
+			if (i >= hwchan) {
+				ctl_val->value.enumerated.item[i] = 0;
+			} else {
+				ret = snd_audient_enum_item(ctype->enumeration,
+							    buf);
+				if (ret < 0)
+					return ret;
+
+				ctl_val->value.enumerated.item[i] = ret;
+			}
+			break;
+		}
 	}
 
-	for (; i < nchan; i++)
-		ctl_val->value.enumerated.item[i] = 0;
-
 	return 0;
 }
 
-static int snd_ctl_audient_enum_set(struct snd_kcontrol *kctl,
-				    struct snd_ctl_elem_value *ctl_val)
+static int snd_ctl_audient_set(struct snd_kcontrol *kctl,
+			       struct snd_ctl_elem_value *ctl_val)
 {
 	struct usb_mixer_elem_info *const elem = snd_kcontrol_chip(kctl);
 	struct usb_mixer_interface *const mixer = elem->head.mixer;
@@ -940,15 +813,28 @@ static int snd_ctl_audient_enum_set(struct snd_kcontrol *kctl,
 	const unsigned int hwchan = snd_audient_kctl_hwchannels(kctl);
 	const struct snd_audient_ctrl_type *const ctype
 						= snd_audient_kctl_type(kctl);
-	const struct snd_audient_enum *const e = ctype->enumeration;
 	const u8 base = snd_audient_kctl_cidxoffs(kctl);
 
-	unsigned int i;
+	typeof(ctl_val->value) *const v = &ctl_val->value;
+	const struct snd_audient_enum *const e = ctype->enumeration;
+
 	int changed = 0;
+	int i;
 
-	for (i = 0; i < hwchan; i++)
-		if (ctl_val->value.enumerated.item[i] >= e->items)
-			return -EINVAL;
+
+	for (i = 0; i < hwchan; i++) {
+		switch (ctype->type) {
+		case SNDRV_CTL_ELEM_TYPE_INTEGER:
+			if (v->integer.value[i] < snd_audient_int_min(ctype) ||
+			    v->integer.value[i] > snd_audient_int_max(ctype))
+				return -EINVAL;
+			break;
+		case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
+			if (v->enumerated.item[i] >= e->items)
+				return -EINVAL;
+			break;
+		}
+	}
 
 	CLASS(snd_usb_lock, pm)(mixer->chip);
 	if (pm.err < 0)
@@ -957,11 +843,25 @@ static int snd_ctl_audient_enum_set(struct snd_kcontrol *kctl,
 	guard(mutex)(&mixer->lock);
 
 	for (i = 0; i < hwchan; i++) {
-		const unsigned int item = ctl_val->value.enumerated.item[i];
+		u32 val;
 		int ret;
 
-		ret = snd_audient_raw_set_one(elem, ctype, base + i,
-					      e->values[item], false);
+		switch (ctype->type) {
+		case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
+			val = v->integer.value[i] ? ctype->max.integer
+						  : ctype->min.integer;
+			break;
+		case SNDRV_CTL_ELEM_TYPE_INTEGER:
+			val = snd_audient_int_from_ctl(ctype,
+						       v->integer.value[i]);
+			break;
+		case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
+			val = e->values[v->enumerated.item[i]];
+			break;
+		}
+
+		ret = snd_audient_raw_set_one(elem, ctype, base + i, val,
+					      false);
 		if (ret < 0)
 			return ret;
 
@@ -1024,22 +924,8 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 			   : SNDRV_CTL_ELEM_ACCESS_VOLATILE)
 			| (ctype->tlv ? SNDRV_CTL_ELEM_ACCESS_TLV_READ : 0);
 
-	switch (ctype->type) {
-	case SNDRV_CTL_ELEM_TYPE_INTEGER:
-		knew.get = snd_ctl_audient_integer_get;
-		knew.put = snd_ctl_audient_integer_set;
-		break;
-	case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
-		knew.get = snd_ctl_audient_boolean_get;
-		knew.put = snd_ctl_audient_boolean_set;
-		break;
-	case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
-		knew.get = snd_ctl_audient_enum_get;
-		knew.put = snd_ctl_audient_enum_set;
-		break;
-	default:
-		return -EINVAL;
-	}
+	knew.get = snd_ctl_audient_get;
+	knew.put = snd_ctl_audient_set;
 
 	elem = kzalloc_obj(*elem);
 	if (!elem)
-- 
2.47.3


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

* [PATCH v2 21/21] ALSA: mixer_audient: Replace the Audient iD14 MkI FU 12 control
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (19 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 20/21] ALSA: mixer_audient: Unify snd_audient_*_set/get functions for different types Will Porter
@ 2026-11-30 16:44 ` Will Porter
  2026-11-30 18:08 ` [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 16:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela
  Cc: Christian Ruppert, linux-sound, linux-kernel, Neil Andrews,
	Nikita Tarasov

Feature unit 12 sets the level of the mixer outputs: channels 1-2 Main,
3-4 Cue. Two firmware faults make the generic control wrong on the
MkI:

- GET CUR does not return the FU 12 value. It returns a reply buffer
  that the device shares with FU 10, MU 60 and XU 51. The buffer holds
  the data of the last GET or SET to any of them. So the generic
  sticky-GET check passes, because GET echoes the SET just sent. The
  check then writes the stale value that it read first to channel 1.
- Main L ignores its level, but Main R applies it. So any Main value
  other than 0 dB unbalances the main outputs. audient_id14_map already
  records this asymmetry. A loopback cable measured it: Main R at
  -20 dB and -40 dB changes its output by -20.0 and -40.9 dB. Main L
  at the same values changes nothing. Cue L and Cue R both work: Cue L
  follows the set value within about 1 dB down to at least -70 dB; the
  headphone residual hides lower levels.

Replace the generic control with one of the same name, count and range.
It is "Monitor Mix Playback Volume", with four values from 0 to 127 in
1 dB steps. 127 is 0 dB. For Cue, value 0 writes 0x8000 (-128 dB, one
step below the GET RANGE minimum of -127 dB), and the TLV declares it as
mute. On Cue L, value 0 gives no output above the fixed headphone
residual, about 76 dB below 0 dB. The four values keep the Main L/R,
Cue L/R layout of existing saved ALSA states.

The control holds Main at 0 dB: Main L does not apply a level, so 0 dB
on Main R keeps the main outputs balanced. A put always sends 0 dB to
channels 1-2, whatever Main values it asks for. After a successful
write, get reports 127 (0 dB) for them. For Cue the control shows the
last value the device accepted. At probe the driver writes Main 0 dB and
Cue muted, once per channel. A channel whose probe write fails reads as
mute until a put succeeds.

The iD14 MkI profile in alsa-ucm-conf writes 127,127,127,127 to this
control at boot and when its HiFi verb starts. The new control accepts
that write: Main stays at 0 dB and Cue goes to 0 dB, the same result as
with the generic control.

Differences from the generic control:
- Value 0 is now mute. It was -127 dB.
- The control holds Main at 0 dB. A Main R attenuation stored with the
  generic control (for example 107, -20 dB) now restores as 0 dB, which
  raises Main R by 20 dB. Main L never applied that attenuation, so
  Main R comes up to the level that Main L already had. FU 12 comes
  before the monitor controller (XU 54) and the headphone level
  (FU 10), so the volume knob still sets the listening level.
- Cue starts muted at every probe. An output routed to the Cue Mix
  keeps that routing across a module reload or a rebind. On mains
  power it also keeps it across a replug. If the probe writes succeed,
  that output is then muted until user space sets the Cue level
  (alsactl restore or the UCM boot write). On bus power the MkI returns
  to DAW Thru when it enumerates, so no output is on the Cue Mix at
  probe.

The control is a new type in the device table, with the INIT_HW, CACHE
and GET_BROKEN flags. GET_BROKEN, because of the shared reply buffer:
the driver sends no GET to FU 12. The unified get and put convert
between the control value and the device value, and hold Main at 0 dB.

Co-developed-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Christian Ruppert <arc@gmx.li>
Signed-off-by: Will Porter <mrwillporter@gmail.com>
---
 sound/usb/mixer_audient.c | 124 +++++++++++++++++++++++++++++++++++---
 sound/usb/mixer_maps.c    |   2 +-
 2 files changed, 115 insertions(+), 11 deletions(-)

diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c
index cc33ccf83c1c2..93fad4b74e18d 100644
--- a/sound/usb/mixer_audient.c
+++ b/sound/usb/mixer_audient.c
@@ -55,17 +55,45 @@ enum snd_audient_type {
 	SND_AUDIENT_TYPE_ID14_MON_ID_KEY,
 	SND_AUDIENT_TYPE_ID14_MON_TALKBACK_SRC,
 	SND_AUDIENT_TYPE_ID14_OPTICAL_MODE,
+	SND_AUDIENT_TYPE_ID14_FU12,
 	SND_AUDIENT_TYPE_NCTYPES
 };
 
 /* Mixer matrix: -128dB (mute) to +6dB */
 static const DECLARE_TLV_DB_MINMAX_MUTE(snd_audient_tlv_mixer, -12800, 600);
 
+/*
+ * iD14 MkI FU 12, the mixer output level: CN 1-2 Main, 3-4 Cue. GET RANGE
+ * works (-127 ... 0 dB, 1 dB steps), but GET CUR returns a reply buffer the
+ * device shares with other units, not the FU 12 value. So the generic
+ * control shows stale data, and its sticky-GET check passes and then writes
+ * that stale value to Main L.
+ *
+ * The firmware ignores Main L (CN 1) but applies Main R (CN 2), so any Main
+ * level other than 0 dB unbalances the main outputs (Cue L and Cue R both
+ * work). This control holds Main at 0 dB: a put sends 0 dB to CN 1-2
+ * whatever it asks for, and get reports it.
+ *
+ * It keeps the generic control's name and format: four values, 0 ... 127
+ * in 1 dB steps, 127 = 0 dB, 0 = mute (0x8000). It shows the last value the
+ * device accepted, and every put sends all four channels.
+ */
+#define ID14_FU12_MAIN_CHANNELS	2	/* CN 1-2, held at 0 dB */
+#define ID14_FU12_MAX		127
+#define ID14_FU12_MUTE		0
+#define ID14_FU12_HW_MUTE	(-128 * 256)
+
+static const DECLARE_TLV_DB_MINMAX_MUTE(snd_audient_tlv_id14_fu12, -12700, 0);
+
+/* control type flags */
 #define SND_AUDIENT_CTYPE_FLAGS_SIGNED		BIT(0)
 #define SND_AUDIENT_CTYPE_FLAGS_INIT_HW		BIT(1)
 #define SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN	BIT(2)
 #define SND_AUDIENT_CTYPE_FLAGS_CACHE		BIT(3)
 
+/* Private control element types for quirky controls */
+#define SNDRV_AUDIENT_CTL_ELEM_TYPE_ID14_FU12	(SNDRV_CTL_ELEM_TYPE_LAST + 1)
+
 /*
  * An enumerated control: item i sends values[i]. A get of a device value
  * outside the list returns -EIO; it does not show a wrong item.
@@ -376,6 +404,21 @@ static const struct snd_audient_ctrl_type {
 		.unit = ID14_IT_DIGITAL,
 		.sel = ID14_IT_OPTICAL_MODE,
 	},
+	[SND_AUDIENT_TYPE_ID14_FU12] = {
+		.type = SNDRV_AUDIENT_CTL_ELEM_TYPE_ID14_FU12,
+		.flags = SND_AUDIENT_CTYPE_FLAGS_SIGNED
+			 | SND_AUDIENT_CTYPE_FLAGS_INIT_HW
+			 | SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN
+			 | SND_AUDIENT_CTYPE_FLAGS_CACHE,
+		.len = 2,
+		.min.integer = -127 * 256,
+		.max.integer = 0,
+		.init = ID14_FU12_HW_MUTE,
+		.res = 256,
+		.unit = ID14_FU_MIX,
+		.sel = UAC_FU_VOLUME,
+		.tlv = snd_audient_tlv_id14_fu12,
+	},
 };
 
 
@@ -470,6 +513,7 @@ static const struct snd_audient_ctrl snd_audient_id14_mk1_controls[] = {
 	ID14_CTRL("iD Key Function Playback Enum", MON_ID_KEY, 0, 1),
 	ID14_CTRL("Talkback Source Capture Enum", MON_TALKBACK_SRC, 0, 1),
 	ID14_CTRL("Digital In Mode Capture Enum", OPTICAL_MODE, 0, 1),
+	ID14_CTRL("Monitor Mix Playback Volume", FU12, 1, 4),
 	{ 0 }, /* sentinel */
 };
 
@@ -734,6 +778,31 @@ static int snd_audient_enum_item(const struct snd_audient_enum *e, u32 value)
 	return -EIO;
 }
 
+static inline u32
+snd_audient_fu12_from_ctl(const struct snd_audient_ctrl_type *ctype, long val)
+{
+	s32 ret;
+
+	if (val == ID14_FU12_MUTE)
+		ret = ID14_FU12_HW_MUTE;
+	else
+		ret = ctype->min.integer + val * ctype->res;
+
+	return (u32)ret;
+}
+
+static inline long
+snd_audient_fu12_to_ctl(const struct snd_audient_ctrl_type *ctype, u32 buf)
+{
+	s32 val = (s32)buf;
+
+	if (val == ID14_FU12_HW_MUTE)
+		return ID14_FU12_MUTE;
+	else
+		return min(DIV_ROUND_CLOSEST(val - ctype->min.integer,
+					     (long)ctype->res),
+			   snd_audient_int_max(ctype));
+}
 
 static int snd_ctl_audient_get(struct snd_kcontrol *kctl,
 				       struct snd_ctl_elem_value *ctl_val)
@@ -798,6 +867,10 @@ static int snd_ctl_audient_get(struct snd_kcontrol *kctl,
 				ctl_val->value.enumerated.item[i] = ret;
 			}
 			break;
+		case SNDRV_AUDIENT_CTL_ELEM_TYPE_ID14_FU12:
+			ctl_val->value.integer.value[i] =
+					snd_audient_fu12_to_ctl(ctype, buf);
+			break;
 		}
 	}
 
@@ -833,6 +906,11 @@ static int snd_ctl_audient_set(struct snd_kcontrol *kctl,
 			if (v->enumerated.item[i] >= e->items)
 				return -EINVAL;
 			break;
+		case SNDRV_AUDIENT_CTL_ELEM_TYPE_ID14_FU12:
+			if (v->integer.value[i] < 0
+			    || v->integer.value[i] > ID14_FU12_MAX)
+				return -EINVAL;
+			break;
 		}
 	}
 
@@ -858,6 +936,14 @@ static int snd_ctl_audient_set(struct snd_kcontrol *kctl,
 		case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
 			val = e->values[v->enumerated.item[i]];
 			break;
+		case SNDRV_AUDIENT_CTL_ELEM_TYPE_ID14_FU12:
+			if (i < ID14_FU12_MAIN_CHANNELS) {
+				val = ctype->max.integer;
+			} else {
+				val = snd_audient_fu12_from_ctl(ctype,
+							v->integer.value[i]);
+			}
+			break;
 		}
 
 		ret = snd_audient_raw_set_one(elem, ctype, base + i, val,
@@ -878,25 +964,30 @@ static int snd_ctl_audient_info(struct snd_kcontrol *kctl,
 	const struct snd_audient_ctrl_type *const ctype
 						= snd_audient_kctl_type(kctl);
 
+	uinfo->type = ctype->type;
+	uinfo->count = snd_audient_kctl_channels(kctl);
+
 	switch (ctype->type) {
-	case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
-		return snd_ctl_enum_info(uinfo,
-					 snd_audient_kctl_channels(kctl),
-					 ctype->enumeration->items,
-					 ctype->enumeration->texts);
 	case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
 		uinfo->value.integer.min = 0;
 		uinfo->value.integer.max = 1;
 		break;
-	default:
+	case SNDRV_CTL_ELEM_TYPE_INTEGER:
 		uinfo->value.integer.min = snd_audient_int_min(ctype);
 		uinfo->value.integer.max = snd_audient_int_max(ctype);
 		break;
+	case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
+		return snd_ctl_enum_info(uinfo,
+					 snd_audient_kctl_channels(kctl),
+					 ctype->enumeration->items,
+					 ctype->enumeration->texts);
+	case SNDRV_AUDIENT_CTL_ELEM_TYPE_ID14_FU12:
+		uinfo->value.integer.min = 0;
+		uinfo->value.integer.max = ID14_FU12_MAX;
+		uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+		break;
 	}
 
-	uinfo->type = ctype->type;
-	uinfo->count = snd_audient_kctl_channels(kctl);
-
 	return 0;
 }
 
@@ -948,9 +1039,22 @@ static int snd_audient_add_ctrl(struct usb_mixer_interface *mixer,
 		int i;
 
 		for (i = 0; i < ctrl->hwchannels; i++) {
+			u32 init;
+
+			switch (ctype->type) {
+			case SNDRV_AUDIENT_CTL_ELEM_TYPE_ID14_FU12:
+				if (i < ID14_FU12_MAIN_CHANNELS)
+					init = ctype->max.integer;
+				else
+					init = ctype->init;
+				break;
+			default:
+				init = ctype->init;
+				break;
+			}
 			ret = snd_audient_raw_set_one(elem, ctype,
 						      ctrl->val_offs + i,
-						      ctype->init, true);
+						      init, true);
 			if (ret < 0)
 				usb_audio_warn(mixer->chip,
 					       "%s: cannot set channel %d (%d)\n",
diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
index b88244b12a98a..0ff180e450b5b 100644
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -543,7 +543,7 @@ static const struct usbmix_name_map audient_id14_map[] = {
 /* Audient iD14 MkI: model-specific control map. */
 static const struct usbmix_name_map audient_id14_mk1_map[] = {
 	{ 11, NULL },			/* FU, see mixer_audient.c */
-	{ 12, "Monitor Mix Playback" },	/* FU, partial coverage */
+	{ 12, NULL },			/* FU, see mixer_audient.c */
 	{ 60, NULL },			/* MU, see mixer_audient.c */
 	{}
 };
-- 
2.47.3


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

* Re: [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support
  2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
                   ` (20 preceding siblings ...)
  2026-11-30 16:44 ` [PATCH v2 21/21] ALSA: mixer_audient: Replace the Audient iD14 MkI FU 12 control Will Porter
@ 2026-11-30 18:08 ` Will Porter
  21 siblings, 0 replies; 23+ messages in thread
From: Will Porter @ 2026-11-30 18:08 UTC (permalink / raw)
  To: Christian Ruppert
  Cc: Takashi Iwai, Jaroslav Kysela, linux-sound, linux-kernel,
	Neil Andrews, Nikita Tarasov

Hi Christian,

sashiko-bot flagged three things in patches 2, 4 and 20. I'd like to
fold these changes into a v3. Any concerns, or would you rather handle
them another way?

1. Patch 20 ("Unify snd_audient_*_set/get functions for different
   types"): in snd_ctl_audient_set(), the switch that converts the
   control value has no default, so val can reach
   snd_audient_raw_set_one() unset. All current control types are
   covered, so this path is unreachable. With gcc 15, W=2 warns
   (-Wmaybe-uninitialized). I'd add

	default:
		return -EINVAL;

   and say so in the existing [will: ...] line. Patch 21 then adds its
   FU 12 case above the default.

2. Patch 2 ("Fix endianness of boolean inversion"): the commit message
   names snd_ctl_evo_boolean_get(), but the change is in
   snd_ctl_evo_boolean_set(). I'd correct the name.

3. Patches 2 and 4: add

	Fixes: 025877a3833d ("Add Audient EVO4 mixer quirks")

   That commit is in mainline since v7.4-rc1, so I'd add the tags.
   OK with you?

Takashi: patches 1, 2 and 4 fix Christian's mixer_evo driver, which
is in mainline since v7.4-rc1. Would you prefer to take those
separately for 7.4? If so, I'll base v3 on them and keep patch 3 in
the series. I plan to send v3 in a few days, with these changes and
any other review comments.

Thanks,
Will

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

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

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 16:44 [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter
2026-11-30 16:44 ` [PATCH v2 01/21] ALSA: mixer_evo: Remove double end marker device list Will Porter
2026-11-30 16:44 ` [PATCH v2 02/21] ALSA: mixer_evo: Fix endianness of boolean inversion Will Porter
2026-11-30 16:44 ` [PATCH v2 03/21] ALSA: mixer_evo: Add tlv for mixer channels Will Porter
2026-11-30 16:44 ` [PATCH v2 04/21] ALSA: mixer_evo: Add missing snd_usb_lock calls Will Porter
2026-11-30 16:44 ` [PATCH v2 05/21] ALSA: rename mixer_evo to mixer_audient Will Porter
2026-11-30 16:44 ` [PATCH v2 06/21] ALSA: mixer_audient: explicitly define full control names Will Porter
2026-11-30 16:44 ` [PATCH v2 07/21] ALSA: mixer_audient: clarify USB control message definition Will Porter
2026-11-30 16:44 ` [PATCH v2 08/21] ALSA: mixer_audient: Add length check to USB transfer Will Porter
2026-11-30 16:44 ` [PATCH v2 09/21] ALSA: mixer_audient: make USB control transfer size configurable Will Porter
2026-11-30 16:44 ` [PATCH v2 10/21] ALSA: mixer_audient: Allow arbitrary boolean control values Will Porter
2026-11-30 16:44 ` [PATCH v2 11/21] ALSA: mixer_audient: Add integer range checks Will Porter
2026-11-30 16:44 ` [PATCH v2 12/21] ALSA: mixer_audient: Add control initialization at probe Will Porter
2026-11-30 16:44 ` [PATCH v2 13/21] ALSA: mixer_audient: Add readback-free parameter set Will Porter
2026-11-30 16:44 ` [PATCH v2 14/21] ALSA: mixer_audient: add control value caching Will Porter
2026-11-30 16:44 ` [PATCH v2 15/21] ALSA: mixer_audient: Create matrix programmatically Will Porter
2026-11-30 16:44 ` [PATCH v2 16/21] ALSA: mixer_audient: Add a step size to integer controls Will Porter
2026-11-30 16:44 ` [PATCH v2 17/21] ALSA: mixer_audient: Add enumerated controls Will Porter
2026-11-30 16:44 ` [PATCH v2 18/21] ALSA: usb-audio: Give the Audient iD14 MkI its own mixer map Will Porter
2026-11-30 16:44 ` [PATCH v2 19/21] ALSA: mixer_audient: Add Audient iD14 MkI controls Will Porter
2026-11-30 16:44 ` [PATCH v2 20/21] ALSA: mixer_audient: Unify snd_audient_*_set/get functions for different types Will Porter
2026-11-30 16:44 ` [PATCH v2 21/21] ALSA: mixer_audient: Replace the Audient iD14 MkI FU 12 control Will Porter
2026-11-30 18:08 ` [PATCH v2 00/21] ALSA: usb-audio: Audient driver and iD14 MkI support Will Porter

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®