Skip to content

Commit f3c42a2

Browse files
geoffreybennetttiwai
authored andcommitted
ALSA: scarlett2: Rename Gen 3 config sets
The config sets are named NO_MIXER, GEN_2, GEN_3, and CLARETT currently. Rename NO_MIXER and GEN_3 to GEN_3A and GEN_3B respectively as NO_MIXER is only for the smaller Gen 3 devices. Signed-off-by: Geoffrey D. Bennett <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent efc3d7d commit f3c42a2

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

sound/usb/mixer_scarlett2.c

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ static const u16 scarlett2_mixer_values[SCARLETT2_MIXER_VALUE_COUNT] = {
213213
/* Maximum number of meters (sum of output port counts) */
214214
#define SCARLETT2_MAX_METERS 65
215215

216-
/* There are three different sets of configuration parameters across
217-
* the devices
216+
/* There are different sets of configuration parameters across the
217+
* devices, dependent on series and model.
218218
*/
219219
enum {
220-
SCARLETT2_CONFIG_SET_NO_MIXER = 0,
221-
SCARLETT2_CONFIG_SET_GEN_2 = 1,
222-
SCARLETT2_CONFIG_SET_GEN_3 = 2,
220+
SCARLETT2_CONFIG_SET_GEN_2 = 0,
221+
SCARLETT2_CONFIG_SET_GEN_3A = 1,
222+
SCARLETT2_CONFIG_SET_GEN_3B = 2,
223223
SCARLETT2_CONFIG_SET_CLARETT = 3,
224-
SCARLETT2_CONFIG_SET_COUNT = 4
224+
SCARLETT2_CONFIG_SET_COUNT = 4
225225
};
226226

227227
/* Hardware port types:
@@ -595,7 +595,7 @@ static const struct scarlett2_device_info s18i20_gen2_info = {
595595

596596
static const struct scarlett2_device_info solo_gen3_info = {
597597
.has_msd_mode = 1,
598-
.config_set = SCARLETT2_CONFIG_SET_NO_MIXER,
598+
.config_set = SCARLETT2_CONFIG_SET_GEN_3A,
599599
.level_input_count = 1,
600600
.level_input_first = 1,
601601
.air_input_count = 1,
@@ -606,7 +606,7 @@ static const struct scarlett2_device_info solo_gen3_info = {
606606

607607
static const struct scarlett2_device_info s2i2_gen3_info = {
608608
.has_msd_mode = 1,
609-
.config_set = SCARLETT2_CONFIG_SET_NO_MIXER,
609+
.config_set = SCARLETT2_CONFIG_SET_GEN_3A,
610610
.level_input_count = 2,
611611
.air_input_count = 2,
612612
.phantom_count = 1,
@@ -616,7 +616,7 @@ static const struct scarlett2_device_info s2i2_gen3_info = {
616616

617617
static const struct scarlett2_device_info s4i4_gen3_info = {
618618
.has_msd_mode = 1,
619-
.config_set = SCARLETT2_CONFIG_SET_GEN_3,
619+
.config_set = SCARLETT2_CONFIG_SET_GEN_3B,
620620
.level_input_count = 2,
621621
.pad_input_count = 2,
622622
.air_input_count = 2,
@@ -660,7 +660,7 @@ static const struct scarlett2_device_info s4i4_gen3_info = {
660660

661661
static const struct scarlett2_device_info s8i6_gen3_info = {
662662
.has_msd_mode = 1,
663-
.config_set = SCARLETT2_CONFIG_SET_GEN_3,
663+
.config_set = SCARLETT2_CONFIG_SET_GEN_3B,
664664
.level_input_count = 2,
665665
.pad_input_count = 2,
666666
.air_input_count = 2,
@@ -711,7 +711,7 @@ static const struct scarlett2_device_info s8i6_gen3_info = {
711711

712712
static const struct scarlett2_device_info s18i8_gen3_info = {
713713
.has_msd_mode = 1,
714-
.config_set = SCARLETT2_CONFIG_SET_GEN_3,
714+
.config_set = SCARLETT2_CONFIG_SET_GEN_3B,
715715
.line_out_hw_vol = 1,
716716
.has_speaker_switching = 1,
717717
.level_input_count = 2,
@@ -779,7 +779,7 @@ static const struct scarlett2_device_info s18i8_gen3_info = {
779779

780780
static const struct scarlett2_device_info s18i20_gen3_info = {
781781
.has_msd_mode = 1,
782-
.config_set = SCARLETT2_CONFIG_SET_GEN_3,
782+
.config_set = SCARLETT2_CONFIG_SET_GEN_3B,
783783
.line_out_hw_vol = 1,
784784
.has_speaker_switching = 1,
785785
.has_talkback = 1,
@@ -1116,28 +1116,8 @@ static const struct scarlett2_config
11161116
scarlett2_config_items[SCARLETT2_CONFIG_SET_COUNT]
11171117
[SCARLETT2_CONFIG_COUNT] =
11181118

1119-
/* Devices without a mixer (Gen 3 Solo and 2i2) */
1120-
{ {
1121-
[SCARLETT2_CONFIG_MSD_SWITCH] = {
1122-
.offset = 0x04, .size = 8, .activate = 6 },
1123-
1124-
[SCARLETT2_CONFIG_PHANTOM_PERSISTENCE] = {
1125-
.offset = 0x05, .size = 8, .activate = 6 },
1126-
1127-
[SCARLETT2_CONFIG_PHANTOM_SWITCH] = {
1128-
.offset = 0x06, .size = 8, .activate = 3 },
1129-
1130-
[SCARLETT2_CONFIG_DIRECT_MONITOR] = {
1131-
.offset = 0x07, .size = 8, .activate = 4 },
1132-
1133-
[SCARLETT2_CONFIG_LEVEL_SWITCH] = {
1134-
.offset = 0x08, .size = 1, .activate = 7 },
1135-
1136-
[SCARLETT2_CONFIG_AIR_SWITCH] = {
1137-
.offset = 0x09, .size = 1, .activate = 8 },
1138-
11391119
/* Gen 2 devices: 6i6, 18i8, 18i20 */
1140-
}, {
1120+
{ {
11411121
[SCARLETT2_CONFIG_DIM_MUTE] = {
11421122
.offset = 0x31, .size = 8, .activate = 2 },
11431123

@@ -1159,6 +1139,26 @@ static const struct scarlett2_config
11591139
[SCARLETT2_CONFIG_STANDALONE_SWITCH] = {
11601140
.offset = 0x8d, .size = 8, .activate = 6 },
11611141

1142+
/* Gen 3 devices without a mixer (Solo and 2i2) */
1143+
}, {
1144+
[SCARLETT2_CONFIG_MSD_SWITCH] = {
1145+
.offset = 0x04, .size = 8, .activate = 6 },
1146+
1147+
[SCARLETT2_CONFIG_PHANTOM_PERSISTENCE] = {
1148+
.offset = 0x05, .size = 8, .activate = 6 },
1149+
1150+
[SCARLETT2_CONFIG_PHANTOM_SWITCH] = {
1151+
.offset = 0x06, .size = 8, .activate = 3 },
1152+
1153+
[SCARLETT2_CONFIG_DIRECT_MONITOR] = {
1154+
.offset = 0x07, .size = 8, .activate = 4 },
1155+
1156+
[SCARLETT2_CONFIG_LEVEL_SWITCH] = {
1157+
.offset = 0x08, .size = 1, .activate = 7 },
1158+
1159+
[SCARLETT2_CONFIG_AIR_SWITCH] = {
1160+
.offset = 0x09, .size = 1, .activate = 8 },
1161+
11621162
/* Gen 3 devices: 4i4, 8i6, 18i8, 18i20 */
11631163
}, {
11641164
[SCARLETT2_CONFIG_DIM_MUTE] = {
@@ -1907,7 +1907,7 @@ static int scarlett2_add_sync_ctl(struct usb_mixer_interface *mixer)
19071907
struct scarlett2_data *private = mixer->private_data;
19081908

19091909
/* devices without a mixer also don't support reporting sync status */
1910-
if (private->info->config_set == SCARLETT2_CONFIG_SET_NO_MIXER)
1910+
if (private->info->config_set == SCARLETT2_CONFIG_SET_GEN_3A)
19111911
return 0;
19121912

19131913
return scarlett2_add_new_ctl(mixer, &scarlett2_sync_ctl,
@@ -3614,7 +3614,7 @@ static int scarlett2_add_meter_ctl(struct usb_mixer_interface *mixer)
36143614
struct scarlett2_data *private = mixer->private_data;
36153615

36163616
/* devices without a mixer also don't support reporting levels */
3617-
if (private->info->config_set == SCARLETT2_CONFIG_SET_NO_MIXER)
3617+
if (private->info->config_set == SCARLETT2_CONFIG_SET_GEN_3A)
36183618
return 0;
36193619

36203620
return scarlett2_add_new_ctl(mixer, &scarlett2_meter_ctl,
@@ -3744,7 +3744,7 @@ static int scarlett2_add_standalone_ctl(struct usb_mixer_interface *mixer)
37443744
{
37453745
struct scarlett2_data *private = mixer->private_data;
37463746

3747-
if (private->info->config_set == SCARLETT2_CONFIG_SET_NO_MIXER)
3747+
if (private->info->config_set == SCARLETT2_CONFIG_SET_GEN_3A)
37483748
return 0;
37493749

37503750
/* Add standalone control */
@@ -3911,7 +3911,7 @@ static int scarlett2_read_configs(struct usb_mixer_interface *mixer)
39113911
return err;
39123912

39133913
/* the rest of the configuration is for devices with a mixer */
3914-
if (info->config_set == SCARLETT2_CONFIG_SET_NO_MIXER)
3914+
if (info->config_set == SCARLETT2_CONFIG_SET_GEN_3A)
39153915
return 0;
39163916

39173917
err = scarlett2_usb_get_config(

0 commit comments

Comments
 (0)