All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Frank Zago <frank@zago.net>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH 1/1] [RFC] USB: serial: ch341: Add I2C support to CH341 driver
Date: Tue, 23 Mar 2021 10:32:03 +0100	[thread overview]
Message-ID: <YFm1kzrPJ00HhoHR@kroah.com> (raw)
In-Reply-To: <4286affb-bed1-0fc1-1d07-a5cb8d475fb1@zago.net>

On Mon, Mar 22, 2021 at 10:22:54PM -0500, Frank Zago wrote:
> The Winchiphead CH341 IC is more than a UART interface. Amongst other
> things, it can talk to an I2C bus.
> 
> Several people have contributed to an out of tree driver: Tse Lun
> Bien, Marco Gittler and Till Harbaum.
> 
>   https://github.com/allanbian1017/i2c-ch341-usb.git
> 
> This commit integrates the I2C portions into the CH341 serial driver
> and exposes the I2C device.
> 
> Tested with a CH341A, CH341B and CH341T.
> 
> Signed-off-by: Frank Zago <frank@zago.net>
> ---
> 
> I didn't find a way to say a USB device has several functions. I
> followed what the CP210x driver did with gpio, but I think it's a
> hack. The private data for the I2C part should be linked to the USB
> device, not the serial port. It works here and in the cp210x driver
> because there is only 1 serial port in the device. If it had 2 or more
> ports, I believe bad things would happen. So is there a better way to
> handle USB devices like that?
> 
> For info, the CH341A/B supports 3 different modes, each with a different
> USB PID, usually selected by jumpers. All of them support I2C, but
> only 2 support UART, one supports SPI and 2 support GPIOs.
> 
> 
>  drivers/usb/serial/Kconfig |   4 +-
>  drivers/usb/serial/ch341.c | 284 ++++++++++++++++++++++++++++++++++++-
>  2 files changed, 283 insertions(+), 5 deletions(-)

$ ./scripts/get_maintainer.pl --file drivers/usb/serial/ch341.c
Johan Hovold <johan@kernel.org> (maintainer:USB SERIAL SUBSYSTEM)
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:USB SUBSYSTEM)
linux-usb@vger.kernel.org (open list:USB SERIAL SUBSYSTEM)
linux-kernel@vger.kernel.org (open list)

Please always send patches to the proper people and mailing lists,
otherwise it will be lost :(

thanks,

greg k-h

      reply	other threads:[~2021-03-23  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23  3:22 [PATCH 1/1] [RFC] USB: serial: ch341: Add I2C support to CH341 driver Frank Zago
2021-03-23  9:32 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YFm1kzrPJ00HhoHR@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=frank@zago.net \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.