]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: scarlett2: Add device_setup option to use FCP driver
authorGeoffrey D. Bennett <g@b4.vu>
Thu, 16 Jan 2025 17:47:58 +0000 (04:17 +1030)
committerTakashi Iwai <tiwai@suse.de>
Sat, 18 Jan 2025 11:02:22 +0000 (12:02 +0100)
Add a new device_setup option (SCARLETT2_USE_FCP_DRIVER = 0x08) that
allows users to opt in to using the new FCP driver instead of the
existing scarlett2 driver for their device. This provides a way to
test the new FCP driver on existing supported hardware while keeping
the Scarlett2 driver as the default.

When the SCARLETT2_USE_FCP_DRIVER bit is set in device_setup, the
scarlett2 driver initialisation will hand off to the FCP driver
instead of proceeding with its own initialisation. The FCP driver then
provides access to the device via its hwdep interface.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://patch.msgid.link/94ffd7971d73cb0cbea6933b28f7528ce5b9edde.1737048528.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer_scarlett2.c

index 7f595c1752a5a117304b2c643b0158bd68d7aa9d..288d22e6a0b25398bc0d69de3a966ca04639388c 100644 (file)
 #include "helper.h"
 
 #include "mixer_scarlett2.h"
+#include "fcp.h"
 
 /* device_setup value to allow turning MSD mode back on */
 #define SCARLETT2_MSD_ENABLE 0x02
 /* device_setup value to disable this mixer driver */
 #define SCARLETT2_DISABLE 0x04
 
+/* device_setup value to use the FCP driver instead */
+#define SCARLETT2_USE_FCP_DRIVER 0x08
+
 /* some gui mixers can't handle negative ctl values */
 #define SCARLETT2_VOLUME_BIAS 127
 
@@ -9702,6 +9706,10 @@ int snd_scarlett2_init(struct usb_mixer_interface *mixer)
        if (!mixer->protocol)
                return 0;
 
+       /* check if the user wants to use the FCP driver instead */
+       if (chip->setup & SCARLETT2_USE_FCP_DRIVER)
+               return snd_fcp_init(mixer);
+
        /* find entry in scarlett2_devices */
        entry = get_scarlett2_device_entry(mixer);
        if (!entry) {