[PATCH v2] HID: quirks: Add device descriptor for 4c4a:4155

Zhang Heng posted 1 patch 4 months, 2 weeks ago
drivers/hid/hid-quirks.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
[PATCH v2] HID: quirks: Add device descriptor for 4c4a:4155
Posted by Zhang Heng 4 months, 2 weeks ago
Multiple USB devices have the same ID;
add device descriptors to distinguish them.

Fixes: 1a8953f4f774 ("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY")
Tested-by: staffan.melin@oscillator.se
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
---
 drivers/hid/hid-quirks.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index ffd034566e2e..d28b180abd72 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -913,7 +913,6 @@ 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_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) },
 	{ }
 };
 
@@ -1062,6 +1061,17 @@ bool hid_ignore(struct hid_device *hdev)
 					     strlen(elan_acpi_id[i].id)))
 					return true;
 		break;
+	case USB_VENDOR_ID_SMARTLINKTECHNOLOGY:
+		/* Multiple USB devices with identical IDs (mic & touchscreen).
+		 * The touch screen requires hid core processing, but the
+		 * microphone does not. They can be distinguished by manufacturer
+		 * and serial number.
+		 */
+		if (hdev->product == USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 &&
+		    strncmp(hdev->name, "SmartlinkTechnology", 19) == 0 &&
+		    strncmp(hdev->uniq, "20201111000001", 14) == 0)
+			return true;
+		break;
 	}
 
 	if (hdev->type == HID_TYPE_USBMOUSE &&
-- 
2.47.1
Re: [PATCH v2] HID: quirks: Add device descriptor for 4c4a:4155
Posted by Linux Hid 4 months, 1 week ago
Hi Zhang,

The subject doesn't reflect what the patch is doing. You are not adding 
a device descriptor, you are fixing a regression.

On 9/22/2025 7:24 PM, Zhang Heng wrote:
> Multiple USB devices have the same ID;
> add device descriptors to distinguish them.
> 
> Fixes: 1a8953f4f774 ("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY")

Should have a Fixes: tag referencing the regression bug.
Also a CC: tag for 1114557@bugs.debian.org
Possibly a CC: tag for stable@vger.kernel.org as well?

> Tested-by: staffan.melin@oscillator.se
> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
> ---
>   drivers/hid/hid-quirks.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
> index ffd034566e2e..d28b180abd72 100644
> --- a/drivers/hid/hid-quirks.c
> +++ b/drivers/hid/hid-quirks.c
> @@ -913,7 +913,6 @@ 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_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) },
>   	{ }
>   };

Smartlink Technology does not own the 0x4c4a VID or the 0x4155 PID. They 
are an artifact of the Jieli SDK they used in development so the 
#defines should not imply ownership by Smartlink. VID 0x4c4a is 
currently unassigned by the USBIF and is therefore 'reserved'.

Maybe change
USB_VENDOR_ID_SMARTLINKTECHNOLOGY to USB_VENDOR_ID_JIELI_SDK_DEFAULT
and
USB_DEVICE_ID_SMARTLINKTRCHNOLOGY_4155 to USB_DEVICE_ID_JIELI_SDK_4155?

>   
> @@ -1062,6 +1061,17 @@ bool hid_ignore(struct hid_device *hdev)
>   					     strlen(elan_acpi_id[i].id)))
>   					return true;
>   		break;
> +	case USB_VENDOR_ID_SMARTLINKTECHNOLOGY:
> +		/* Multiple USB devices with identical IDs (mic & touchscreen).
> +		 * The touch screen requires hid core processing, but the
> +		 * microphone does not. They can be distinguished by manufacturer
> +		 * and serial number.
> +		 */
> +		if (hdev->product == USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 &&
> +		    strncmp(hdev->name, "SmartlinkTechnology", 19) == 0 &&
> +		    strncmp(hdev->uniq, "20201111000001", 14) == 0)

Using the serial number as a device identifier is somewhat risky. The 
serial number is optional for a USB device but if it is used then it's 
supposed to be unique for each device. Given how horrible the 
configuration and HID descriptors are for this device it's unlikely that 
they went to the trouble to give each unit a unique serial number. But 
you should check a few of the devices (if you have more than one) to 
verify they all have the same 20201111000001 serial number.

It's too bad the bcdHID version test for 0x0201 didn't work. The 
hid->version field is filled by usbhid_probe with bcdDevice before both 
hid_lookup_quirk and hid_ignore are called and then updated with bcdHID 
by usbhid_parse after they have been called.

