Skip to content

Commit

Permalink
ALSA: usb-audio: scarlett2: Add sw_hw_ctls and mux_ctls
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geoffrey D. Bennett authored and Takashi Iwai committed Jun 22, 2021
1 parent 3b9e372 commit f02da65
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/usb/mixer_scarlett_gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit f02da65

Please sign in to comment.