public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Salvatore Bonaccorso <carnil@debian.org>
To: Staffan Melin <staffan.melin@oscillator.se>
Cc: zhangheng <zhangheng@kylinos.cn>, Jiri Kosina <jkosina@suse.com>,
	Benjamin Tissoires <bentiss@kernel.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	regressions@lists.linux.dev, stable@vger.kernel.org,
	1114557@bugs.debian.org
Subject: Re: [regression] 1a8953f4f774 ("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY") causes issue with ID 4c4a:4155 Jieli Technology USB Composite Device
Date: Sat, 13 Sep 2025 10:55:31 +0200	[thread overview]
Message-ID: <aMUxg6FLqDetwiGu@eldamar.lan> (raw)
In-Reply-To: <aMUxHZF-7p7--1qS@eldamar.lan>

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

Hi Staffan,

chiming in hopefully it is of help.

Now really with the patch ...

On Fri, Sep 12, 2025 at 09:57:04PM +0200, Staffan Melin wrote:
> Thank you,
> 
> I tried to apply this patch to 6.12.39, the first problematic kernel, as
> well as 6.12.41, the first bad I tried, and on both I got an error message:
> 
> Applying: HID: quirks: Add device descriptor for 4c4a:4155
> error: patch failed: drivers/hid/hid-quirks.c:1068
> error: drivers/hid/hid-quirks.c: patch does not apply
> Patch failed at 0001 HID: quirks: Add device descriptor for 4c4a:4155
> 
> To which kernel version should I apply the patch?

As the deveopment goes from mainline then down to stable series, the
fix needs to be developed first for mainline. So the patch is targeted
there.

But please find attached an updated patch which hopefully should work
which resolved the context changes on top of 6.12.47.

But ideally you can provide a Tested-by on zhangheng's mainline patch
to get things rolling as needed.

Regards,
Salvatore

[-- Attachment #2: 0001-HID-quirks-Add-device-descriptor-for-4c4a-4155.patch --]
[-- Type: text/x-diff, Size: 2181 bytes --]

From 16b03e802a858ebf3eafcfdb22e3025e1a840afd Mon Sep 17 00:00:00 2001
From: Zhang Heng <zhangheng@kylinos.cn>
Date: Fri, 12 Sep 2025 20:38:18 +0800
Subject: [PATCH] HID: quirks: Add device descriptor for 4c4a:4155

Two USB devices use the same ID. To avoid affecting functionality,
device descriptors are added to distinguish between them

Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
---
 drivers/hid/hid-quirks.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 64f9728018b8..cbb658c2c60d 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -898,6 +898,17 @@ static const struct hid_device_id hid_ignore_list[] = {
 #endif
 	{ HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) },
+	{ }
+};
+/*
+ * hid_ignore_mic - Microphone devices do not require HID core processing
+ *
+ * Now there are two USB devices using the same ID, one is the microphone and the other
+ * is the touch screen. The touch screen requires hid core processing, but the
+ * microphone does not. The two have different bcdIDs, which will be used to
+ * distinguish them in the future
+ */
+static const struct hid_device_id hid_ignore_mic[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) },
 	{ }
 };
@@ -1061,6 +1072,9 @@ bool hid_ignore(struct hid_device *hdev)
 	    hid_match_id(hdev, hid_mouse_ignore_list))
 		return true;
 
+	if(hid_match_id(hdev, hid_ignore_mic) && (hdev->version > 1.1))
+		return true;
+
 	return !!hid_match_id(hdev, hid_ignore_list);
 }
 EXPORT_SYMBOL_GPL(hid_ignore);
@@ -1259,7 +1273,8 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev)
 	const struct hid_device_id *bl_entry;
 	unsigned long quirks = hdev->initial_quirks;
 
-	if (hid_match_id(hdev, hid_ignore_list))
+	if (hid_match_id(hdev, hid_ignore_list) ||
+	   (hid_match_id(hdev, hid_ignore_mic) && (hdev->version > 1.1)))
 		quirks |= HID_QUIRK_IGNORE;
 
 	if (hid_match_id(hdev, hid_have_special_driver))
-- 
2.51.0


  reply	other threads:[~2025-09-13  9:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-07 15:10 [regression] 1a8953f4f774 ("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY") causes issue with ID 4c4a:4155 Jieli Technology USB Composite Device Salvatore Bonaccorso
2025-09-08  4:10 ` Terry Junge
2025-09-08  9:00   ` Staffan Melin
2025-09-12 12:49 ` zhangheng
2025-09-12 19:57   ` Staffan Melin
2025-09-13  8:53     ` Salvatore Bonaccorso
2025-09-13  8:55       ` Salvatore Bonaccorso [this message]
2025-09-13 13:11         ` Staffan Melin
2025-09-15  8:37           ` zhangheng
2025-09-15 23:06             ` Terry Junge
2025-09-18 14:05               ` zhangheng
2025-09-18 19:56                 ` Staffan Melin
2025-09-22  9:21                   ` zhangheng
2025-09-22 18:33                     ` Staffan Melin
2025-09-29  0:39                       ` Linux Hid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMUxg6FLqDetwiGu@eldamar.lan \
    --to=carnil@debian.org \
    --cc=1114557@bugs.debian.org \
    --cc=bentiss@kernel.org \
    --cc=jkosina@suse.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=staffan.melin@oscillator.se \
    --cc=zhangheng@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox