Re: [PATCH v6 3/4] i2c: ch341: add I2C MFD cell driver for the CH341

From: Randy Dunlap
Date: Thu Jun 16 2022 - 01:10:05 EST


Hi--

On 6/15/22 18:37, frank zago wrote:
> The I2C interface can run at 4 different speeds. This driver currently
> only offer 100kHz. Tested with a variety of I2C sensors, and the IIO
> subsystem.
>
> Signed-off-by: frank zago <frank@xxxxxxxx>
> ---
> MAINTAINERS | 1 +
> drivers/i2c/busses/Kconfig | 10 +
> drivers/i2c/busses/Makefile | 1 +
> drivers/i2c/busses/i2c-ch341.c | 377 +++++++++++++++++++++++++++++++++
> 4 files changed, 389 insertions(+)
> create mode 100644 drivers/i2c/busses/i2c-ch341.c
>

> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index a1bae59208e3..db9797345ad5 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -1199,6 +1199,16 @@ config I2C_RCAR
>
> comment "External I2C/SMBus adapter drivers"
>
> +config I2C_CH341
> + tristate "CH341 USB to I2C support"
> + select MFD_CH341
> + help
> + If you say yes to this option, I2C support will be included for the
> + WCH CH341, a USB to I2C/SPI/GPIO interface.
> +
> + This driver can also be built as a module. If so, the module
> + will be called i2c-ch341.

I haven't tested it, but just from reading, it looks like
this one needs a "depends on USB" since it selects MFD_CH341, which
depends on USB, and since 'select' ignores dependency chains.

The GPIO driver (patch 2/4) already depends on USB.

--
~Randy