Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
added (untested) support for 6i6
  • Loading branch information
Tobias Hoffmann committed Dec 20, 2013
1 parent 2a0c320 commit 7a77707
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions sound/usb/mixer.c
Expand Up @@ -2389,6 +2389,7 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
} }


switch (chip->usb_id) { switch (chip->usb_id) {
case USB_ID(0x1235, 0x8012): /* Focusrite Scarlett 6i6 */
case USB_ID(0x1235, 0x8002): /* Focusrite Scarlett 8i6 */ case USB_ID(0x1235, 0x8002): /* Focusrite Scarlett 8i6 */
case USB_ID(0x1235, 0x8004): /* Focusrite Scarlett 18i6 */ case USB_ID(0x1235, 0x8004): /* Focusrite Scarlett 18i6 */
case USB_ID(0x1235, 0x8014): /* Focusrite Scarlett 18i8 */ case USB_ID(0x1235, 0x8014): /* Focusrite Scarlett 18i8 */
Expand Down
69 changes: 69 additions & 0 deletions sound/usb/scarlettmixer.c
Expand Up @@ -917,6 +917,28 @@ static int add_output_ctls(struct usb_mixer_interface *mixer,




/********************** device-specific config *************************/ /********************** device-specific config *************************/
static int scarlet_s6i6_controls(struct usb_mixer_interface *mixer,
const struct scarlett_device_info *info)
{
struct scarlett_mixer_elem_info *elem;
int err;

CTLS_OUTPUT(0, "Monitor");
CTLS_OUTPUT(1, "Headphone 2");
CTLS_OUTPUT(2, "SPDIF");

CTL_ENUM (0x01, 0x09, 1, "Input 1 Impedance Switch", &opt_impedance);
CTL_ENUM (0x01, 0x0b, 1, "Input 1 Pad Switch", &opt_pad);

CTL_ENUM (0x01, 0x09, 2, "Input 2 Impedance Switch", &opt_impedance);
CTL_ENUM (0x01, 0x0b, 2, "Input 2 Pad Switch", &opt_pad);

CTL_ENUM (0x01, 0x0b, 3, "Input 3 Pad Switch", &opt_pad);
CTL_ENUM (0x01, 0x0b, 4, "Input 4 Pad Switch", &opt_pad);

return 0;
}

static int scarlet_s8i6_controls(struct usb_mixer_interface *mixer, static int scarlet_s8i6_controls(struct usb_mixer_interface *mixer,
const struct scarlett_device_info *info) const struct scarlett_device_info *info)
{ {
Expand Down Expand Up @@ -1006,6 +1028,52 @@ static int scarlet_s18i20_controls(struct usb_mixer_interface *mixer,
return 0; return 0;
} }


static const char *s6i6_texts[] = {
txtOff, /* 'off' == 0xff */
txtPcm1, txtPcm2, txtPcm3, txtPcm4,
txtPcm5, txtPcm6, txtPcm7, txtPcm8,
txtPcm9, txtPcm10, txtPcm11, txtPcm12,
txtAnlg1, txtAnlg2, txtAnlg3, txtAnlg4,
txtSpdif1, txtSpdif2,
txtMix1, txtMix2, txtMix3, txtMix4,
txtMix5, txtMix6, txtMix7, txtMix8
};

/* untested... */
static const struct scarlett_device_info s6i6_info = {
.matrix_in = 18,
.matrix_out = 8,
.input_len = 6,
.output_len = 6,

.pcm_start = 0,
.analog_start = 12,
.spdif_start = 16,
.adat_start = 18,
.mix_start = 18,

.opt_master = {
.start = -1,
.len = 27,
.texts = s6i6_texts
},

.opt_matrix = {
.start = -1,
.len = 19,
.texts = s6i6_texts
},

.controls_fn = scarlet_s6i6_controls,
.matrix_mux_init = {
12, 13, 14, 15, // Analog -> 1..4
16, 17, // SPDIF -> 5,6
0, 1, 2, 3, 4, 5, 6, 7, // PCM[1..12] -> 7..18
8, 9, 10, 11
}
};

// and 2 loop channels: Mix1, Mix2
static const char *s8i6_texts[] = { static const char *s8i6_texts[] = {
txtOff, /* 'off' == 0xff */ txtOff, /* 'off' == 0xff */
txtPcm1, txtPcm2, txtPcm3, txtPcm4, txtPcm1, txtPcm2, txtPcm3, txtPcm4,
Expand Down Expand Up @@ -1220,6 +1288,7 @@ int scarlett_mixer_controls(struct usb_mixer_interface *mixer)
CTL_MASTER(0x0a, 0x02, 0, 1, "Master Playback Volume"); CTL_MASTER(0x0a, 0x02, 0, 1, "Master Playback Volume");


switch (mixer->chip->usb_id) { switch (mixer->chip->usb_id) {
case USB_ID(0x1235, 0x8012): info = &s6i6_info; break;
case USB_ID(0x1235, 0x8002): info = &s8i6_info; break; case USB_ID(0x1235, 0x8002): info = &s8i6_info; break;
case USB_ID(0x1235, 0x8004): info = &s18i6_info; break; case USB_ID(0x1235, 0x8004): info = &s18i6_info; break;
case USB_ID(0x1235, 0x8014): info = &s18i8_info; break; case USB_ID(0x1235, 0x8014): info = &s18i8_info; break;
Expand Down

0 comments on commit 7a77707

Please sign in to comment.