summaryrefslogtreecommitdiffstats
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
authorJurgen Kramer <gtmkramer@xs4all.nl>2014-11-28 17:32:54 +0100
committerTakashi Iwai <tiwai@suse.de>2014-11-28 18:02:35 +0100
commit6874daad4b0fbed5b2f9bef7f4d3f2b895463a95 (patch)
tree2e1306a87375fdd6cb877e5b77b2ff5d44e4813c /sound/usb/quirks.c
parent7a2e9ddc903225d8fb3a510a842144a239017ee4 (diff)
downloadop-kernel-dev-6874daad4b0fbed5b2f9bef7f4d3f2b895463a95.zip
op-kernel-dev-6874daad4b0fbed5b2f9bef7f4d3f2b895463a95.tar.gz
ALSA: usb-audio: Add mode select quirk for Denon/Marantz DACs
Denon/Marantz USB DACs need a specific vendor command to switch between PCM and DSD mode. This patch adds a new quirk function to switch between the two modes using the specific USB vendor command. This patch applies to the following devices: - Marantz SA-14S1 - Marantz HD-DAC1 Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r--sound/usb/quirks.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index a9d4add..e0cde74 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1111,6 +1111,44 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
}
}
+
+/* Marantz/Denon USB DACs need a vendor cmd to switch
+ * between PCM and native DSD mode
+ */
+int snd_usb_select_mode_quirk(struct snd_usb_substream *subs,
+ struct audioformat *fmt)
+{
+ struct usb_device *dev = subs->dev;
+ int err;
+
+ switch (subs->stream->chip->usb_id) {
+ case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */
+ case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */
+
+ /* First switch to alt set 0, otherwise the mode switch cmd
+ * will not be accepted by the DAC
+ */
+ err = usb_set_interface(dev, fmt->iface, 0);
+ if (err < 0)
+ return err;
+
+ mdelay(20); /* Delay needed after setting the interface */
+
+ switch (fmt->altsetting) {
+ case 2: /* DSD mode requested */
+ case 1: /* PCM mode requested */
+ err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 0,
+ USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
+ fmt->altsetting - 1, 1, NULL, 0);
+ if (err < 0)
+ return err;
+ break;
+ }
+ mdelay(20);
+ }
+ return 0;
+}
+
void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
{
/*
OpenPOWER on IntegriCloud