]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ALSA: scarlett2: Update offsets for 2i2 Gen 4 firmware 2417
authorGeoffrey D. Bennett <g@b4.vu>
Sat, 25 Apr 2026 21:17:14 +0000 (06:47 +0930)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Apr 2026 12:20:27 +0000 (14:20 +0200)
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: 4e809a299677 ("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
sound/usb/mixer_scarlett2.c

index 70a276d3ae02a792c3b8762859def4a5943d47f5..b525671d09fc0a8b0df2f28999d4d698ced9ee8a 100644 (file)
@@ -937,6 +937,63 @@ static const struct scarlett2_config_set scarlett2_config_set_gen4_2i2 = {
        }
 };
 
+/* 2i2 Gen 4, firmware version 2417 and above
+ *
+ * Firmware 2417 shifted DIRECT_MONITOR_GAIN by 4 bytes; all other
+ * offsets are unchanged from scarlett2_config_set_gen4_2i2.
+ */
+static const struct scarlett2_config_set scarlett2_config_set_gen4_2i2_2417 = {
+       .notifications = scarlett4_2i2_notifications,
+       .param_buf_addr = 0xfc,
+       .input_gain_tlv = db_scale_gen4_gain,
+       .autogain_status_texts = scarlett2_autogain_status_gen4,
+       .items = {
+               [SCARLETT2_CONFIG_MSD_SWITCH] = {
+                       .offset = 0x49, .size = 8, .activate = 4 },
+
+               [SCARLETT2_CONFIG_DIRECT_MONITOR] = {
+                       .offset = 0x14a, .size = 8, .activate = 16, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_AUTOGAIN_SWITCH] = {
+                       .offset = 0x135, .size = 8, .activate = 10, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_AUTOGAIN_STATUS] = {
+                       .offset = 0x137, .size = 8 },
+
+               [SCARLETT2_CONFIG_AG_MEAN_TARGET] = {
+                       .offset = 0x131, .size = 8, .activate = 29, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_AG_PEAK_TARGET] = {
+                       .offset = 0x132, .size = 8, .activate = 30, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_PHANTOM_SWITCH] = {
+                       .offset = 0x48, .size = 8, .activate = 11, .pbuf = 1,
+                       .mute = 1 },
+
+               [SCARLETT2_CONFIG_INPUT_GAIN] = {
+                       .offset = 0x4b, .size = 8, .activate = 12, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_LEVEL_SWITCH] = {
+                       .offset = 0x3c, .size = 8, .activate = 13, .pbuf = 1,
+                       .mute = 1 },
+
+               [SCARLETT2_CONFIG_SAFE_SWITCH] = {
+                       .offset = 0x147, .size = 8, .activate = 14, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_AIR_SWITCH] = {
+                       .offset = 0x3e, .size = 8, .activate = 15, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_INPUT_SELECT_SWITCH] = {
+                       .offset = 0x14b, .size = 8, .activate = 17, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_INPUT_LINK_SWITCH] = {
+                       .offset = 0x14e, .size = 8, .activate = 18, .pbuf = 1 },
+
+               [SCARLETT2_CONFIG_DIRECT_MONITOR_GAIN] = {
+                       .offset = 0x2a4, .size = 16, .activate = 36 }
+       }
+};
+
 /* 4i4 Gen 4 */
 static const struct scarlett2_config_set scarlett2_config_set_gen4_4i4 = {
        .notifications = scarlett4_4i4_notifications,
@@ -1993,6 +2050,7 @@ static const struct scarlett2_device_info solo_gen4_info = {
 static const struct scarlett2_device_info s2i2_gen4_info = {
        .config_sets = (const struct scarlett2_config_set_entry[]) {
                { 2115, &scarlett2_config_set_gen4_2i2 },
+               { 2417, &scarlett2_config_set_gen4_2i2_2417 },
                { }
        },
        .has_devmap = 1,