595 changes: 595 additions & 0 deletions sound/usb/mixer_s1810c.c

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions sound/usb/mixer_s1810c.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Presonus Studio 1810c driver for ALSA
* Copyright (C) 2019 Nick Kossifidis <mickflemm@gmail.com>
*/

int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer);
36 changes: 36 additions & 0 deletions sound/usb/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,38 @@ static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
return 0; /* keep this altsetting */
}

static int s1810c_skip_setting_quirk(struct snd_usb_audio *chip,
int iface, int altno)
{
/*
* Altno settings:
*
* Playback (Interface 1):
* 1: 6 Analog + 2 S/PDIF
* 2: 6 Analog + 2 S/PDIF
* 3: 6 Analog
*
* Capture (Interface 2):
* 1: 8 Analog + 2 S/PDIF + 8 ADAT
* 2: 8 Analog + 2 S/PDIF + 4 ADAT
* 3: 8 Analog
*/

/*
* I'll leave 2 as the default one and
* use device_setup to switch to the
* other two.
*/
if ((chip->setup == 0 || chip->setup > 2) && altno != 2)
return 1;
else if (chip->setup == 1 && altno != 1)
return 1;
else if (chip->setup == 2 && altno != 3)
return 1;

return 0;
}

int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip,
int iface,
int altno)
Expand All @@ -1265,6 +1297,10 @@ int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip,
/* fasttrackpro usb: skip altsets incompatible with device_setup */
if (chip->usb_id == USB_ID(0x0763, 0x2012))
return fasttrackpro_skip_setting_quirk(chip, iface, altno);
/* presonus studio 1810c: skip altsets incompatible with device_setup */
if (chip->usb_id == USB_ID(0x0194f, 0x010c))
return s1810c_skip_setting_quirk(chip, iface, altno);


return 0;
}
Expand Down