linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/1] usb: serial: add support for CH348
@ 2024-05-07 13:15 Corentin Labbe
  2024-05-07 13:15 ` [PATCH 1/1 v7] " Corentin Labbe
  0 siblings, 1 reply; 17+ messages in thread
From: Corentin Labbe @ 2024-05-07 13:15 UTC (permalink / raw)
  To: gregkh, johan
  Cc: linux-kernel, linux-usb, martin.blumenstingl, david,
	Corentin Labbe

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

Changes since v5:
- Fixed all reported problem from https://lore.kernel.org/lkml/20230106135338.643951-1-clabbe@baylibre.com/T/#m044aab24dfb652ea34aa06f8ef704da9d6a2e036
- Major change is dropping of all status handling which was unused.
  It will be probably necessary to bring it back when using GPIO.
  This will be done when I will finish my next devboard.

Changes since v6:
- read and print the device version during probe
- Only request one bulk out channel from usb-serial core
- Implement status report / interrupt handling
- Fix buffer->rate calculation / enable support for slow baud rates
- use a mutex to protect against concurrent writes
- split write buffers for slow baud rates

Important note, v7 is mostly done from work of Martin Blumenstingl,
so the changelog was built from https://github.com/xdarklight/ch348/commits/main/
Great thanks to him

Corentin Labbe (1):
  usb: serial: add support for CH348

 drivers/usb/serial/Kconfig  |   9 +
 drivers/usb/serial/Makefile |   1 +
 drivers/usb/serial/ch348.c  | 725 ++++++++++++++++++++++++++++++++++++
 3 files changed, 735 insertions(+)
 create mode 100644 drivers/usb/serial/ch348.c

-- 
2.43.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-01-16 15:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07 13:15 [PATCH v7 0/1] usb: serial: add support for CH348 Corentin Labbe
2024-05-07 13:15 ` [PATCH 1/1 v7] " Corentin Labbe
2024-05-26 20:00   ` Martin Blumenstingl
2024-06-19 13:34   ` Paul Spooren
2024-06-22 19:00     ` Martin Blumenstingl
2024-06-27  7:14       ` Johan Hovold
2024-06-28 19:37         ` Martin Blumenstingl
2024-07-22 14:21   ` Johan Hovold
2024-07-22 21:22     ` Martin Blumenstingl
2024-07-23 16:12       ` Johan Hovold
2024-08-25 10:56         ` Martin Blumenstingl
2024-11-30  2:52           ` David Heidelberg
2025-01-06 13:26             ` Corentin LABBE
2025-01-13 10:21             ` Corentin LABBE
2025-01-14 15:39           ` Johan Hovold
2025-01-14 21:40             ` Martin Blumenstingl
2025-01-16 15:03               ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).