Skip to content

Commit f71c70d

Browse files
AquaMorphtiwai
authored andcommitted
ALSA: scarlett2: Add Focusrite Clarett+ 8Pre support
The Focusrite Clarett+ 8Pre uses the same protocol as the Scarlett Gen 2 and Gen 3 product range. This patch adds support for the Clarett+ 8Pre by adding appropriate entries to the scarlett2 driver. The Clarett+ 2Pre and 4Pre, and the Clarett USB product line presumably use the same protocol as well, so support for them can easily be added if someone can test. Signed-off-by: Christian Colglazier <christian@cacolglazier.com> Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Link: https://lore.kernel.org/r/20220809043241.GA2749152@m.b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent f83bb25 commit f71c70d

2 files changed

Lines changed: 90 additions & 2 deletions

File tree

sound/usb/mixer_quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3420,6 +3420,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
34203420
case USB_ID(0x1235, 0x8213): /* Focusrite Scarlett 8i6 3rd Gen */
34213421
case USB_ID(0x1235, 0x8214): /* Focusrite Scarlett 18i8 3rd Gen */
34223422
case USB_ID(0x1235, 0x8215): /* Focusrite Scarlett 18i20 3rd Gen */
3423+
case USB_ID(0x1235, 0x820c): /* Focusrite Clarett+ 8Pre */
34233424
err = snd_scarlett_gen2_init(mixer);
34243425
break;
34253426

sound/usb/mixer_scarlett_gen2.c

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Focusrite Scarlett Gen 2/3 Driver for ALSA
3+
* Focusrite Scarlett Gen 2/3 and Clarett+ Driver for ALSA
44
*
55
* Supported models:
66
* - 6i6/18i8/18i20 Gen 2
77
* - Solo/2i2/4i4/8i6/18i8/18i20 Gen 3
8+
* - Clarett+ 8Pre
89
*
910
* Copyright (c) 2018-2022 by Geoffrey D. Bennett <g at b4.vu>
1011
* Copyright (c) 2020-2021 by Vladimir Sadovnikov <sadko4u@gmail.com>
12+
* Copyright (c) 2022 by Christian Colglazier <christian@cacolglazier.com>
1113
*
1214
* Based on the Scarlett (Gen 1) Driver for ALSA:
1315
*
@@ -51,6 +53,9 @@
5153
* Support for phantom power, direct monitoring, speaker switching,
5254
* and talkback added in May-June 2021.
5355
*
56+
* Support for Clarett+ 8Pre added in Aug 2022 by Christian
57+
* Colglazier.
58+
*
5459
* This ALSA mixer gives access to (model-dependent):
5560
* - input, output, mixer-matrix muxes
5661
* - mixer-matrix gain stages
@@ -203,7 +208,8 @@ enum {
203208
SCARLETT2_CONFIG_SET_NO_MIXER = 0,
204209
SCARLETT2_CONFIG_SET_GEN_2 = 1,
205210
SCARLETT2_CONFIG_SET_GEN_3 = 2,
206-
SCARLETT2_CONFIG_SET_COUNT = 3
211+
SCARLETT2_CONFIG_SET_CLARETT = 3,
212+
SCARLETT2_CONFIG_SET_COUNT = 4
207213
};
208214

