summaryrefslogtreecommitdiff
path: root/include/linux/serdev.h
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2017-03-28 18:59:31 +0300
committerMarcel Holtmann <marcel@holtmann.org>2017-04-12 23:12:16 +0300
commitb3f80c8f75efb2e6a817a0e48bf36cd30685a138 (patch)
tree0c87449d8c01772ebb9ec801b0de332a51c90331 /include/linux/serdev.h
parent2f09276769a1f9c515e7767284fb188198ddfed7 (diff)
downloadlinux-b3f80c8f75efb2e6a817a0e48bf36cd30685a138.tar.xz
serdev: add serdev_device_wait_until_sent
Add method, which waits until the transmission buffer has been sent. Note, that the change in ttyport_write_wakeup is related, since tty_wait_until_sent will hang without that change. Acked-by: Rob Herring <robh@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sre@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/linux/serdev.h')
-rw-r--r--include/linux/serdev.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index 9519da6253a8..a308b206d204 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -81,6 +81,7 @@ struct serdev_controller_ops {
void (*close)(struct serdev_controller *);
void (*set_flow_control)(struct serdev_controller *, bool);
unsigned int (*set_baudrate)(struct serdev_controller *, unsigned int);
+ void (*wait_until_sent)(struct serdev_controller *, long);
};
/**
@@ -186,6 +187,7 @@ int serdev_device_open(struct serdev_device *);
void serdev_device_close(struct serdev_device *);
unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
void serdev_device_set_flow_control(struct serdev_device *, bool);
+void serdev_device_wait_until_sent(struct serdev_device *, long);
int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
void serdev_device_write_flush(struct serdev_device *);
int serdev_device_write_room(struct serdev_device *);
@@ -223,6 +225,7 @@ static inline unsigned int serdev_device_set_baudrate(struct serdev_device *sdev
return 0;
}
static inline void serdev_device_set_flow_control(struct serdev_device *sdev, bool enable) {}
+static inline void serdev_device_wait_until_sent(struct serdev_device *sdev, long timeout) {}
static inline int serdev_device_write_buf(struct serdev_device *sdev, const unsigned char *buf, size_t count)
{
return -ENODEV;