最終更新:2018-01-12 (金) 08:10:45 (160d)  

Linux/HID はてなブックマークを見る
Top / Linux / HID

ドキュメント

ソースコード

メモ

.config

drivers/hid/Kconfig

drivers/hid/usbhid/Kconfig

drivers/hid/i2c-hid/Kconfig?

ドライバ

ローレベルドライバ (hid_ll_driver)

usb_hid_driver (USB)

hidp_hid_driver? (Bluetooth)

  • net/bluetooth/hidp/core.c?

i2c_hid_ll_driver? (I2C)

uhid_hid_driver? (UHID)

汎用ドライバ

hid - HID bus support

usbhid - USB HID transport layer

  • kernel.org/doc/Documentation/input/input.txt
  • usbhid is the largest and most complex driver of the whole suite. It handles all HID devices, and because there is a very wide variety of them, and because the USB HID specification isn't simple, it needs to be this big.
  • Currently, it handles USB mice, joysticks, gamepads, steering wheels keyboards, trackballs and digitizers.
  • However, USB uses HID also for monitor controls, speaker controls, UPSs, LCDs and many other purposes.
  • The monitor and speaker controls should be easy to add to the hid/input interface, but for the UPSs and LCDs it doesn't make much sense. For this, the hiddev interface was designed. See kernel.org/doc/Documentation/hid/hiddev.txt for more information about it.
  • The usage of the usbhid module is very simple, it takes no parameters, detects everything automatically and when a HID device is inserted, it detects it appropriately.
  • However, because the devices vary wildly, you might happen to have a device that doesn't work well. In that case #define DEBUG at the beginning of hid-core.c and send me the syslog traces.

hid-generic - Generic HID driver

usbmouse/usbkbd

  • ブートプロトコル用のドライバ。
  • Say Y here only if you are absolutely sure that you don't want to use the generic HID driver for your USB keyboard and prefer to use the keyboard in its limited Boot Protocol mode instead.
  • For embedded systems, for mice with broken HID descriptors and just any other use when the big usbhid wouldn't be a good choice, there is the usbmouse driver.

hid-multitouchとか

ドライバの判定

VID

hid

init

bus_type.probe = hid_device_probe (drivers/hid/hid-core.c)

usbhid

usb_driver.probe = usbhid_probe()

hid-multitouch

hid_driver.probe = mt_probe?()

API

hidraw

  • /dev/hidraw raw HID device support
  • Linux/dev/hidrawXを通してHIDデバイスを読み書き
  • CONFIG_HIDRAW - Linux 2.6.24?
  • In comparison to hiddev, this device does not process the hid events at all (no parsing, no lookups)

hiddev

  • /dev/hiddev raw HID device support
  • CONFIG_USB_HIDDEV - Linux 2.6.22?
  • Linux/dev/usb/hiddev?
  • drivers/hid/usbhid/hiddev.c?

UHID

  • User-space I/O driver support for HID subsystem
  • HIDのトランスポートレイヤを実装するためのドライバ。
  • drivers/hid/uhid.c

ドライバ

hid_ll_driver - low level driver callbacks

usb_class_driver

  • hiddev_class? - hiddev%d

usb_driver

hid

hid_generic?

  • drivers/hid/hid-generic.ko?
  • depends:hid

mac_hid?

  • drivers/macintosh/mac_hid.ko?

g_hid

  • drivers/gadget/g_hid.ko?

Bluetooth

  • net/bluetooth/hidp/hidp.ko?