summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-01-11 06:35:10 -0800
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2020-04-15 01:24:40 +0200
commitab2682d02d92d08c8299acaae935ed5b825b281c (patch)
treef036cc0cd22a6d4ba0624267b358ad756a5b182b /include
parent70ab26d3eb0f608822906427e0d51d17d6b1d307 (diff)
rpmsg: Introduce "poll" to endpoint ops
This allows rpmsg backends to implement polling of the outgoing buffer, which provides poll support to user space when using the rpmsg character device. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rpmsg.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index 61463282ac62..df056ad6bf78 100644
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
@@ -41,6 +41,7 @@
#include <linux/mod_devicetable.h>
#include <linux/kref.h>
#include <linux/mutex.h>
+#include <linux/poll.h>
#define VIRTIO_RPMSG_F_NS 0
@@ -158,6 +159,9 @@ int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
void *data, int len);
+unsigned int rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
+ poll_table *wait);
+
#else
static inline int register_rpmsg_device(struct rpmsg_device *dev)
@@ -256,6 +260,15 @@ static inline int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
return -ENXIO;
}
+static inline unsigned int rpmsg_poll(struct rpmsg_endpoint *ept,
+ struct file *filp, poll_table *wait)
+{
+ /* This shouldn't be possible */
+ WARN_ON(1);
+
+ return 0;
+}
+
#endif /* IS_ENABLED(CONFIG_RPMSG) */
/* use a macro to avoid include chaining to get THIS_MODULE */