Support for Human Interface Devices over I2C.
There are a couple of points to keep in mind:
# Make sure to also pull in the latest changes for ig4 if on Skylake or Kabylake: e.g. from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221777
# Please refer to the changes I made to usbhid.h and usbhid.c, since I moved the generic hid functionality out of those files into two new ones. The long term aim would be to create a HID abstraction layer (called HID Caps) that will provide a general interface to HID capabilities and functions through the device tree. It will help to make it easier to use Human Interface Devices on different busses without the need of pulling USB into the kernel configuration. This is work in progress and, for now, independent of the I2C over HID support.
# Currently iichid only supports mouse devices and therefore creates /dev/ims*. Considering the previous point you should get an idea of how that will be resolved.
# I use moused with settings in rc.conf like this: moused_port="/dev/ims0"
# moused needs a patch to support device names with the naming scheme ims[0-9]+
# I tried a few approaches to identify and attach an iichid device by querying ACPI directly from the iichid module. That failed on two details: parent association (in general HID over I2C devices appear below ACPI0 in NewBus but it is necessary to have them below the iicbus*/iic* nodes, moving these node in NewBus failed for me with a panic) and also interrupt handling (apparently, interrupts must be handled by the nodes the IRQs are assigned to (i.e. the node below ACPI0). Trying to attach to an IRQ from another node (i.e. a node below iicbus*/i2c*) fails)
# acpi_iichid creates a iichid node below the identifiable iicbus
# acpi_iichid delegates the interrupt handling to iichid by callback