1

I want to try to implement gyro feature for Switch Pro joystick. For now it works, but no gyro input is supported, so it's implemented somewhere.

However, I can't find where that code is, while wiimote or sony ones are pretty obvious. So, where is Switch Pro handling code in linux kernel? Is it using some generic driver for different joysticks now?

UPD: on connecting dmesg says

[ 8838.878057] hid-generic 0005:057E:2009.0006: unknown main item tag 0x0
[ 8838.878116] input: Pro Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/bluetooth/hci0/hci0:62/0005:057E:2009.0006/input/input24
[ 8838.878277] hid-generic 0005:057E:2009.0006: input,hidraw4: BLUETOOTH HID v0.01 Gamepad [Pro Controller] on 00:1a:7d:da:71:13

So I guess that it's generic driver.

1 Answers1

1

As you surmise, this joystick is handled by the hid-generic driver, so there’s no joystick-specific code. The other HID drivers in drivers/hid could provide inspiration if you want to write a specific driver.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164