From patchwork Mon Aug 22 06:53:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 9293057 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 DDB12607FF for ; Mon, 22 Aug 2016 06:54:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDF29287E1 for ; Mon, 22 Aug 2016 06:54:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2C4628932; Mon, 22 Aug 2016 06:54:37 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham 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 BCA6A287E1 for ; Mon, 22 Aug 2016 06:54:36 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 018AF266853; Mon, 22 Aug 2016 08:54:35 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 00DCD26673E; Mon, 22 Aug 2016 08:53:58 +0200 (CEST) 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 9C96B2666DD; Mon, 22 Aug 2016 08:53:56 +0200 (CEST) Received: from mail.zonque.de (svenfoo.org [82.94.215.22]) by alsa0.perex.cz (Postfix) with ESMTP id 89256266021 for ; Mon, 22 Aug 2016 08:53:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 10E61C011B; Mon, 22 Aug 2016 08:53:49 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ig9dasBDDsCn; Mon, 22 Aug 2016 08:53:48 +0200 (CEST) Received: from rabotti.localdomain (p5DDC77DA.dip0.t-ipconnect.de [93.220.119.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id 83687C0119; Mon, 22 Aug 2016 08:53:48 +0200 (CEST) From: Daniel Mack To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Mon, 22 Aug 2016 08:53:37 +0200 Message-Id: <1471848818-11860-2-git-send-email-daniel@zonque.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1471848818-11860-1-git-send-email-daniel@zonque.org> References: <1471848818-11860-1-git-send-email-daniel@zonque.org> Cc: norman.nolte@gmx.net, T.Gresens@intershop.de, clemens@ladisch.de, Daniel Mack Subject: [alsa-devel] [PATCH 2/3] ALSA: usb: use TEAC UD-H01 quirk for more devices 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 The quirk seems to be necessary not only for TEAC UD-H01 devices, but to more that are based on the Tenor 8802TL chipset. Devices built by T+A are affected too, and they apparently all use the same USB PID:PID. Extend the quirky handling for that device as well, and rename the quirks flag. Reported-and-tested-by: Thomas Gresens Signed-off-by: Daniel Mack --- sound/usb/card.h | 2 +- sound/usb/endpoint.c | 5 +++-- sound/usb/quirks.c | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/usb/card.h b/sound/usb/card.h index 71778ca..111b0f0 100644 --- a/sound/usb/card.h +++ b/sound/usb/card.h @@ -92,7 +92,7 @@ struct snd_usb_endpoint { unsigned int curframesize; /* current packet size in frames (for capture) */ unsigned int syncmaxsize; /* sync endpoint packet size */ unsigned int fill_max:1; /* fill max packet size always */ - unsigned int udh01_fb_quirk:1; /* corrupted feedback data */ + unsigned int tenor_fb_quirk:1; /* corrupted feedback data */ unsigned int datainterval; /* log_2 of data packet interval */ unsigned int syncinterval; /* P for adaptive mode, 0 otherwise */ unsigned char silence_value; diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 4b4ffa0..c317a8d 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1167,9 +1167,10 @@ void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep, if (f == 0) return; - if (unlikely(sender->udh01_fb_quirk)) { + if (unlikely(sender->tenor_fb_quirk)) { /* - * The TEAC UD-H01 firmware sometimes changes the feedback value + * Devices based on Tenor 8802 chipsets (TEAC UD-H01 + * and others) sometimes change the feedback value * by +/- 0x1.0000. */ if (f < ep->freqn - 0x8000) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 299813f..d47d927 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1218,9 +1218,10 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep) ep->skip_packets = 16; /* Work around devices that report unreasonable feedback data */ - if (ep->chip->usb_id == USB_ID(0x0644, 0x8038) /* TEAC UD-H01 */ && + if ((ep->chip->usb_id == USB_ID(0x0644, 0x8038) || /* TEAC UD-H01 */ + ep->chip->usb_id == USB_ID(0x1852, 0x5034)) && /* T+A Dac8 */ ep->syncmaxsize == 4) - ep->udh01_fb_quirk = 1; + ep->tenor_fb_quirk = 1; } void snd_usb_set_interface_quirk(struct usb_device *dev)