]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: usb-audio: add mono main switch to Presonus S1824c
authorRoy Vegard Ovesen <roy.vegard.ovesen@gmail.com>
Sat, 27 Sep 2025 15:27:30 +0000 (17:27 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 28 Sep 2025 06:30:14 +0000 (08:30 +0200)
The 1824c does not have the A/B switch that the 1810c has,
but instead it has a mono main switch that sums the two
main output channels to mono.

Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer_s1810c.c

index fac4bbc6b275772dd27fecb8be0be987558e0c22..bd24556f6a7fbebfb12a89b6efe9a87894732343 100644 (file)
@@ -93,6 +93,7 @@ struct s1810c_ctl_packet {
 
 #define SC1810C_CTL_LINE_SW    0
 #define SC1810C_CTL_MUTE_SW    1
+#define SC1824C_CTL_MONO_SW    2
 #define SC1810C_CTL_AB_SW      3
 #define SC1810C_CTL_48V_SW     4
 
@@ -123,6 +124,7 @@ struct s1810c_state_packet {
 #define SC1810C_STATE_48V_SW   58
 #define SC1810C_STATE_LINE_SW  59
 #define SC1810C_STATE_MUTE_SW  60
+#define SC1824C_STATE_MONO_SW  61
 #define SC1810C_STATE_AB_SW    62
 
 struct s1810_mixer_state {
@@ -502,6 +504,15 @@ static const struct snd_kcontrol_new snd_s1810c_mute_sw = {
        .private_value = (SC1810C_STATE_MUTE_SW | SC1810C_CTL_MUTE_SW << 8)
 };
 
+static const struct snd_kcontrol_new snd_s1824c_mono_sw = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Mono Main Out Switch",
+       .info = snd_ctl_boolean_mono_info,
+       .get = snd_s1810c_switch_get,
+       .put = snd_s1810c_switch_set,
+       .private_value = (SC1824C_STATE_MONO_SW | SC1824C_CTL_MONO_SW << 8)
+};
+
 static const struct snd_kcontrol_new snd_s1810c_48v_sw = {
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
        .name = "48V Phantom Power On Mic Inputs Switch",
@@ -588,8 +599,17 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
        if (ret < 0)
                return ret;
 
-       ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
-       if (ret < 0)
-               return ret;
+       // The 1824c has a Mono Main switch instead of a
+       // A/B select switch.
+       if (mixer->chip->usb_id == USB_ID(0x194f, 0x010d)) {
+               ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw);
+               if (ret < 0)
+                       return ret;
+       } else if (mixer->chip->usb_id == USB_ID(0x194f, 0x010c)) {
+               ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
+               if (ret < 0)
+                       return ret;
+       }
+
        return ret;
 }