USB: serial: cp210x: add support for line-status events
authorJohan Hovold <johan@kernel.org>
Mon, 13 Jul 2020 10:55:14 +0000 (12:55 +0200)
committerJohan Hovold <johan@kernel.org>
Tue, 14 Jul 2020 09:50:14 +0000 (11:50 +0200)
commita7207e9835a4f245c8c693170906fda0980273f3
tree9ff5682c5f99b47c068b8522e56dba606ed03d9e
parentbcbb9d812eead97e1fc01b223c0c5586a4ff08d9
USB: serial: cp210x: add support for line-status events

Add support for line-status events that specifically can be used to
detect and report parity errors.

Enable the device's event-insertion mode whenever input-parity checking
is requested. This will insert line and modem status events into the
data stream.

Note that modem-status changes appear to be buffered until a character
is received (at least on CP2102) and support is therefore left
unimplemented.

On at least one type of these chips (CP2102), line breaks are not
reported as expected either (regardless of whether SERIAL_BREAK_CHAR is
set) so do not enable event-mode when !IGNBRK is requested for now.

Link: https://lore.kernel.org/r/20200713105517.27796-3-johan@kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/cp210x.c