diff options
author | Geoffrey D. Bennett <g@b4.vu> | 2023-12-24 22:21:56 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-12-29 17:41:22 +0300 |
commit | 2edc76dddee8a2e785f6566d2baddb49ad62fb5b (patch) | |
tree | 4041215a77b368dea90c3c41b5598f4045b23570 /sound/usb | |
parent | 3978fefdf416d4c14ba43365ef912dcc4e2ee5b6 (diff) | |
download | linux-2edc76dddee8a2e785f6566d2baddb49ad62fb5b.tar.xz |
ALSA: scarlett2: Check for phantom persistence config item
Allow for the phantom persistence config item to not exist. This is
needed for the Scarlett Gen 4 series.
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/3ccaf8069280827bd6c44f103fcb770bd50b7e2e.1703444932.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/mixer_scarlett2.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c index 064d6d34a8ab..84dd9c43afde 100644 --- a/sound/usb/mixer_scarlett2.c +++ b/sound/usb/mixer_scarlett2.c @@ -2621,11 +2621,15 @@ static int scarlett2_update_input_other(struct usb_mixer_interface *mixer) if (err < 0) return err; - err = scarlett2_usb_get_config( - mixer, SCARLETT2_CONFIG_PHANTOM_PERSISTENCE, - 1, &private->phantom_persistence); - if (err < 0) - return err; + if (scarlett2_has_config_item( + private, + SCARLETT2_CONFIG_PHANTOM_PERSISTENCE)) { + err = scarlett2_usb_get_config( + mixer, SCARLETT2_CONFIG_PHANTOM_PERSISTENCE, + 1, &private->phantom_persistence); + if (err < 0) + return err; + } } return 0; @@ -3779,7 +3783,9 @@ static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer) return err; } } - if (info->phantom_count) { + if (info->phantom_count && + scarlett2_has_config_item(private, + SCARLETT2_CONFIG_PHANTOM_PERSISTENCE)) { err = scarlett2_add_new_ctl( mixer, &scarlett2_phantom_persistence_ctl, 0, 1, "Phantom Power Persistence Capture Switch", NULL); |