spigen under uftdi

John-Mark Gurney jmg at funkthat.com
Thu Oct 29 19:31:56 UTC 2020


Dirk-Willem van Gulik wrote this message on Wed, Oct 28, 2020 at 13:58 +0100:
> Various USB based FT2232H usb to rs232 (and cypress CY7C65211) have a variant mode where they support SPI (or I2C).
> 
> I've got this working in a rudimentary way in the uftdi(4) driver.
> 
> But I'd like to have this surface as a 'normal' spigen(4) device.  So it works with anything that already works on that device*.
> 
> However - spigen(4) seems very tied to the FDT tree. 
> 
> Is this a viable path ?

yes, this is possible, but it will require a bit of kernel coding...

You need to add code to uftdi, to say that it can attach as to a spibus
like one of the other spi drivers does, e.g. gpiospi...

As avg said, hints can/should be able to stand in for OFT, BUT, that would
only be needed for devices to attach to the spi bus, w/ USB, it should be
able to automatically attach a spibus instance to itself when needed...

> Or am I better off using the defintions of the ioctl(4) and simply have the uftdi create something like a  /dev/uftdi-spi0.0 sort of device ?

The advantage of hooking up to the spibus is that other kernel drivers
that talk on the spi bus can use it, whereas this method, only userland
consumers would be able to use it...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-hackers mailing list