Skip to content

Commit 3ca1575

Browse files
geoffreybennetttiwai
authored andcommitted
ALSA: scarlett2: Update offsets for 2i2 Gen 4 firmware 2417
Firmware 2417 for the Scarlett 4th Gen 2i2 moved the direct monitor gain parameters, so add a second config_set with the shifted offset and select it for firmware versions >= 2417. Fixes: 4e809a2 ("ALSA: scarlett2: Add support for Solo, 2i2, and 4i4 Gen 4") Cc: stable@vger.kernel.org # ALSA: scarlett2: Allow selecting config_set by firmware version Cc: stable@vger.kernel.org # ALSA: scarlett2: Fold min_firmware_version into config_sets Cc: stable@vger.kernel.org Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/ad0fc5a131e76eb656a24e0e198382f7134068fe.1777151532.git.g@b4.vu
1 parent ec195d2 commit 3ca1575

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

sound/usb/mixer_scarlett2.c

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,63 @@ static const struct scarlett2_config_set scarlett2_config_set_gen4_2i2 = {
937937
}
938938
};
939939

940+
/* 2i2 Gen 4, firmware version 2417 and above
941+
*
942+
* Firmware 2417 shifted DIRECT_MONITOR_GAIN by 4 bytes; all other
943+
* offsets are unchanged from scarlett2_config_set_gen4_2i2.
944+
*/
945+
static const struct scarlett2_config_set scarlett2_config_set_gen4_2i2_2417 = {
946+
.notifications = scarlett4_2i2_notifications,
947+
.param_buf_addr = 0xfc,
948+
.input_gain_tlv = db_scale_gen4_gain,
949+
.autogain_status_texts = scarlett2_autogain_status_gen4,
950+
.items = {
951+
[SCARLETT2_CONFIG_MSD_SWITCH] = {
952+
.offset = 0x49, .size = 8, .activate = 4 },
953+
954+
[SCARLETT2_CONFIG_DIRECT_MONITOR] = {
955+
.offset = 0x14a, .size = 8, .activate = 16, .pbuf = 1 },
956+
957+
[SCARLETT2_CONFIG_AUTOGAIN_SWITCH] = {
958+
.offset = 0x135, .size = 8, .activate = 10, .pbuf = 1 },
959+
960+
[SCARLETT2_CONFIG_AUTOGAIN_STATUS] = {
961+
.offset = 0x137, .size = 8 },
962+
963+
[SCARLETT2_CONFIG_AG_MEAN_TARGET] = {
964+
.offset = 0x131, .size = 8, .activate = 29, .pbuf = 1 },
965+
966+
[SCARLETT2_CONFIG_AG_PEAK_TARGET] = {
967+
.offset = 0x132, .size = 8, .activate = 30, .pbuf = 1 },
968+
969+
[SCARLETT2_CONFIG_PHANTOM_SWITCH] = {
970+
.offset = 0x48, .size = 8, .activate = 11, .pbuf = 1,
971+
.mute = 1 },
972+
973+
[SCARLETT2_CONFIG_INPUT_GAIN] = {
974+
.offset = 0x4b, .size = 8, .activate = 12, .pbuf = 1 },
975+
976+
[SCARLETT2_CONFIG_LEVEL_SWITCH] = {
977+
.offset = 0x3c, .size = 8, .activate = 13, .pbuf = 1,
978+
.mute = 1 },
979+
980+
[SCARLETT2_CONFIG_SAFE_SWITCH] = {
981+
.offset = 0x147, .size = 8, .activate = 14, .pbuf = 1 },
982+
983+
[SCARLETT2_CONFIG_AIR_SWITCH] = {
984+
.offset = 0x3e, .size = 8, .activate = 15, .pbuf = 1 },
985+
986+
[SCARLETT2_CONFIG_INPUT_SELECT_SWITCH] = {
987+
.offset = 0x14b, .size = 8, .activate = 17, .pbuf = 1 },
988+
989+
[SCARLETT2_CONFIG_INPUT_LINK_SWITCH] = {
990+
.offset = 0x14e, .size = 8, .activate = 18, .pbuf = 1 },
991+
992+
[SCARLETT2_CONFIG_DIRECT_MONITOR_GAIN] = {
993+
.offset = 0x2a4, .size = 16, .activate = 36 }
994+
}
995+
};
996+
940997
/* 4i4 Gen 4 */
941998
static const struct scarlett2_config_set scarlett2_config_set_gen4_4i4 = {
942999
.notifications = scarlett4_4i4_notifications,
@@ -1993,6 +2050,7 @@ static const struct scarlett2_device_info solo_gen4_info = {
19932050
static const struct scarlett2_device_info s2i2_gen4_info = {
19942051
.config_sets = (const struct scarlett2_config_set_entry[]) {
19952052
{ 2115, &scarlett2_config_set_gen4_2i2 },
2053+
{ 2417, &scarlett2_config_set_gen4_2i2_2417 },
19962054
{ }
19972055
},
19982056
.has_devmap = 1,

0 commit comments

Comments
 (0)