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>
This commit is contained in:
Geoffrey D. Bennett 2021-06-23 02:33:45 +09:30 committed by Takashi Iwai
parent 3b9e3720a9
commit f02da65348
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}