Short background on the issue I'm facing. I'm working on implementing a simultaneous UART/I2C operation using a usb bridge, the FT260. The chip relies on HID reports to provide these functionalities.
Plugged in, the hid-generic driver detects two interfaces, 0 and 1, the first is for I2C and the second is for UART. Currently, I have the FT260 driver supporting I2C only loaded as a module (i.e., hid-ft260) and it works fine. Then the latter takes over hid-generic and I think the usbhid is responsible for that. lsusb -t returns:
|__ Port 2: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
dmesg shows the following during boot-up:
hid-generic 0003:0403:6030.0001: hidraw0: USB HID v1.11 Device [FTDI FT260] on usb-xhci-hcd.1.auto-1.2
hid-generic 0003:0403:6030.0002: hidraw1: USB HID v1.11 Device [FTDI FT260] on usb-xhci-hcd.1.auto-1.2
ft260 0003:0403:6030.0001: hidraw0: USB HID v1.11 Device [FTDI FT260] on usb-xhci-hcd.1.auto-1.2/input
ft260 0003:0403:6030.0002: hidraw1: USB HID v1.11 Device [FTDI FT260] on usb-xhci-hcd.1.auto-1.2/input
For UART, I had to use an application that works with the hid-generic. While the driver for I2C can be extended to support UART, maybe as virtual COM port, but it's not that trivial (at least I think) plus I have a working code that I'd like to use and carry on with the rest of the project.
When I try to unbind the interface UART using the following command:
echo -n 0003:0403:6030.0002 > /sys/bus/hid/drivers/ft260/unbind
I can see the binding is gone. However, when I try to bind the exact interface (if 1) to hid-generic
echo -n 0003:0403:6030.0002 > /sys/bus/hid/drivers/hid-generic/bind
I get:
-bash: echo: write error: No such device
hid-generic gets loaded automatically (hot-plug) though when I unload the module hid-ft260 using:
modprobe -r hid-ft260
It sounds like the usbhid locks to a single sub driver at a time based on PID and VID, but could be something else. If you have insights on bypassing this, that'll be very helpful. Thank you.