USB: serial: ch341: add basis for quirk detection
authorMichael Hanselmann <public@hansmi.ch>
Tue, 31 Mar 2020 23:37:18 +0000 (23:37 +0000)
committerJohan Hovold <johan@kernel.org>
Wed, 27 May 2020 13:00:56 +0000 (15:00 +0200)
commitc404bf4aa9236cb4d1068e499ae42acf48a6ff97
treec4f0e6a7b60ade26eba4a51b3627d88cb2cb56f5
parent986c1748c84d7727defeaeca74a73b37f7d5cce1
USB: serial: ch341: add basis for quirk detection

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. This patch adds a detection function
which will be extended to set quirk flags as they're implemented.

The author's affected device has an imprint of "340" on the
turquoise-colored plug, but not all such devices appear to be affected.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Link: https://lore.kernel.org/r/1e1ae0da6082bb528a44ef323d4e1d3733d38858.1585697281.git.public@hansmi.ch
[ johan: use long type for quirks; rephrase and use port device for
 messages; handle short reads; set quirk flags directly in
 helper function ]
Cc: stable <stable@vger.kernel.org> # 5.5
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ch341.c