Skip to content

Commit 659169c

Browse files
royvegardtiwai
authored andcommitted
ALSA: usb-audio: add mono main switch to Presonus S1824c
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>
1 parent 50a098e commit 659169c

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

sound/usb/mixer_s1810c.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ struct s1810c_ctl_packet {
9393

9494
#define SC1810C_CTL_LINE_SW 0
9595
#define SC1810C_CTL_MUTE_SW 1
96+
#define SC1824C_CTL_MONO_SW 2
9697
#define SC1810C_CTL_AB_SW 3
9798
#define SC1810C_CTL_48V_SW 4
9899

@@ -123,6 +124,7 @@ struct s1810c_state_packet {
123124
#define SC1810C_STATE_48V_SW 58
124125
#define SC1810C_STATE_LINE_SW 59
125126
#define SC1810C_STATE_MUTE_SW 60
127+
#define SC1824C_STATE_MONO_SW 61
126128
#define SC1810C_STATE_AB_SW 62
127129

128130
struct s1810_mixer_state {
@@ -502,6 +504,15 @@ static const struct snd_kcontrol_new snd_s1810c_mute_sw = {
502504
.private_value = (SC1810C_STATE_MUTE_SW | SC1810C_CTL_MUTE_SW << 8)
503505
};
504506

507+
static const struct snd_kcontrol_new snd_s1824c_mono_sw = {
508+
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
509+
.name = "Mono Main Out Switch",
510+
.info = snd_ctl_boolean_mono_info,
511+
.get = snd_s1810c_switch_get,
512+
.put = snd_s1810c_switch_set,
513+
.private_value = (SC1824C_STATE_MONO_SW | SC1824C_CTL_MONO_SW << 8)
514+
};
515+
505516
static const struct snd_kcontrol_new snd_s1810c_48v_sw = {
506517
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
507518
.name = "48V Phantom Power On Mic Inputs Switch",
@@ -588,8 +599,17 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
588599
if (ret < 0)
589600
return ret;
590601

591-
ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
592-
if (ret < 0)
593-
return ret;
602+
// The 1824c has a Mono Main switch instead of a
603+
// A/B select switch.
604+
if (mixer->chip->usb_id == USB_ID(0x194f, 0x010d)) {
605+
ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw);
606+
if (ret < 0)
607+
return ret;
608+
} else if (mixer->chip->usb_id == USB_ID(0x194f, 0x010c)) {
609+
ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);
610+
if (ret < 0)
611+
return ret;
612+
}
613+
594614
return ret;
595615
}

0 commit comments

Comments
 (0)