summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorGeoffrey D. Bennett <g@b4.vu>2021-06-23 02:33:45 +0930
committerTakashi Iwai <tiwai@suse.de>2021-06-22 21:42:24 +0200
commitf02da6534810acb8d101143255a30e706ec7bb81 (patch)
tree70a017a83e0632f16fcf5d8c20c5326f27926f5e /sound/usb
parent3b9e3720a91e419785de0fa536d24557ae6474e8 (diff)
downloadlinux-f02da6534810acb8d101143255a30e706ec7bb81.tar.gz
linux-f02da6534810acb8d101143255a30e706ec7bb81.tar.bz2
linux-f02da6534810acb8d101143255a30e706ec7bb81.zip
ALSA: usb-audio: scarlett2: Add sw_hw_ctls and mux_ctls
Save the struct snd_kcontrol pointers for the sw_hw and mux controls. This is in preparation for speaker switching support which needs to be able to update those controls. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Link: https://lore.kernel.org/r/269d89181bf29dbea80ba6f8cfff84fb23b77f86.1624379707.git.g@b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer_scarlett_gen2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index 37e35016db12..b3e1cb943c3c 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -394,12 +394,14 @@ struct scarlett2_data {
struct snd_kcontrol *sync_ctl;
struct snd_kcontrol *master_vol_ctl;
struct snd_kcontrol *vol_ctls[SCARLETT2_ANALOGUE_MAX];
+ struct snd_kcontrol *sw_hw_ctls[SCARLETT2_ANALOGUE_MAX];
struct snd_kcontrol *mute_ctls[SCARLETT2_ANALOGUE_MAX];
struct snd_kcontrol *dim_mute_ctls[SCARLETT2_DIM_MUTE_COUNT];
struct snd_kcontrol *level_ctls[SCARLETT2_LEVEL_SWITCH_MAX];
struct snd_kcontrol *pad_ctls[SCARLETT2_PAD_SWITCH_MAX];
struct snd_kcontrol *air_ctls[SCARLETT2_AIR_SWITCH_MAX];
struct snd_kcontrol *phantom_ctls[SCARLETT2_PHANTOM_SWITCH_MAX];
+ struct snd_kcontrol *mux_ctls[SCARLETT2_MUX_MAX];
struct snd_kcontrol *direct_monitor_ctl;
u8 mux[SCARLETT2_MUX_MAX];
u8 mix[SCARLETT2_INPUT_MIX_MAX * SCARLETT2_OUTPUT_MIX_MAX];
@@ -2558,7 +2560,8 @@ static int scarlett2_add_line_out_ctls(struct usb_mixer_interface *mixer)
i + 1);
err = scarlett2_add_new_ctl(mixer,
&scarlett2_sw_hw_enum_ctl,
- i, 1, s, NULL);
+ i, 1, s,
+ &private->sw_hw_ctls[i]);
if (err < 0)
return err;
}
@@ -2876,7 +2879,8 @@ static int scarlett2_add_mux_enums(struct usb_mixer_interface *mixer)
err = scarlett2_add_new_ctl(mixer,
&scarlett2_mux_src_enum_ctl,
- i, 1, s, NULL);
+ i, 1, s,
+ &private->mux_ctls[i]);
if (err < 0)
return err;
}