summaryrefslogtreecommitdiff
path: root/drivers/tty/serdev/core.c
diff options
context:
space:
mode:
authorNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>2023-03-16 22:52:12 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-04-23 21:51:25 -0700
commit8eaf839e4ac4feadf06e03eeff34059795450712 (patch)
treeb89e0251403aca48e670d30bf87295d8eee56596 /drivers/tty/serdev/core.c
parent29f93a687f3c435e94d026ee1fc8ad18ce56b7fb (diff)
downloadlinux-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/core.c')
-rw-r--r--drivers/tty/serdev/core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 078fe64625cb..e7d663901c07 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -405,6 +405,17 @@ int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear)
}
EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);
+int serdev_device_break_ctl(struct serdev_device *serdev, int break_state)
+{
+ struct serdev_controller *ctrl = serdev->ctrl;
+
+ if (!ctrl || !ctrl->ops->break_ctl)
+ return -EOPNOTSUPP;
+
+ return ctrl->ops->break_ctl(ctrl, break_state);
+}
+EXPORT_SYMBOL_GPL(serdev_device_break_ctl);
+
static int serdev_drv_probe(struct device *dev)
{
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);