usb: thoughts of adding more support for FT232H

From: Song Qiang
Date: Wed Dec 05 2018 - 09:10:50 EST


Hi Johan,


I've been developing some iio device drivers and found that some people
would like to test their devices with a qemu system which requires an
i2c or spi port on our development hosts. Usually this is achieved with
a DLN-2 adapter, while this is a bit difficult for me because it costs
~175$ in my country. Then I found that FTDI's FT232H supports both these
two modes and costs only less than 5$ but without full support in kernel.
The ftdi-sio driver supports FT232H only as a serial converter.
So I'm planning to write a mfd driver for it supports both these three
modes, here are my thoughts:
Â- This device cannot support these three modes together because they
ÂÂ share some common pins, so I'm planning to add a sysfs entry
ÂÂ 'current_mode' for selecting which mode the device should be working
ÂÂ on.
Â- This device is in uart mode on reset, so default mode would be reset,
ÂÂ too. This also helps for people only want to use this as a serial
ÂÂ converter feels nothing has happened (compatible).
Â- I was trying to reuse the ftdi-sio driver but it seems like mfd can
ÂÂ only register platform devices, while this is a usb driver. I may
ÂÂ have to copy some functions from this driver.

Would you share any ideas? I'd appreciate it.

yours,

Song Qiang