USB: serial: xr: add support for XR21B1421, XR21B1422 and XR21B1424
authorJohan Hovold <johan@kernel.org>
Mon, 12 Apr 2021 09:55:52 +0000 (11:55 +0200)
committerJohan Hovold <johan@kernel.org>
Tue, 13 Apr 2021 16:36:33 +0000 (18:36 +0200)
commit607f67183742eeb45e316e89dc7fec64d6288308
tree26b3775b6d45cf20d69f968a9ffcdf86921a00ae
parentf865e614604cb6b5ea76462ad314c90a62b918c4
USB: serial: xr: add support for XR21B1421, XR21B1422 and XR21B1424

The XR21B1421, XR21B1422 and XR21B1424 are the one-, two- and four-port
models of a second XR21B142X type of the Maxlinear/Exar USB UARTs.

The XR21B142X type differs from XR21V141X in several ways, including:

- register layout
- register width (16-bit instead of 8-bit)
- vendor register requests
- UART enable/disable sequence
- custom-driver mode flag
- three additional GPIOs (9 instead of 6)

As for XR21V141X, the XR21B142X vendor requests encode the channel index
in the MSB of wIndex, but it lacks the UART Manager registers which
have been replaced by regular UART registers. The new type also uses the
interface number of the control interface (0, 2, 4, 6) as channel index
instead of the channel number (0, 1, 2, 3).

The XR21B142X lacks the divisor and format registers used by XR21V141X
and instead uses the CDC SET_LINE_CONTROL request to configure the line
settings.

Note that the currently supported XR21V141X type lacks the custom-driver
mode flag that prevents the device from entering CDC-ACM mode when a CDC
requests is received. This specifically means that the SET_LINE_CONTROL
request cannot be used with XR21V141X even though it is otherwise
supported.

The UART enable sequence for XR21B142X does not involve explicitly
enabling the FIFOs, but according to datasheet the UART must be disabled
when writing any register but GPIO_SET, GPIO_CLEAR, TX_BREAK and
ERROR_STATUS.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/xr_serial.c