summaryrefslogtreecommitdiff
path: root/include/linux/serdev.h
diff options
context:
space:
mode:
authorNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>2023-03-16 22:52:12 +0530
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2023-07-25 16:21:10 +0200
commit3581b2a6693ccad39e3cbf038fd4651e2ac09447 (patch)
tree7b7880a976bbc0b4c6152ee21a8771b3d0f641ab /include/linux/serdev.h
parent46d95daf358fc9d83e043525774aff1b66ab4869 (diff)
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. Upstream-Status: Backport [8eaf839e4ac4feadf06e03eeff34059795450712] 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 'include/linux/serdev.h')
-rw-r--r--include/linux/serdev.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index 66f624fc618c..c065ef1c82f1 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -92,6 +92,7 @@ struct serdev_controller_ops {
void (*wait_until_sent)(struct serdev_controller *, long);
int (*get_tiocm)(struct serdev_controller *);
int (*set_tiocm)(struct serdev_controller *, unsigned int, unsigned int);
+ int (*break_ctl)(struct serdev_controller *ctrl, unsigned int break_state);
};
/**
@@ -202,6 +203,7 @@ int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_
void serdev_device_wait_until_sent(struct serdev_device *, long);
int serdev_device_get_tiocm(struct serdev_device *);
int serdev_device_set_tiocm(struct serdev_device *, int, int);
+int serdev_device_break_ctl(struct serdev_device *serdev, int break_state);
void serdev_device_write_wakeup(struct serdev_device *);
int serdev_device_write(struct serdev_device *, const unsigned char *, size_t, long);
void serdev_device_write_flush(struct serdev_device *);
@@ -255,6 +257,10 @@ static inline int serdev_device_set_tiocm(struct serdev_device *serdev, int set,
{
return -ENOTSUPP;
}
+static inline int serdev_device_break_ctl(struct serdev_device *serdev, int break_state)
+{
+ return -EOPNOTSUPP;
+}
static inline int serdev_device_write(struct serdev_device *sdev, const unsigned char *buf,
size_t count, unsigned long timeout)
{