From 5e4a9245de142a0bc0877a3d50fbe01359a65022 Mon Sep 17 00:00:00 2001 From: Zhang Heng Date: Fri, 12 Sep 2025 20:38:18 +0800 Subject: [PATCH v3] HID: quirks: Add device descriptor for 4c4a:4155 Multiple USB devices use the same ID. To avoid affecting functionality, device descriptors are added to distinguish between them Signed-off-by: Zhang Heng --- drivers/hid/hid-quirks.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index ffd034566e2e..e1a6ba0e069a 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -913,6 +913,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) }, { } }; @@ -1068,6 +1079,13 @@ bool hid_ignore(struct hid_device *hdev) hdev->quirks & HID_QUIRK_IGNORE_MOUSE) return true; + if (hid_match_id(hdev, hid_ignore_mic) && (hdev->version == 0x201)) + return true; + if (hid_match_id(hdev, hid_ignore_mic) && (hdev->version == 0x201)) + return true; + + pr_err("DEBUG: %s %d %s hdev->version = 0x%x\n", __FILE__, __LINE__, __func__, hdev->version); + return !!hid_match_id(hdev, hid_ignore_list); } EXPORT_SYMBOL_GPL(hid_ignore); @@ -1268,6 +1286,12 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev) if (hid_match_id(hdev, hid_ignore_list)) quirks |= HID_QUIRK_IGNORE; + if (hid_match_id(hdev, hid_ignore_mic) && (hdev->version == 0x201)) + quirks |= HID_QUIRK_IGNORE; + if (hid_match_id(hdev, hid_ignore_mic) && (hdev->version == 0x100)) + quirks |= HID_QUIRK_IGNORE; + + pr_err("DEBUG: %s %d %s hdev->version = 0x%x\n", __FILE__, __LINE__, __func__, hdev->version); if (hid_match_id(hdev, hid_mouse_ignore_list)) quirks |= HID_QUIRK_IGNORE_MOUSE; -- 2.47.1