i2c: Add FTDI FT4222H USB I2C adapter
PATCH v4 1/1 i2c: Add FTDI FT4222H USB I2C adapter
FT4222H exports a USB interface to operate as I2C bus master when set up (via the DCNF pins) in configuration mode 0 or 3.
The USB communication protocol implemented by the FT4222 chip is not publicly documented, therefore the name assigned to the various defines used in the USB communication code is a semi-educated guess after sniffing USB traffic generated with the FTDI FT4222 userspace library.
---
Changes from v3 [3]:
- added trailing new line to format string in dev_dbg/dev_err calls
- added FT4222_FLAG_START to the flag mask for the first packet in ft4222_i2c_write()
Changes from v2 [2]:
- added delay between retries and decreased maximum retries in ft4222_i2c_get_status()
Changes from v1 [1]:
- replaced magic numbers with symbolic constants
- changed enums to use capital letters
- decreased max retries in ft4222_i2c_get_status()
- removed not so useful dev_dbg() call
- removed handling of configuration modes 1 and 2
- miscellaneous stylistic changes
[1] https://lore.kernel.org/linux-i2c/[email protected]/T/
[2] https://lore.kernel.org/linux-i2c/[email protected]/T/
[3] https://lore.kernel.org/linux-i2c/[email protected]/T/
.../ABI/testing/sysfs-bus-i2c-devices-ft4222 | 7 + drivers/i2c/busses/Kconfig | 11 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-ft4222.c | 454 ++++++++++++++++++ 4 files changed, 473 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-i2c-devices-ft4222 create mode 100644 drivers/i2c/busses/i2c-ft4222.c
Documentation/ABI/testing/sysfs-bus-i2c-devices-ft4222 new file +7 -0
@@ -0,0 +1,7 @@ +What: /sys/bus/i2c/devices/i2c-<bus-id>/i2c_freq +Date: April 2026 +KernelVersion: 7.1 +Contact: Francesco Lavra <[email protected]> +Description: (RW) I2C bus clock frequency, expressed in Hz. + Accepted values range from 100000 (standard mode) to 3400000 + (high-speed mode).
drivers/i2c/busses/Kconfig +11 -0
@@ -1455,6 +1455,17 @@ config I2C_TINY_USB This driver can also be built as a module. If so, the module will be called i2c-tiny-usb. +config I2C_FT4222 + tristate "FTDI FT4222 USB to I2C interface" + depends on USB + help + Include support for interfacing with I2C devices via an FTDI + FT4222H USB device that acts as I2C master. + The I2C interface is available when the chip is set up (via the + DCNF0 and DCNF1 pins) in configuration mode 0 or 3. + + If built as a module, this driver creates a module called i2c-ft4222. + config I2C_VIPERBOARD tristate "Viperboard I2C master support" depends on MFD_VIPERBOARD && USB
drivers/i2c/busses/Makefile +1 -0
@@ -144,6 +144,7 @@ obj-$(CONFIG_I2C_PCI1XXXX) += i2c-mchp-pci1xxxx.o obj-$(CONFIG_I2C_ROBOTFUZZ_OSIF) += i2c-robotfuzz-osif.o obj-$(CONFIG_I2C_TAOS_EVM) += i2c-taos-evm.o obj-$(CONFIG_I2C_TINY_USB) += i2c-tiny-usb.o +obj-$(CONFIG_I2C_FT4222) += i2c-ft4222.o obj-$(CONFIG_I2C_VIPERBOARD) += i2c-viperboard.o # Other I2C/SMBus bus drivers
drivers/i2c/busses/i2c-ft4222.c new file +454 -0
454 lines not on this page · raw message
Signature · 1 line
2.39.5
Friendly ping
Quoted 9 lines · Francesco Lavra
FT4222H exports a USB interface to operate as I2C bus master when set up (via the DCNF pins) in configuration mode 0 or 3.
The USB communication protocol implemented by the FT4222 chip is not publicly documented, therefore the name assigned to the various defines used in the USB communication code is a semi-educated guess after sniffing
USB traffic generated with the FTDI FT4222 userspace library.Signed-off-by Francesco Lavra <[email protected]>
Another friendly ping
Quoted 14 lines · Francesco Lavra
Friendly ping
Quoted 10 lines · Francesco Lavra
FT4222H exports a USB interface to operate as I2C bus master when set up
(via the DCNF pins) in configuration mode 0 or 3.
The USB communication protocol implemented by the FT4222 chip is not publicly documented, therefore the name assigned to the various defines used in the USB communication code is a semi-educated guess after sniffing
USB traffic generated with the FTDI FT4222 userspace library.Signed-off-by Francesco Lavra <[email protected]>
Quoted 17 lines · Francesco Lavra
Another friendly ping
Quoted 14 lines · Francesco Lavra
Friendly ping
Quoted 11 lines · Francesco Lavra
FT4222H exports a USB interface to operate as I2C bus master when set up
(via the DCNF pins) in configuration mode 0 or 3.
The USB communication protocol implemented by the FT4222 chip is not publicly documented, therefore the name assigned to the various defines
used in the USB communication code is a semi-educated guess after sniffing
USB traffic generated with the FTDI FT4222 userspace library.Signed-off-by Francesco Lavra <[email protected]>
It has been more than six months since I sent v4 of this patch, and there has not been any followup on this, other than my attempts to revive this thread. And that is after all review comments from the previous iterations have been addressed.
Is there anything else I should do to help this patch move forward? Thanks