Commit 9e4d5c1b authored by Geoffrey D. Bennett's avatar Geoffrey D. Bennett Committed by Takashi Iwai

ALSA: usb-audio: Scarlett Gen 2 mixer interface

Add mixer quirk for the Focusrite Scarlett 6i6, 18i8, and 18i20 Gen 2
audio interfaces. Although the interfaces are USB compliant,
additional input/output level controls and hardware routing/mixing
functionality are available using proprietary USB requests.
Signed-off-by: default avatarGeoffrey D. Bennett <g@b4.vu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2127c01b
...@@ -11,6 +11,7 @@ snd-usb-audio-objs := card.o \ ...@@ -11,6 +11,7 @@ snd-usb-audio-objs := card.o \
mixer.o \ mixer.o \
mixer_quirks.o \ mixer_quirks.o \
mixer_scarlett.o \ mixer_scarlett.o \
mixer_scarlett_gen2.o \
mixer_us16x08.o \ mixer_us16x08.o \
pcm.o \ pcm.o \
power.o \ power.o \
......
...@@ -3509,6 +3509,8 @@ void snd_usb_mixer_disconnect(struct usb_mixer_interface *mixer) ...@@ -3509,6 +3509,8 @@ void snd_usb_mixer_disconnect(struct usb_mixer_interface *mixer)
usb_kill_urb(mixer->urb); usb_kill_urb(mixer->urb);
if (mixer->rc_urb) if (mixer->rc_urb)
usb_kill_urb(mixer->rc_urb); usb_kill_urb(mixer->rc_urb);
if (mixer->private_free)
mixer->private_free(mixer);
mixer->disconnected = true; mixer->disconnected = true;
} }
...@@ -3536,6 +3538,8 @@ static int snd_usb_mixer_activate(struct usb_mixer_interface *mixer) ...@@ -3536,6 +3538,8 @@ static int snd_usb_mixer_activate(struct usb_mixer_interface *mixer)
int snd_usb_mixer_suspend(struct usb_mixer_interface *mixer) int snd_usb_mixer_suspend(struct usb_mixer_interface *mixer)
{ {
snd_usb_mixer_inactivate(mixer); snd_usb_mixer_inactivate(mixer);
if (mixer->private_suspend)
mixer->private_suspend(mixer);
return 0; return 0;
} }
......
...@@ -28,6 +28,10 @@ struct usb_mixer_interface { ...@@ -28,6 +28,10 @@ struct usb_mixer_interface {
struct media_mixer_ctl *media_mixer_ctl; struct media_mixer_ctl *media_mixer_ctl;
bool disconnected; bool disconnected;
void *private_data;
void (*private_free)(struct usb_mixer_interface *mixer);
void (*private_suspend)(struct usb_mixer_interface *mixer);
}; };
#define MAX_CHANNELS 16 /* max logical channels */ #define MAX_CHANNELS 16 /* max logical channels */
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "mixer.h" #include "mixer.h"
#include "mixer_quirks.h" #include "mixer_quirks.h"
#include "mixer_scarlett.h" #include "mixer_scarlett.h"
#include "mixer_scarlett_gen2.h"
#include "mixer_us16x08.h" #include "mixer_us16x08.h"
#include "helper.h" #include "helper.h"
...@@ -2258,6 +2259,12 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) ...@@ -2258,6 +2259,12 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
err = snd_scarlett_controls_create(mixer); err = snd_scarlett_controls_create(mixer);
break; break;
case USB_ID(0x1235, 0x8203): /* Focusrite Scarlett 6i6 2nd Gen */
case USB_ID(0x1235, 0x8204): /* Focusrite Scarlett 18i8 2nd Gen */
case USB_ID(0x1235, 0x8201): /* Focusrite Scarlett 18i20 2nd Gen */
err = snd_scarlett_gen2_controls_create(mixer);
break;
case USB_ID(0x041e, 0x323b): /* Creative Sound Blaster E1 */ case USB_ID(0x041e, 0x323b): /* Creative Sound Blaster E1 */
err = snd_soundblaster_e1_switch_create(mixer); err = snd_soundblaster_e1_switch_create(mixer);
break; break;
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __USB_MIXER_SCARLETT_GEN2_H
#define __USB_MIXER_SCARLETT_GEN2_H
int snd_scarlett_gen2_controls_create(struct usb_mixer_interface *mixer);
#endif /* __USB_MIXER_SCARLETT_GEN2_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment