Skip to content

Commit

Permalink
ALSA: usb-audio: Scarlett Gen 2 mixer interface
Browse files Browse the repository at this point in the history
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: Geoffrey D. Bennett <g@b4.vu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Geoffrey D. Bennett authored and Takashi Iwai committed Jul 28, 2019
1 parent 2127c01 commit 9e4d5c1
Show file tree
Hide file tree
Showing 6 changed files with 2,098 additions and 0 deletions.
1 change: 1 addition & 0 deletions sound/usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ snd-usb-audio-objs := card.o \
mixer.o \
mixer_quirks.o \
mixer_scarlett.o \
mixer_scarlett_gen2.o \
mixer_us16x08.o \
pcm.o \
power.o \
Expand Down
4 changes: 4 additions & 0 deletions sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3509,6 +3509,8 @@ void snd_usb_mixer_disconnect(struct usb_mixer_interface *mixer)
usb_kill_urb(mixer->urb);
if (mixer->rc_urb)
usb_kill_urb(mixer->rc_urb);
if (mixer->private_free)
mixer->private_free(mixer);
mixer->disconnected = true;
}

Expand Down Expand Up @@ -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)
{
snd_usb_mixer_inactivate(mixer);
if (mixer->private_suspend)
mixer->private_suspend(mixer);
return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions sound/usb/mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ struct usb_mixer_interface {
struct media_mixer_ctl *media_mixer_ctl;

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 */
Expand Down
7 changes: 7 additions & 0 deletions sound/usb/mixer_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "mixer.h"
#include "mixer_quirks.h"
#include "mixer_scarlett.h"
#include "mixer_scarlett_gen2.h"
#include "mixer_us16x08.h"
#include "helper.h"

Expand Down Expand Up @@ -2258,6 +2259,12 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
err = snd_scarlett_controls_create(mixer);
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 */
err = snd_soundblaster_e1_switch_create(mixer);
break;
Expand Down
Loading

0 comments on commit 9e4d5c1

Please sign in to comment.