summaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
authorGeoffrey D. Bennett <g@b4.vu>2023-12-27 04:38:34 +1030
committerTakashi Iwai <tiwai@suse.de>2023-12-29 15:52:13 +0100
commit166e1dfb752665226ab482b62a94c274ec2dea17 (patch)
treeb4e7c923c61942dc368f46bb27b3e966666bed4f /sound/usb
parentc6c9f0cf9dba7e86f1f6cca658bb6b86c5d02530 (diff)
ALSA: scarlett2: Add support for DSP mux channels
The DSP mux channels in the Scarlett 4th Gen appear as SCARLETT2_PORT_TYPE_MIX ports but do not have corresponding mixer controls. Add a dsp_count option to the device info struct to exclude those DSP channels from the num_mix_in/num_mix_out counts. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/b78bdb1a7624d55783f5bf0e1ffbfa47a9e9a800.1703612638.git.g@b4.vu
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer_scarlett2.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index 13f65d963778..59f178dc8050 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -706,6 +706,9 @@ struct scarlett2_device_info {
*/
u8 direct_monitor;
+ /* the number of DSP channels */
+ u8 dsp_count;
+
/* remap analogue outputs; 18i8 Gen 3 has "line 3/4" connected
* internally to the analogue 7/8 outputs
*/
@@ -5827,12 +5830,17 @@ static void scarlett2_count_io(struct scarlett2_data *private)
private->num_mux_srcs = srcs;
private->num_mux_dsts = dsts;
- /* Mixer inputs are mux outputs and vice versa */
+ /* Mixer inputs are mux outputs and vice versa.
+ * Scarlett Gen 4 DSP I/O uses SCARLETT2_PORT_TYPE_MIX but
+ * doesn't have mixer controls.
+ */
private->num_mix_in =
- port_count[SCARLETT2_PORT_TYPE_MIX][SCARLETT2_PORT_OUT];
+ port_count[SCARLETT2_PORT_TYPE_MIX][SCARLETT2_PORT_OUT] -
+ info->dsp_count;
private->num_mix_out =
- port_count[SCARLETT2_PORT_TYPE_MIX][SCARLETT2_PORT_IN];
+ port_count[SCARLETT2_PORT_TYPE_MIX][SCARLETT2_PORT_IN] -
+ info->dsp_count;
/* Number of analogue line outputs */
private->num_line_out =