Skip to content

Commit 0ce204d

Browse files
geoffreybennetttiwai
authored andcommitted
ALSA: scarlett2: Add device_setup option to use FCP driver
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 46757a3 commit 0ce204d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sound/usb/mixer_scarlett2.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,17 @@
166166
#include "helper.h"
167167

168168
#include "mixer_scarlett2.h"
169+
#include "fcp.h"
169170

170171
/* device_setup value to allow turning MSD mode back on */
171172
#define SCARLETT2_MSD_ENABLE 0x02
172173

173174
/* device_setup value to disable this mixer driver */
174175
#define SCARLETT2_DISABLE 0x04
175176

177+
/* device_setup value to use the FCP driver instead */
178+
#define SCARLETT2_USE_FCP_DRIVER 0x08
179+
176180
/* some gui mixers can't handle negative ctl values */
177181
#define SCARLETT2_VOLUME_BIAS 127
178182

@@ -9702,6 +9706,10 @@ int snd_scarlett2_init(struct usb_mixer_interface *mixer)
97029706
if (!mixer->protocol)
97039707
return 0;
97049708

9709+
/* check if the user wants to use the FCP driver instead */
9710+
if (chip->setup & SCARLETT2_USE_FCP_DRIVER)
9711+
return snd_fcp_init(mixer);
9712+
97059713
/* find entry in scarlett2_devices */
97069714
entry = get_scarlett2_device_entry(mixer);
97079715
if (!entry) {

0 commit comments

Comments
 (0)