How gschorcht/i2c-ch341-usb works
This is a single-file Linux kernel driver that turns a CH341A USB adapter into Linux I2C and GPIO interfaces. The principal workflow is device connection, driver initialization, then host I2C/GPIO operations over USB; GPIO input changes can also produce software or configured rising-edge hardware interrupts. The README documents the user-visible capabilities and constraints. Source excerpts confirm I2C adapter setup, USB transfers, GPIO registration, and IRQ handling; omitted source limits verification of some internal call paths.
Main entry points: i2c-ch341-usb.c Device probe
Components 11
USB device
- Device probe
i2c-ch341-usb.c - USB transfer
i2c-ch341-usb.c
I2C interface
- I2C adapter
i2c-ch341-usb.c - I2C transfer
i2c-ch341-usb.c
GPIO and IRQ
- Board configuration
i2c-ch341-usb.c - GPIO chip
i2c-ch341-usb.c - Input polling
i2c-ch341-usb.c - IRQ handling
i2c-ch341-usb.c
Other components
- Linux host
- CH341A adapter
- I2C devices
Connections 13
- CH341A adapter → Device probe: connects
README.md - Device probe → Board configuration: configures
i2c-ch341-usb.c - Device probe → I2C adapter: registers
i2c-ch341-usb.c - Linux host → I2C adapter: uses
README.md - I2C adapter → I2C transfer: dispatches
i2c-ch341-usb.c - I2C transfer → USB transfer: transfers
i2c-ch341-usb.c - USB transfer → CH341A adapter: exchanges data
- I2C transfer → I2C devices: reads and writes
README.md - Device probe → GPIO chip: registers
README.md - Linux host → GPIO chip: uses
README.md - Input polling → IRQ handling: detects changes
README.md - IRQ handling → Linux host: signals interrupts
README.md - GPIO chip → CH341A adapter: controls pins