tty: imx serial: Implement support for reversing TX and RX polarity
authorGeorge Hilliard <ghilliard@kopismobile.com>
Wed, 26 Feb 2020 22:23:19 +0000 (16:23 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2020 12:26:26 +0000 (13:26 +0100)
commit5a08a4877aed53ba92ffef6b1e24fb092a490757
tree36d9a03625ac300158de3fd19e5ee8cbda75b1ca
parent9dd5185a206d714a6e960095471b472171eccf0a
tty: imx serial: Implement support for reversing TX and RX polarity

The peripheral has support for inverting its input and/or output
signals.  This is useful if the hardware flips polarity of the
peripheral's signal, such as swapped +/- pins on an RS-422 transceiver,
or an inverting level shifter.  Add support for these control registers
via the device tree binding.

As part of this change, make the writes of the various registers more
uniform by moving the UCR3 block up near the other registers' blocks,
since the INVT bit must be set before enabling the peripheral.

Signed-off-by: George Hilliard <ghilliard@kopismobile.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20200226222319.18383-3-ghilliard@kopismobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c