Skip to content

USB: serial: ch341: Add support for limited chips (was: Add support for HL340 devices)

Michael Hanselmann linux-usb 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest6 patches 16 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6USB: serial: ch341: Reduce special cases in clock calculationdrivers/usb/serial/ch341.c+56 -340 replies
2/6USB: serial: ch341: Add basis for quirk detectiondrivers/usb/serial/ch341.c+49 -01 reply
3/6USB: serial: ch341: Limit prescaler on quirky chipsdrivers/usb/serial/ch341.c+52 -184 replies
4/6USB: serial: ch341: Name prescaler, divisor registersdrivers/usb/serial/ch341.c+14 -23 replies
5/6USB: serial: ch341: Compute minimum baud ratedrivers/usb/serial/ch341.c+5 -32 replies
6/6USB: serial: ch341: Simulate break condition if not supporteddrivers/usb/serial/ch341.c+85 -105 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] USB: serial: ch341: Add support for limited chips (was: Add support for HL340 devices)

A subset of CH341 devices does not support all features, namely the prescaler is limited to a reduced precision and there is no support for sending a RS232 break condition.

These devices can usually be identified by an imprint of "340" on the turquoise-colored plug. They're also sometimes called "HL340", but not all such devices are affected.

This series takes multiple steps to support the limited chips:

* Remove special cases from clock prescaler computation
* Detect limited devices by trying to read a register related to sending a break condition
* Amend clock prescaler computation to only use working values on limited chips
* Simulate an RS232 break condition by temporarily lowering the baud rate and sending a NUL byte

Michael Hanselmann (6):
USB: serial: ch341: Reduce special cases in clock calculation
USB: serial: ch341: Add basis for quirk detection
USB: serial: ch341: Limit prescaler on quirky chips
USB: serial: ch341: Name prescaler, divisor registers
USB: serial: ch341: Compute minimum baud rate
USB: serial: ch341: Simulate break condition if not supported

 drivers/usb/serial/ch341.c | 294 ++++++++++++++++++++++++++++++-------
 1 file changed, 244 insertions(+), 50 deletions(-)
Signature · 1 line
2.20.1