tty: serial: Add RS422 flag to struct serial_rs485
authorCrescent CY Hsieh <crescentcy.hsieh@moxa.com>
Fri, 1 Dec 2023 07:15:54 +0000 (15:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jan 2024 15:20:36 +0000 (16:20 +0100)
commit6056f20f27e99fb67582f299468328505f130e36
treeb948b9d83163023c5e59a9948e54dcdb9d2fb492
parent76ac8e29855b06331d77a1d237a28ce97ac67a38
tty: serial: Add RS422 flag to struct serial_rs485

Add "SER_RS485_MODE_RS422" flag to struct serial_rs485, so that serial
port can switch interface into RS422 if supported by using ioctl command
"TIOCSRS485".

By treating RS422 as a mode of RS485, which means while enabling RS422
there are two flags need to be set (SER_RS485_ENABLED and
SER_RS485_MODE_RS422), it would make things much easier. For example
some places that checks for "SER_RS485_ENABLED" won't need to be rewritten.

Signed-off-by: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
Link: https://lore.kernel.org/r/20231201071554.258607-3-crescentcy.hsieh@moxa.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c
include/uapi/linux/serial.h