Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3832148pxb; Tue, 10 Nov 2020 00:47:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWsPebmfMN4waRgYtpzm6h/w5fxW3tgfebYpnSKRRN6NCaJpEUjIGDxH6XoTz/LaQ94nDl X-Received: by 2002:a17:906:1f86:: with SMTP id t6mr18672321ejr.356.1604998024578; Tue, 10 Nov 2020 00:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604998024; cv=none; d=google.com; s=arc-20160816; b=aHIUvwlSH4K7yYqBYHtYkVnZe8UPYIXRTUbnYiQFtxv8056LsNWofVQkQmyfp2KwjX NtZlL/SIGumkB/KsRrGerymmwRIu2f2qzwbcmjRx6EJq4bqgjcHaz7GKMc+7QtEGSIvM i30kQNVvplxAp5kVP5HeA477Umklq7AJMGS/gyaLoAOZv7uxHYQLfANj3mBNSN3z1NZy QYBGVh21pq19EBUOiTN2uYGJDTiOjVobwG7vTD5xA/p8r5mSHjGVi/2i8BHBAOPD+ZvX +c1DXdua1hWpS4XMfrvWLl+ZBiSTI5iryUGOwOqgLBgeqWSj3xjZH+ZJ4sln83HBGiMG h0Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=BUCy7TR5vy2TnuEXsy/s75PqXdd6CjpU/83VtCr/nzE=; b=EsyteTO3a2GpwgInhWSouYdyKY6CxXSrwhmlr7QFcgLi1Z1HzW2rozi295EVNU04KN 73a0efPXKiNPJxPnfCzu2CI0RyNQTFT0b72g3R13Oap7ZJuGx1/kLQu0IbE3PrcBjViH +hsWmHAWOHsxDioH0MxFuHooUdHW+y+UzcA2fp88xICF7DGKKzWhCxc6mcpowDzWWyEV yed3ojX/rwpvaY6WxNLJVDzK2QL0xyXG073xfh2RhRR59LZZSpsX0SYeVXcCfzxJ0Q3N x8gDT9r2907sR9ZhnWhQZ0lnvF9hFCvR/oqpR6vuHDi8WbaK6ZZWzMi5rdRPN9S2zkWr MlIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p21si8936131ejx.516.2020.11.10.00.46.40; Tue, 10 Nov 2020 00:47:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729024AbgKJInS (ORCPT + 99 others); Tue, 10 Nov 2020 03:43:18 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:51798 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726462AbgKJInP (ORCPT ); Tue, 10 Nov 2020 03:43:15 -0500 X-UUID: 9a49a4eb747a4336a1463e66c6adc991-20201110 X-UUID: 9a49a4eb747a4336a1463e66c6adc991-20201110 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 750161777; Tue, 10 Nov 2020 16:43:11 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Nov 2020 16:43:08 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 10 Nov 2020 16:43:09 +0800 From: Macpaul Lin To: Jaroslav Kysela , Takashi Iwai , Matthias Brugger , Alexander Tsoy , Nicola Lunghi , Christopher Swenson , Nick Kossifidis , CC: Ainge Hsu , Eddie Hung , Chunfeng Yun , Mediatek WSD Upstream , Macpaul Lin , Macpaul Lin , , , , , Subject: [PATCH v2] ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET Date: Tue, 10 Nov 2020 16:42:54 +0800 Message-ID: <1604997774-13593-1-git-send-email-macpaul.lin@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1604995443-30453-1-git-send-email-macpaul.lin@mediatek.com> References: <1604995443-30453-1-git-send-email-macpaul.lin@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports 96khz. However there will be some random issue under 96khz. Not sure if there is any alternate setting could be applied. Hence 48khz is suggested to be applied at this moment. Signed-off-by: Macpaul Lin Signed-off-by: Eddie Hung Cc: stable@vger.kernel.org --- Changes for v2: - Fix build error. - Add Cc: stable@vger.kernel.org sound/usb/format.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/usb/format.c b/sound/usb/format.c index 1b28d01..7a4837b 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -202,6 +202,7 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof fp->rate_min = fp->rate_max = 0; for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) { unsigned int rate = combine_triple(&fmt[idx]); + struct usb_device *udev = chip->dev; if (!rate) continue; /* C-Media CM6501 mislabels its 96 kHz altsetting */ @@ -217,6 +218,11 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof (chip->usb_id == USB_ID(0x041e, 0x4064) || chip->usb_id == USB_ID(0x041e, 0x4068))) rate = 8000; + /* Huawei headset can't support 96kHz fully */ + if (rate == 96000 && + chip->usb_id == USB_ID(0x12d1, 0x3a07) && + le16_to_cpu(udev->descriptor.bcdDevice) == 0x49) + continue; fp->rate_table[fp->nr_rates] = rate; if (!fp->rate_min || rate < fp->rate_min) -- 1.7.9.5