Re: i2c bus via USB adapter

"Daniel O'Connor" <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>

> On 11 Jul 2022, at 11:48, John Kennedy <[email protected]> wrote:
>  Simple recursive grepping didn't get me any hits for MCP2221, and there is
> a TON of hits for Microchip, so currently assuming that FreeBSD doesn't have
> a driver yet.  Total ignorance at this point, but if there was a driver, would
> the expected behavior (assuming right drivers are loaded) would be for the
> system to figure out there was an I2C bus hiding behind it and make another
> /dev/iic# available, devoted to it?

I don't believe there is a FreeBSD driver for it.

>  A ugen driver (generic USB) seems right.  The umodem driver seems
> reasonable (serial device).  The uhid driver seems wrong, at least in
> this case, but of course most of the hits I see on the forums are mice
> and such, so maybe misidentified in this case.

Checking the MCP2221 data sheet shows it does present itself as UART (since it is a UART) and HID (for I2C control)

HID is common because it means you don't need a custom driver (and the associated cost/PITA factor with signing one for Windows & OSX).

Something like this should work on FreeBSD: https://github.com/ZakKemble/libmcp2221
(Might take a bit of porting though)

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.