Hi Danny, On Sat, Jan 28, 2023 at 9:26 PM Danny Kaehn <kaehndan@xxxxxxxxx> wrote: > > This patchset allows USB-HID devices to have DeviceTree bindings through sharing > the USB of_node with the HID driver, and adds such a binding and driver > implementation for the CP2112 USB to SMBus Bridge (which necessitated the > USB-HID change). This change allows a CP2112 permanently attached in hardware to > be described in DT and interoperate with other drivers, and exposed the threaded > interrupt bug fixed in patch 0003. That series is very interesting. I always wondered how I could declare an I2C device attached to the CP2112 over USB. Ideally if you can make this compatible with ACPI SSDT, that would be even better :) (one can always dream). > > Plese correct if the assumption made that there is a 1:1 correlation between > a USB device and its HID device is not always true. If so, patch 0002 would > then need to be reworked. I am not sure I understand patch 2 completely, but if your assumption is that each struct usb_interface can have at most one hid device, it seems that it is the case. However, nothing prevents another hid driver to add one more hid device on top of that USB dev. For instance, hid-logitech-dj does that: when it enumerates the devices connected to the wireless receiver, it creates matching HID devices with the parent being the current HID dev. AFAICT, we already have DT enumeration for i2c-hid devices, so probably your solution is correct. Though the DT enumeration in i2c-hid-of.c relies on .of_match_table, which seems a little bit more integrated than this series (but I don't know enough of DT unfortunately). So I personally won't push against that series, but I'd still like to have a rough idea on what is missing in patch 2 if we consider that your assumption might not always be the case. Maybe (just random brain fart) we could have a separate usbhid-of.c in the usbhid subdir that builds up the same OF matching that i2c-hid-of.c is doing? Cheers, Benjamin > > > Danny Kaehn (4): > dt-bindings: hid: Add CP2112 HID USB to SMBus Bridge > Share USB device devicetree node with child HID device > Fix CP2112 driver not registering GPIO IRQ chip as threaded > CP2112 Devicetree Support > > .../bindings/hid/silabs,cp2112.yaml | 82 +++++++++++++++++++ > drivers/hid/hid-cp2112.c | 10 +++ > drivers/hid/usbhid/hid-core.c | 2 + > 3 files changed, 94 insertions(+) > create mode 100644 Documentation/devicetree/bindings/hid/silabs,cp2112.yaml > > -- > 2.25.1 >