209215
/* Hardware port types:
@@ -841,6 +847,61 @@ static const struct scarlett2_device_info s18i20_gen3_info = {
841847
} },
842848
};
843849

850+
static const struct scarlett2_device_info clarett_8pre_info = {
851+
.usb_id = USB_ID(0x1235, 0x820c),
852+
853+
.config_set = SCARLETT2_CONFIG_SET_CLARETT,
854+
.line_out_hw_vol = 1,
855+
.level_input_count = 2,
856+
.air_input_count = 8,
857+
858+
.line_out_descrs = {
859+
"Monitor L",
860+
"Monitor R",
861+
NULL,
862+
NULL,
863+
NULL,
864+
NULL,
865+
"Headphones 1 L",
866+
"Headphones 1 R",
867+
"Headphones 2 L",
868+
"Headphones 2 R",
869+
},
870+
871+
.port_count = {
872+
[SCARLETT2_PORT_TYPE_NONE] = { 1, 0 },
873+
[SCARLETT2_PORT_TYPE_ANALOGUE] = { 8, 10 },
874+
[SCARLETT2_PORT_TYPE_SPDIF] = { 2, 2 },
875+
[SCARLETT2_PORT_TYPE_ADAT] = { 8, 8 },
876+
[SCARLETT2_PORT_TYPE_MIX] = { 10, 18 },
877+
[SCARLETT2_PORT_TYPE_PCM] = { 20, 18 },
878+
},
879+
880+
.mux_assignment = { {
881+
{ SCARLETT2_PORT_TYPE_PCM, 0, 18 },
882+
{ SCARLETT2_PORT_TYPE_ANALOGUE, 0, 10 },
883+
{ SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
884+
{ SCARLETT2_PORT_TYPE_ADAT, 0, 8 },
885+
{ SCARLETT2_PORT_TYPE_MIX, 0, 18 },
886+
{ SCARLETT2_PORT_TYPE_NONE, 0, 8 },
887+
{ 0, 0, 0 },
888+
}, {
889+
{ SCARLETT2_PORT_TYPE_PCM, 0, 14 },
890+
{ SCARLETT2_PORT_TYPE_ANALOGUE, 0, 10 },
891+
{ SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
892+
{ SCARLETT2_PORT_TYPE_ADAT, 0, 4 },
893+
{ SCARLETT2_PORT_TYPE_MIX, 0, 18 },
894+
{ SCARLETT2_PORT_TYPE_NONE, 0, 8 },
895+
{ 0, 0, 0 },
896+
}, {
897+
{ SCARLETT2_PORT_TYPE_PCM, 0, 12 },
898+
{ SCARLETT2_PORT_TYPE_ANALOGUE, 0, 10 },
899+
{ SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
900+
{ SCARLETT2_PORT_TYPE_NONE, 0, 22 },
901+
{ 0, 0, 0 },
902+
} },
903+
};
904+
844905
static const struct scarlett2_device_info *scarlett2_devices[] = {
845906
/* Supported Gen 2 devices */
846907
&s6i6_gen2_info,
@@ -855,6 +916,9 @@ static const struct scarlett2_device_info *scarlett2_devices[] = {
855916
&s18i8_gen3_info,
856917
&s18i20_gen3_info,
857918

919+
/* Supported Clarett+ devices */
920+
&clarett_8pre_info,
921+
858922
/* End of list */
859923
NULL
860924
};
@@ -1047,6 +1111,29 @@ static const struct scarlett2_config
10471111

10481112
[SCARLETT2_CONFIG_TALKBACK_MAP] = {
10491113
.offset = 0xb0, .size = 16, .activate = 10 },
1114+
1115+
/* Clarett+ 8Pre */
1116+
}, {
1117+
[SCARLETT2_CONFIG_DIM_MUTE] = {
1118+
.offset = 0x31, .size = 8, .activate = 2 },
1119+
1120+
[SCARLETT2_CONFIG_LINE_OUT_VOLUME] = {
1121+
.offset = 0x34, .size = 16, .activate = 1 },
1122+
1123+
[SCARLETT2_CONFIG_MUTE_SWITCH] = {
1124+
.offset = 0x5c, .size = 8, .activate = 1 },
1125+
1126+
[SCARLETT2_CONFIG_SW_HW_SWITCH] = {
1127+
.offset = 0x66, .size = 8, .activate = 3 },
1128+
1129+
[SCARLETT2_CONFIG_LEVEL_SWITCH] = {
1130+
.offset = 0x7c, .size = 8, .activate = 7 },
1131+
1132+
[SCARLETT2_CONFIG_AIR_SWITCH] = {
1133+
.offset = 0x95, .size = 8, .activate = 8 },
1134+
1135+
[SCARLETT2_CONFIG_STANDALONE_SWITCH] = {
1136+
.offset = 0x8d, .size = 8, .activate = 6 },
10501137
} };
10511138

10521139
/* proprietary request/response format */

0 commit comments

Comments
 (0)