From: Deepak Kumar Singh <quic_deesin@xxxxxxxxxxx>
Some transports like Glink support the state notifications between
clients using flow control signals similar to serial protocol signals.
Local glink client drivers can send and receive flow control status
to glink clients running on remote processors.
Add APIs to support sending and receiving of flow control status by
rpmsg clients.
Signed-off-by: Deepak Kumar Singh <quic_deesin@xxxxxxxxxxx>
Signed-off-by: Sarannya S <quic_sarannya@xxxxxxxxxxx>
---
drivers/rpmsg/rpmsg_core.c | 21 +++++++++++++++++++++
drivers/rpmsg/rpmsg_internal.h | 2 ++
include/linux/rpmsg.h | 15 +++++++++++++++
3 files changed, 38 insertions(+)
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index a2207c0..cd71a6a 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -331,6 +331,25 @@ int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
EXPORT_SYMBOL(rpmsg_trysend_offchannel);
/**
+ * rpmsg_set_flow_control() - sets/clears serial flow control signals
+ * @ept: the rpmsg endpoint
+ * @enable: pause/resume incoming data flow
+ * @dst: destination address of the endpoint
+ *
+ * Return: 0 on success and an appropriate error value on failure.
+ */
+int rpmsg_set_flow_control(struct rpmsg_endpoint *ept, bool enable, u32 dst)
+{
+ if (WARN_ON(!ept))
+ return -EINVAL;
+ if (!ept->ops->set_flow_control)
+ return -ENXIO;
+
+ return ept->ops->set_flow_control(ept, enable, dst);
+}
+EXPORT_SYMBOL(rpmsg_set_flow_control);