bindings: Add mctp_*_init_pollfd() API

The new API allows the binding to own the poll(2) parameters, providing
the opportunity for it to properly idle when it's unable to send control
messages. Despite this, we hold off on adjusting the behaviour directly
in this commit, as it would constitute a regression until
mctp-demux-daemon has also been converted to exploit the new API.

Change-Id: Ic5a7c5a943566a0f36695daa64457440886fb2ab
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/astlpc.c b/astlpc.c
index 8d316e3..4e9e349 100644
--- a/astlpc.c
+++ b/astlpc.c
@@ -30,6 +30,7 @@
 
 #include <unistd.h>
 #include <fcntl.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <linux/aspeed-lpc-ctrl.h>
@@ -1311,6 +1312,15 @@
 	return astlpc->kcs_fd;
 }
 
+int mctp_astlpc_init_pollfd(struct mctp_binding_astlpc *astlpc,
+			    struct pollfd *pollfd)
+{
+	pollfd->fd = astlpc->kcs_fd;
+	pollfd->events = POLLIN;
+
+	return 0;
+}
+
 struct mctp_binding_astlpc *mctp_astlpc_init_fileio(void)
 {
 	struct mctp_binding_astlpc *astlpc;
@@ -1359,4 +1369,11 @@
 	mctp_prlog(MCTP_LOG_ERR, "%s: Missing support for file IO", __func__);
 	return -1;
 }
+
+int mctp_astlpc_init_pollfd(struct mctp_binding_astlpc *astlpc __unused,
+			    struct pollfd *pollfd __unused)
+{
+	mctp_prlog(MCTP_LOG_ERR, "%s: Missing support for file IO", __func__);
+	return -1;
+}
 #endif