From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2DEB21B1B4; Fri, 20 Dec 2024 17:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734714729; cv=none; b=p/EwUAbPTPwJvYH+Dlw6wS5lLuyp8ZYGxNf9/SnySLZk70N0IUzsM0fbaY8ihF/z//yod2l2UScrGt7mOfhtckY2J8cfRvsBbQVKyqboXL4/f5QekKdCMsqDZAfjizouK9ptD+BNsnZePWsTmsAJdqSNTA5pJHKgR28JlR8E6O4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734714729; c=relaxed/simple; bh=jqV9yDh1oaeYjwK6LbgMaYXnVkpQwXCmemlPTyo+9ug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cf1jFiEG4L8KYRc2gOwneuSAe1Rp1K0ZDKb5nf28B2r6wdSqIVvda2402dJ44ddhDR7L2ujuYCNopHSyF7TS/a/tUjTFAamTTsmF2dw15649tfZpNQb7/kQ1iRhEPBcWsdrpkgU/YkmAmvPRkeNWQqHv2NM/YShyyHdMQD5+Uqs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X8XRt3hQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X8XRt3hQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FFC9C4CED3; Fri, 20 Dec 2024 17:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734714728; bh=jqV9yDh1oaeYjwK6LbgMaYXnVkpQwXCmemlPTyo+9ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X8XRt3hQjft2ZjVJucU7V9BjWi4KpEOVh122Z8+53WMnnb+fM8L3u/8v8tFJfNBe0 o9FIerVp27rQmqzIsx0uRibaz9C39IBOaOFyRSMf0UagNSKD0M/F5lDFUmvJv2uTwL hOqLggp96odY0d2V1I/dNQpcse/D0QtQy6YkToyWqZxvnVwB7bj7+ATUOxLWCPZrQW Cd+1pRRliRx56sBHSeG/t0B8W74x5g9K+YW1W0rMSADk+xqCMD9sWSJnFbZS0A2E8g L3h6hZgouwQAeoUXwP0jF5ec3AJaBmY3P2U5Yo1Iq8ED2rA7YdQUAfblCDSoi47P3c QLu5CCbUWCyJQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Adrian Ratiu , Takashi Iwai , Takashi Iwai , Sasha Levin , perex@perex.cz, alexander@tsoy.me, k.kosik@outlook.com, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.12 14/29] sound: usb: format: don't warn that raw DSD is unsupported Date: Fri, 20 Dec 2024 12:11:15 -0500 Message-Id: <20241220171130.511389-14-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241220171130.511389-1-sashal@kernel.org> References: <20241220171130.511389-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.6 Content-Transfer-Encoding: 8bit From: Adrian Ratiu [ Upstream commit b50a3e98442b8d72f061617c7f7a71f7dba19484 ] UAC 2 & 3 DAC's set bit 31 of the format to signal support for a RAW_DATA type, typically used for DSD playback. This is correctly tested by (format & UAC*_FORMAT_TYPE_I_RAW_DATA), fp->dsd_raw = true; and call snd_usb_interface_dsd_format_quirks(), however a confusing and unnecessary message gets printed because the bit is not properly tested in the last "unsupported" if test: if (format & ~0x3F) { ... } For example the output: usb 7-1: new high-speed USB device number 5 using xhci_hcd usb 7-1: New USB device found, idVendor=262a, idProduct=9302, bcdDevice=0.01 usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 usb 7-1: Product: TC44C usb 7-1: Manufacturer: TC44C usb 7-1: SerialNumber: 5000000001 hid-generic 0003:262A:9302.001E: No inputs registered, leaving hid-generic 0003:262A:9302.001E: hidraw6: USB HID v1.00 Device [DDHIFI TC44C] on usb-0000:08:00.3-1/input0 usb 7-1: 2:4 : unsupported format bits 0x100000000 This last "unsupported format" is actually wrong: we know the format is a RAW_DATA which we assume is DSD, so there is no need to print the confusing message. This we unset bit 31 of the format after recognizing it, to avoid the message. Suggested-by: Takashi Iwai Signed-off-by: Adrian Ratiu Link: https://patch.msgid.link/20241209090529.16134-2-adrian.ratiu@collabora.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/format.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/usb/format.c b/sound/usb/format.c index 0cbf1d4fbe6e..6049d957694c 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -60,6 +60,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL; /* flag potentially raw DSD capable altsettings */ fp->dsd_raw = true; + /* clear special format bit to avoid "unsupported format" msg below */ + format &= ~UAC2_FORMAT_TYPE_I_RAW_DATA; } format <<= 1; @@ -71,8 +73,11 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, sample_width = as->bBitResolution; sample_bytes = as->bSubslotSize; - if (format & UAC3_FORMAT_TYPE_I_RAW_DATA) + if (format & UAC3_FORMAT_TYPE_I_RAW_DATA) { pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL; + /* clear special format bit to avoid "unsupported format" msg below */ + format &= ~UAC3_FORMAT_TYPE_I_RAW_DATA; + } format <<= 1; break; -- 2.39.5