[PATCH v2 0/1] HID: ft260: add usb hid to i2c host bridge driver

From: Michael Zaidman
Date: Fri Feb 19 2021 - 11:38:24 EST


The FTDI FT260 chip implements USB to I2C/UART bridges through two
USB HID class interfaces [1]. The first - for I2C, and the second
for UART. Each interface is independent, and the kernel detects it
as a separate USB hidraw device.

There is no I2C master/host driver for this chip to date, and FTDI
suggests using hidraw and libusb userspace libraries to operate the
FT260 I2C host controller via hidraw Linux kernel driver. But this
approach makes the standard Linux I2C tools useless, and it does not
allow the I2C sysfs tree instantiation required by I2C multiplexers
and switches.

This commit adds the I2C host adapter support, enabling a wide range
of the standard userspace I2C tools and applications that do not
implement HID protocol, accessing the I2C client devices via FT260
USB to I2C controller.

The driver was tested with various I2C client devices like PCA9548,
PCAL6524, 24C0x, different QSFP-DD and OSFP transceivers, and Linux
userspace I2C tools (i2cdetect, i2cdump, i2cget and i2cset).

HID commands and responses are FT260 specific and documented in the
AN_394_User_Guide_for_FT260.pdf [2].

[1] - https://ftdichip.com/wp-content/uploads/2020/07/DS_FT260.pdf
[2] - https://www.ftdichip.com/Support/Documents/AppNotes/AN_394_User_Guide_for_FT260.pdf

Changes since v1:
- Refined the cover letter content.
- Reduced number of debugging messages.
- Removed unused ft260_request_report structure.
- Relocated module build rule in the Makefile according to
alphabetic order.

Michael Zaidman (1):
HID: ft260: add usb hid to i2c host bridge driver

MAINTAINERS | 7 +
drivers/hid/Kconfig | 11 +
drivers/hid/Makefile | 1 +
drivers/hid/hid-ft260.c | 1053 +++++++++++++++++++++++++++++++++++++++
drivers/hid/hid-ids.h | 1 +
5 files changed, 1073 insertions(+)
create mode 100644 drivers/hid/hid-ft260.c


base-commit: abaf6f60176f1ae9d946d63e4db63164600b7b1a
--
2.25.1