From patchwork Fri Mar 23 10:18:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobutaka Okabe X-Patchwork-Id: 10303701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F64660385 for ; Fri, 23 Mar 2018 10:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D90B285A2 for ; Fri, 23 Mar 2018 10:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71EAC28DAE; Fri, 23 Mar 2018 10:19:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86EAA285A2 for ; Fri, 23 Mar 2018 10:19:27 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7DB3D2673D2; Fri, 23 Mar 2018 11:19:23 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7A4B12673DC; Fri, 23 Mar 2018 11:19:20 +0100 (CET) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by alsa0.perex.cz (Postfix) with ESMTP id BB1312673C9 for ; Fri, 23 Mar 2018 11:19:17 +0100 (CET) Received: by mail-pl0-f68.google.com with SMTP id c11-v6so7161020plo.0 for ; Fri, 23 Mar 2018 03:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YQHPiS/fyLFXvyR5gVxpxjPGjI7lUWeSwGANnYG1zwU=; b=V2qjDJ4R9hTEh4hGPs5ewOeiAFFAFBZMj07nbS98+AX5rWZqi4mmp/WgJoakt1bbxI 4As48P+kvxO6gafF0MQeU/kNW2LVbkaTClY6sd52WErK8h0SxXeWi7vat/NH0cWl/uqX ju6OvzhT4tY0ibj5wPFOvVXqi/Rpr/54CcZVNLvC3VYFyDS0kudv5UDIi4MmlQt7UMD/ bovqr2NhST3OUyVgSk8aUT8UwvtyoIhuywc9TTgyoaeZMGVQiK/BxAiaPkS86d2VbWuB pVwHu3FvhowthkdjUQYRHNl2pOUHrAXsqhJDFs32j0zswwSsjfN0QRd0wjDVG9b1zp0D QxeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YQHPiS/fyLFXvyR5gVxpxjPGjI7lUWeSwGANnYG1zwU=; b=HQZ5D0mrHTasTtjBRBHgqBAv9qFc9GU8Pcb1jEuk71+vKqiQd9ENSBwwPi5EYptEBA 2Lw3z/ntkgRuHbFOr74yW49abeu4Ii7Gcqh5dP9XgAuybMkWJlLRxZPxD/hpW+mO6nxe TKG25K3+Ba3xuuPJEMrbKp3DmUI7Phe3qs577FcXQDVZw2oRBhDJa59DWLsQGzZogvoq U1G7tv5gBgT8H6lNbTYsp9ngi9pqi2yqQYXNRUHcZDjgW1E2tjykBdzhdgXckGXWp9EM UuZAEZ0vIJ+UQHAFP2GcRiTyo9bm3jhQk1FJz8J7Dt2fxHlUvcsc3CNx0xEAxncl58t4 C5Jg== X-Gm-Message-State: AElRT7H4Qcb9aDc+rLnGWJlVEmYOFQMsr1pb5e4lY+yujxCPbzJqiCNk cE0pwz8MFzuBNVfvAdQmFPez2Q== X-Google-Smtp-Source: AG47ELs4cOV/dg56x7hdHgxUZljCwhaQ7ZyWmziru5h9313eSiQd/KRpA3TxWFTLxnnt7C4h1JA2uw== X-Received: by 2002:a17:902:76ca:: with SMTP id j10-v6mr15459886plt.315.1521800355948; Fri, 23 Mar 2018 03:19:15 -0700 (PDT) Received: from tiger24.localdomain (p58058-ipngnfx01hodogaya.kanagawa.ocn.ne.jp. [153.156.31.58]) by smtp.gmail.com with ESMTPSA id r11sm539565pfg.0.2018.03.23.03.19.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 03:19:07 -0700 (PDT) From: Nobutaka Okabe To: alsa-devel@alsa-project.org Date: Fri, 23 Mar 2018 19:18:22 +0900 Message-Id: <20180323101822.6529-1-nob77413@gmail.com> X-Mailer: git-send-email 2.11.1 Cc: Nobutaka Okabe , Jurgen Kramer Subject: [alsa-devel] [PATCH 1/3] ALSA: usb-audio: Add native DSD support for Luxman DA-06 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add native DSD support quirk for Luxman DA-06 DAC, by adding the PID/VID 1852:5065. Rename "is_marantz_denon_dac()" function to "is_itf_usb_dsd_2alts_dac()" to cover broader device family sharing the same USB audio implementation(*). For the same reason, rename "is_teac_dsd_dac()" function to "is_itf_usb_dsd_3alts_dac()". (*) These devices have the same USB controller "ITF-USB DSD", supplied by INTERFACE Co., Ltd. "ITF-USB DSD" USB controller has two patterns, Pattern 1. (2 altsets version) - Altset 0: for control - Altset 1: for stream (S32) - Altset 2: for stream (S32, DSD_U32) Pattern 2. (3 altsets version) - Altset 0: for control - Altset 1: for stream (S16) - Altset 2: for stream (S32) - Altset 3: for stream (S32, DSD_U32) "is_itf_usb_dsd_2alts_dac()" returns true, if the DAC has "Pattern 1" USB controller, and "is_itf_usb_dsd_3alts_dac()" returns true, if "Pattern2". Signed-off-by: Nobutaka Okabe --- sound/usb/quirks.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 794224e1d6df..006da37ad0d9 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1149,24 +1149,27 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) return false; } -/* Marantz/Denon USB DACs need a vendor cmd to switch +/* ITF-USB DSD based DACs need a vendor cmd to switch * between PCM and native DSD mode + * (2 altsets version) */ -static bool is_marantz_denon_dac(unsigned int id) +static bool is_itf_usb_dsd_2alts_dac(unsigned int id) { switch (id) { case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */ case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ + case USB_ID(0x1852, 0x5065): /* Luxman DA-06 */ return true; } return false; } -/* TEAC UD-501/UD-503/NT-503 USB DACs need a vendor cmd to switch - * between PCM/DOP and native DSD mode +/* ITF-USB DSD based DACs need a vendor cmd to switch + * between PCM and native DSD mode + * (3 altsets version) */ -static bool is_teac_dsd_dac(unsigned int id) +static bool is_itf_usb_dsd_3alts_dac(unsigned int id) { switch (id) { case USB_ID(0x0644, 0x8043): /* TEAC UD-501/UD-503/NT-503 */ @@ -1183,7 +1186,7 @@ int snd_usb_select_mode_quirk(struct snd_usb_substream *subs, struct usb_device *dev = subs->dev; int err; - if (is_marantz_denon_dac(subs->stream->chip->usb_id)) { + if (is_itf_usb_dsd_2alts_dac(subs->stream->chip->usb_id)) { /* First switch to alt set 0, otherwise the mode switch cmd * will not be accepted by the DAC */ @@ -1204,7 +1207,7 @@ int snd_usb_select_mode_quirk(struct snd_usb_substream *subs, break; } mdelay(20); - } else if (is_teac_dsd_dac(subs->stream->chip->usb_id)) { + } else if (is_itf_usb_dsd_3alts_dac(subs->stream->chip->usb_id)) { /* Vendor mode switch cmd is required. */ switch (fmt->altsetting) { case 3: /* DSD mode (DSD_U32) requested */ @@ -1300,10 +1303,10 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) mdelay(20); - /* Marantz/Denon devices with USB DAC functionality need a delay + /* ITF-USB DSD based DACs functionality need a delay * after each class compliant request */ - if (is_marantz_denon_dac(chip->usb_id) + if (is_itf_usb_dsd_2alts_dac(chip->usb_id) && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) mdelay(20); @@ -1390,14 +1393,14 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, break; } - /* Denon/Marantz devices with USB DAC functionality */ - if (is_marantz_denon_dac(chip->usb_id)) { + /* ITF-USB DSD based DACs (2 altsets version) */ + if (is_itf_usb_dsd_2alts_dac(chip->usb_id)) { if (fp->altsetting == 2) return SNDRV_PCM_FMTBIT_DSD_U32_BE; } - /* TEAC devices with USB DAC functionality */ - if (is_teac_dsd_dac(chip->usb_id)) { + /* ITF-USB DSD based DACs (3 altsets version) */ + if (is_itf_usb_dsd_3alts_dac(chip->usb_id)) { if (fp->altsetting == 3) return SNDRV_PCM_FMTBIT_DSD_U32_BE; }