Bug 218646

Summary: Problem with search driver or this is guide how search driver.
Product: Drivers Reporter: tele (swojskichlopak)
Component: USBAssignee: Default virtual assignee for Drivers/USB (drivers_usb)
Status: RESOLVED ANSWERED    
Severity: normal    
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description tele 2024-03-26 20:33:16 UTC
I noticed that USB drivers are in 
https://github.com/torvalds/linux/blob/master/drivers/hid/

And there is Kconfig which I can read.

This is a very useful file. 
Bravo you, congratulations and thank you very much.
I wish you lots of free coffee :D

Because I can check there
- Is the hardware supported 
( " Ctrl + F " in Firefox to search hardware )
- which driver supports my hardware.
And then I can try check if driver exist in my system.
The name driver will be in lower case with "_" or "-" .
For files I recommend using " - " because it is more popular.

Char " - " is 2D in hex

printf "%x\n" "'-"
2d

I mention it because are many signs.

Coming back to the driver, 
this is an example.
In Kconfig file I can find that PS4 is supported 
for example by " HID_PLAYSTATION "
then I can search this driver inside system

$ find /lib/modules/$(uname -r) -type f -name '*.ko' | grep -i "playstation"
/lib/modules/5.15.0-91-generic/kernel/drivers/hid/hid-playstation.ko

And hid-playstation.ko this is the driver.

Problem I see with HyperX hardware.
Is not in HID so I can not find in Kconfig file.

Quote from wiki:
The HID standard was adopted primarily to enable innovation in PC input devices and to simplify the process of installing such devices. Prior to the introduction of the HID concept, devices usually conformed to strictly defined protocols for mouse, keyboards and joysticks

I download source code of linux,
then unpack
and I tried search HyperX driver and info.

$ grep -ri hyperx
sound/usb/quirks.c:	DEVICE_FLG(0x0951, 0x16ad, /* Kingston HyperX */
drivers/input/joystick/xpad.c:	{ 0x03f0, 0x038D, "HyperX Clutch", 0, XTYPE_XBOX360 },			/* wired */
drivers/input/joystick/xpad.c:	{ 0x03f0, 0x048D, "HyperX Clutch", 0, XTYPE_XBOX360 },			/* wireless */
drivers/input/joystick/xpad.c:	{ 0x03f0, 0x0495, "HyperX Clutch Gladiate", 0, XTYPE_XBOXONE },
drivers/input/joystick/xpad.c:	{ 0x03f0, 0x07A0, "HyperX Clutch Gladiate RGB", 0, XTYPE_XBOXONE },
drivers/input/joystick/xpad.c:	{ 0x03f0, 0x08B6, "HyperX Clutch Gladiate", 0, XTYPE_XBOXONE },		/* v2 */
drivers/input/joystick/xpad.c:	{ 0x03f0, 0x09B4, "HyperX Clutch Tanto", 0, XTYPE_XBOXONE },
drivers/input/joystick/xpad.c:	XPAD_XBOX360_VENDOR(0x03f0),		/* HP HyperX Xbox 360 controllers */
drivers/input/joystick/xpad.c:	XPAD_XBOXONE_VENDOR(0x03f0),		/* HP HyperX Xbox One controllers */

I suspect that the first one is the headphone driver.
The second with joystick in path is driver for controller.

I can also try search in my system.

$ find /lib/modules/$(uname -r) -type f -name '*.ko' | grep -i "quirks\|xpad"
/lib/modules/5.15.0-91-generic/kernel/drivers/input/joystick/psxpad-spi.ko
/lib/modules/5.15.0-91-generic/kernel/drivers/input/joystick/xpad.ko

Conclusions:
- I can find the driver in the system
quirks driver not exist in my system because is added from 5.16 kernel.
I know this from 
https://github.com/torvalds/linux/blob/master/sound/usb/quirks.c
--> History link to the right  --> oldest patch --> 
--> below description 
--> I can expand the link "  6.9-rc1 ... v5.7-rc1 "
and I can see that the oldest kernel containing this file is 5.16
Such knowledge is very helpful.

Can you share any tips about drivers?
Maybe you know some interesting guides how to solve problems with drivers?
What linux distro do you recommend for testing the latest linux drivers?
Comment 1 Artem S. Tashkinov 2024-03-26 21:45:11 UTC
This is not a user support forum, please ask elsewhere, e.g. https://unix.stackexchange.com/questions