ALSA: scarlett2: Add support for config items with size = 32
authorGeoffrey D. Bennett <g@b4.vu>
Tue, 12 Mar 2024 18:35:30 +0000 (05:05 +1030)
committerTakashi Iwai <tiwai@suse.de>
Thu, 18 Apr 2024 06:31:13 +0000 (08:31 +0200)
Update scarlett2_usb_get_config() to support 32-bit values which are
needed by the upcoming Vocaster support.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Message-ID: <ee35dce0172b2aa3fec8163ab8f35bdc35a141bd.1710264833.git.g@b4.vu>

sound/usb/mixer_scarlett2.c

index 8d08f71bd4d6cd2a2b01cb29228510a31b80d3ba..f2bbf90680f8b0f23c67f83b5ec8629e76cf2b8b 100644 (file)
@@ -436,7 +436,7 @@ enum {
 };
 
 /* Location, size, and activation command number for the configuration
- * parameters. Size is in bits and may be 1, 8, or 16.
+ * parameters. Size is in bits and may be 1, 8, 16, or 32.
  *
  * Vocaster and 4th Gen devices have a parameter buffer to set certain
  * configuration parameters. When pbuf is set, rather than writing to
@@ -2102,6 +2102,11 @@ static int scarlett2_usb_get_config(
 
                        for (i = 0; i < count; i++, buf_16++)
                                *buf_16 = le16_to_cpu(*(__le16 *)buf_16);
+               } else if (size == 4) {
+                       u32 *buf_32 = buf;
+
+                       for (i = 0; i < count; i++, buf_32++)
+                               *buf_32 = le32_to_cpu(*(__le32 *)buf_32);
                }
                return 0;
        }