diff options
author | Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com> | 2023-03-16 22:52:12 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-04-23 21:51:25 -0700 |
commit | 8eaf839e4ac4feadf06e03eeff34059795450712 (patch) | |
tree | b89e0251403aca48e670d30bf87295d8eee56596 /drivers/tty/serdev/serdev-ttyport.c | |
parent | 29f93a687f3c435e94d026ee1fc8ad18ce56b7fb (diff) | |
download | linux-8eaf839e4ac4feadf06e03eeff34059795450712.tar.gz linux-8eaf839e4ac4feadf06e03eeff34059795450712.tar.bz2 linux-8eaf839e4ac4feadf06e03eeff34059795450712.zip |
serdev: Add method to assert break signal over tty UART port
Adds serdev_device_break_ctl() and an implementation for ttyport.
This function simply calls the break_ctl in tty layer, which can
assert a break signal over UART-TX line, if the tty and the
underlying platform and UART peripheral supports this operation.
Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/tty/serdev/serdev-ttyport.c')
-rw-r--r-- | drivers/tty/serdev/serdev-ttyport.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c index f26ff82723f1..8033ef19669c 100644 --- a/drivers/tty/serdev/serdev-ttyport.c +++ b/drivers/tty/serdev/serdev-ttyport.c @@ -247,6 +247,17 @@ static int ttyport_set_tiocm(struct serdev_controller *ctrl, unsigned int set, u return tty->ops->tiocmset(tty, set, clear); } +static int ttyport_break_ctl(struct serdev_controller *ctrl, unsigned int break_state) +{ + struct serport *serport = serdev_controller_get_drvdata(ctrl); + struct tty_struct *tty = serport->tty; + + if (!tty->ops->break_ctl) + return -EOPNOTSUPP; + + return tty->ops->break_ctl(tty, break_state); +} + static const struct serdev_controller_ops ctrl_ops = { .write_buf = ttyport_write_buf, .write_flush = ttyport_write_flush, @@ -259,6 +270,7 @@ static const struct serdev_controller_ops ctrl_ops = { .wait_until_sent = ttyport_wait_until_sent, .get_tiocm = ttyport_get_tiocm, .set_tiocm = ttyport_set_tiocm, + .break_ctl = ttyport_break_ctl, }; struct device *serdev_tty_port_register(struct tty_port *port, |