Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1943991imm; Thu, 24 May 2018 03:21:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZomkIJD0BZ+csl69DIO5hSdqTLwU2Jy55w45y/eAoUaEwAXyTwnJMhPs4adW7cx5kEHsnW+ X-Received: by 2002:a65:6510:: with SMTP id x16-v6mr5429719pgv.204.1527157286809; Thu, 24 May 2018 03:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157286; cv=none; d=google.com; s=arc-20160816; b=pNirB50pLVYD8Pht3Lew/HQ7b6pdAwuEoejPcS3DhBHQOSmx8HGD5fR3/5s6GGWPtd ITjAseVt8VzZWRBpt+IooUMg4gWTNfuzqTig/e0iAPc6yT9fF9jyNRZ0gRIER9i/XXvo 2iniDcMqIGx8p22FJEXZCsuurYcoYH6+lnJKFRMR1VRQw/I9DqQCum4mD8uQyval9MDH AM93D185FEMb5DoQYU9x6XfFdjZLBTUqp53tzbaAeYt3sHJ9OkVvbfSrX3thY4asIEY+ agXUG8fO4SXzB4VeYFchTGuP4PdPmxonA1kacM+mKtiC3Io6tqD+pWGtHDn4S1mQOOVc slXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=goknbT0x9FXz9fFHgmful1npY6YVd4HP09CTOe63GZg=; b=beiP3pzO5KrL06kWGaw0jNZpSViR7DHgLr5/2tOIxgs8PhkrMzNz1TYuiQt0a91JxM 4f765QErJ4GHDR0MjwT/FGVvt9Q3f37aeRVNbOuTWU1kNLNTyA5zTtMnXttWsowpMSLI /C0iZBBah4F7ZN4m0EtkyGMExNBKjcMtz4MFJ9H/dz0obDmfqkuDnpXtyJUJSoYduFX8 ciLoCGs8/nTpXSHwSiFgdfXnImGJQVXTiWFPHz73Z2GeJ0kk0bx1e5SWqcL9LEarPM/W HQD7Mge//usx/n1ZLUdxwjX7xDiJPebeH4nkJNCjO5rnSXS0bCWEMKalkSpIenwDhQ8h /Bmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eHZFOU20; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d30-v6si21052682pld.528.2018.05.24.03.21.12; Thu, 24 May 2018 03:21:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eHZFOU20; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031354AbeEXKU0 (ORCPT + 99 others); Thu, 24 May 2018 06:20:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:52086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030845AbeEXKDV (ORCPT ); Thu, 24 May 2018 06:03:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B59320847; Thu, 24 May 2018 10:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156200; bh=ZYpFpHOft/AIR4ZO6n+yE5KUBIFX15EkLLdSvN/vMOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eHZFOU20bT4b9WGTMZCh+zpfsdJlKeE4+fQGAZcvFRRN//CaCzCDRoU7ozvJtg5U5 y6idEkG1Js1K5ldE9tX97feBgTJMV2WMOaBCnDWcEv2Aznj2ILm68Bl7to6gdI6Zd2 /idhJ1frZD0r0qMK6vM6KHejI37dzRd6lGhb0iTU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nobutaka Okabe , Takashi Iwai , Sasha Levin Subject: [PATCH 4.16 067/161] ALSA: usb-audio: Add native DSD support for Luxman DA-06 Date: Thu, 24 May 2018 11:38:12 +0200 Message-Id: <20180524093026.525201453@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nobutaka Okabe [ Upstream commit 71426535f49fe6034d0e0db77608b91a0c1a022d ] 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 Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- sound/usb/quirks.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1149,24 +1149,27 @@ bool snd_usb_get_sample_rate_quirk(struc 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 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 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_de (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( 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; }