mbox series

[v5,0/2] usb: serial: add support for CH348

Message ID 20230106135338.643951-1-clabbe@baylibre.com
Headers show
Series usb: serial: add support for CH348 | expand

Message

Corentin Labbe Jan. 6, 2023, 1:53 p.m. UTC
Hello

The CH348 is an octo serial to USB adapter.
The following patch adds a driver for supporting it.
Since there is no public datasheet, unfortunatly it remains some magic values.

It was tested with a large range of baud from 1200 to 1500000 and used with
success in one of our kernel CI testlab.

Regards

Changes since v1:
- use a data structure for encoding/decoding messages.
- check if needed endpoints exists
- fix URB leak in ch348_allocate_status_read error case
- test for maximum baud rate as stated by datasheet

Changes since v2:
- specify ch348_rxbuf data length
- Use correct speed_t dwDTERate instead of __le32
- test for maximum baud rate supported according to datasheet
- Use a define for CH348_TX_HDRSIZE

Changes since v3
- Fixed all reported problem from https://lore.kernel.org/lkml/Y5NDwEakGJbmB6+b@Red/T/#mb6234d0427cfdabf412190565e215995a41482dd
  Mostly reworked the endpoint mux to be the same than mx_uport

Changes since v4:
- The V4 was sent against stable and next have ch348_set_termios ktermios
  parameter const that I forgot to change


Corentin Labbe (2):
  usb: serial: add support for CH348
  usb: serial: add myself as maintainer of CH348

 MAINTAINERS                 |   5 +
 drivers/usb/serial/Kconfig  |   9 +
 drivers/usb/serial/Makefile |   1 +
 drivers/usb/serial/ch348.c  | 660 ++++++++++++++++++++++++++++++++++++
 4 files changed, 675 insertions(+)
 create mode 100644 drivers/usb/serial/ch348.c

Comments

Johan Hovold Feb. 16, 2023, 9:22 a.m. UTC | #1
On Fri, Jan 06, 2023 at 01:53:38PM +0000, Corentin Labbe wrote:
> Since I did the driver and have hardware to test, set myself as
> maintainer of it.
> 
> Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
> ---
>  MAINTAINERS | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7729a30b9609..71b63b174703 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4915,6 +4915,11 @@ S:	Maintained
>  F:	drivers/auxdisplay/cfag12864bfb.c
>  F:	include/linux/cfag12864b.h
>  
> +CH348 USB SERIAL ADAPTER

Please name this

	USB SERIAL DRIVER FOR CH348

to keep related entries together.

> +M:	Corentin Labbe <clabbe@baylibre.com>
> +S:	Maintained
> +F:	drivers/usb/serial/ch348.c
> +
>  CHAR and MISC DRIVERS
>  M:	Arnd Bergmann <arnd@arndb.de>
>  M:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Johan