> +			return true;
> +		break;
>   	}
>   
>   	if (hdev->type == HID_TYPE_USBMOUSE &&

Thanks
Terry
Re: [PATCH v2] HID: quirks: Add device descriptor for 4c4a:4155
Posted by zhangheng 3 months, 4 weeks ago
It happened to be the holiday, so communication was a bit troublesome.

However, after a brief discussion with the microphone manufacturer,

it was found that the serial number was still 20201111000001 on another

microphone device. So, should we add it?

在 2025/9/29 8:42, Linux Hid 写道:
> Hi Zhang,
>
> The subject doesn't reflect what the patch is doing. You are not adding
> a device descriptor, you are fixing a regression.
>
> On 9/22/2025 7:24 PM, Zhang Heng wrote:
>> Multiple USB devices have the same ID;
>> add device descriptors to distinguish them.
>>
>> Fixes: 1a8953f4f774 ("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY")
> Should have a Fixes: tag referencing the regression bug.
> Also a CC: tag for 1114557@bugs.debian.org
> Possibly a CC: tag for stable@vger.kernel.org as well?
>
>> Tested-by: staffan.melin@oscillator.se
>> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
>> ---
>>    drivers/hid/hid-quirks.c | 12 +++++++++++-
>>    1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
>> index ffd034566e2e..d28b180abd72 100644
>> --- a/drivers/hid/hid-quirks.c
>> +++ b/drivers/hid/hid-quirks.c
>> @@ -913,7 +913,6 @@ 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_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) },
>>    	{ }
>>    };
> Smartlink Technology does not own the 0x4c4a VID or the 0x4155 PID. They
> are an artifact of the Jieli SDK they used in development so the
> #defines should not imply ownership by Smartlink. VID 0x4c4a is
> currently unassigned by the USBIF and is therefore 'reserved'.
>
> Maybe change
> USB_VENDOR_ID_SMARTLINKTECHNOLOGY to USB_VENDOR_ID_JIELI_SDK_DEFAULT
> and
> USB_DEVICE_ID_SMARTLINKTRCHNOLOGY_4155 to USB_DEVICE_ID_JIELI_SDK_4155?
>
>>    
>> @@ -1062,6 +1061,17 @@ bool hid_ignore(struct hid_device *hdev)
>>    					     strlen(elan_acpi_id[i].id)))
>>    					return true;
>>    		break;
>> +	case USB_VENDOR_ID_SMARTLINKTECHNOLOGY:
>> +		/* Multiple USB devices with identical IDs (mic & touchscreen).
>> +		 * The touch screen requires hid core processing, but the
>> +		 * microphone does not. They can be distinguished by manufacturer
>> +		 * and serial number.
>> +		 */
>> +		if (hdev->product == USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 &&
>> +		    strncmp(hdev->name, "SmartlinkTechnology", 19) == 0 &&
>> +		    strncmp(hdev->uniq, "20201111000001", 14) == 0)
> Using the serial number as a device identifier is somewhat risky. The
> serial number is optional for a USB device but if it is used then it's
> supposed to be unique for each device. Given how horrible the
> configuration and HID descriptors are for this device it's unlikely that
> they went to the trouble to give each unit a unique serial number. But
> you should check a few of the devices (if you have more than one) to
> verify they all have the same 20201111000001 serial number.
>
> It's too bad the bcdHID version test for 0x0201 didn't work. The
> hid->version field is filled by usbhid_probe with bcdDevice before both
> hid_lookup_quirk and hid_ignore are called and then updated with bcdHID
> by usbhid_parse after they have been called.
>
>> +			return true;
>> +		break;
>>    	}
>>    
>>    	if (hdev->type == HID_TYPE_USBMOUSE &&
> Thanks
> Terry
Re: Bug#1114557: [PATCH v2] HID: quirks: Add device descriptor for 4c4a:4155
Posted by Salvatore Bonaccorso 3 months, 2 weeks ago
Hi,

On Mon, Oct 13, 2025 at 04:32:39PM +0800, zhangheng wrote:
> It happened to be the holiday, so communication was a bit troublesome.
> 
> However, after a brief discussion with the microphone manufacturer,
> 
> it was found that the serial number was still 20201111000001 on another
> 
> microphone device. So, should we add it?

As this issue still affects one of our users in Debian, is there
anything which can be done to unblock the situation? Does that mean
that the proposed patch is not good for the microphone device?

My understanding is that it fixes at least Staffan's case which
regressed from 1a8953f4f774 ("HID: Add IGNORE quirk for
SMARTLINKTECHNOLOGY").

Regards,
Salvatore
Re: Bug#1114557: [PATCH v2] HID: quirks: Add device descriptor for 4c4a:4155
Posted by Staffan Melin 3 months, 2 weeks ago
Thank you Salvatore, for moving this forward.

I can add that the issue has been reported by several users on a GPD DUO 
channel on Discord -- all are on newer kernels but have different Linux 
distributions.

I can also confirm that the patch does solve my problem. Looking forward 
to some resolution of this, as it stops me from upgrading to Testing. :)

Best regards,

Staffan


On 2025-10-22 08:04, Salvatore Bonaccorso wrote:
> Hi,
> 
> On Mon, Oct 13, 2025 at 04:32:39PM +0800, zhangheng wrote:
>> It happened to be the holiday, so communication was a bit troublesome.
>> 
>> However, after a brief discussion with the microphone manufacturer,
>> 
>> it was found that the serial number was still 20201111000001 on 
>> another
>> 
>> microphone device. So, should we add it?
> 
> As this issue still affects one of our users in Debian, is there
> anything which can be done to unblock the situation? Does that mean
> that the proposed patch is not good for the microphone device?
> 
> My understanding is that it fixes at least Staffan's case which
> regressed from 1a8953f4f774 ("HID: Add IGNORE quirk for
> SMARTLINKTECHNOLOGY").
> 
> Regards,
> Salvatore