USB: cp210x: work around cp2108 GET_LINE_CTL bug
authorKonstantin Shkolnyy <konstantin.shkolnyy@gmail.com>
Wed, 28 Oct 2015 21:02:54 +0000 (16:02 -0500)
committerJohan Hovold <johan@kernel.org>
Mon, 16 Nov 2015 11:36:44 +0000 (12:36 +0100)
commitd0bf1ff0ae322aca59b00b9a2ad121d35a77e78f
tree706f6d59db649d50ab0b61617ec5bbb156207625
parente2ae67a3b55188b0342522d8139acf013feb2a69
USB: cp210x: work around cp2108 GET_LINE_CTL bug

Add helper to access line-control register in order to work around a
cp2108 GET_LINE_CTL bug.

cp2108 GET_LINE_CTL returns the 16-bit value with the 2 bytes swapped.
However, SET_LINE_CTL functions properly. When the driver tries to modify
the register, it reads it, modifies some bits and writes back. Because the
read bytes were swapped, this often results in an invalid value to be
written. In turn, this causes cp2108 respond with a stall. The stall
sometimes doesn't clear properly and cp2108 starts responding to following
valid commands also with stalls, effectively failing.

Signed-off-by: Konstantin Shkolnyy <konstantin.shkolnyy@gmail.com>
[johan: amend commit message, modify probe error handling ]
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/cp210x.c
This page took 0.02463 seconds and 5 git commands to generate.