Skip to content

Commit

Permalink
ALSA: scarlett2: Add device_setup option to use FCP driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
geoffreybennett committed Dec 23, 2024
1 parent d531f0d commit dca874d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sound/usb/mixer_scarlett2.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,17 @@
#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

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit dca874d

Please sign in to comment.