summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorGeoffrey D. Bennett <g@b4.vu>2023-12-26 19:08:20 +0100
committerTakashi Iwai <tiwai@suse.de>2023-12-29 15:52:13 +0100
commite8e14270d8d0d5c9bd8e04e5940d511b56a981e9 (patch)
treea56cddf23d2fced1ccf6bbe8bb20b26093ce58e1 /sound/usb
parentALSA: scarlett2: Store mix_ctls for Gen 4 Direct Monitor (diff)
downloadlinux-e8e14270d8d0d5c9bd8e04e5940d511b56a981e9.tar.xz
linux-e8e14270d8d0d5c9bd8e04e5940d511b56a981e9.zip
ALSA: scarlett2: Handle Gen 4 Direct Monitor mix updates
When the Direct Monitor feature on the Scarlett 4th Gen Solo and 2i2 interfaces is used, the Mix A and B gains are updated by the interface. This patch calls snd_ctl_notify() for the ALSA mix controls when a Direct Monitor notification is received. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/713d032e343e0547212368919bef17d6fa1c9d29.1703612638.git.g@b4.vu
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer_scarlett2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index d6e2f69c32b9..501444cf0f15 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -6285,11 +6285,23 @@ static void scarlett2_notify_direct_monitor(struct usb_mixer_interface *mixer)
{
struct snd_card *card = mixer->chip->card;
struct scarlett2_data *private = mixer->private_data;
+ int count = private->num_mix_in * private->num_mix_out;
+ int i;
private->direct_monitor_updated = 1;
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE,
&private->direct_monitor_ctl->id);
+
+ if (!scarlett2_has_mixer(private))
+ return;
+
+ private->mix_updated = 1;
+
+ /* Notify of change to the mix controls */
+ for (i = 0; i < count; i++)
+ snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE,
+ &private->mix_ctls[i]->id);
}
/* Notify on power change */