fpga: dfl: introduce interrupt trigger setting API
authorXu Yilun <yilun.xu@intel.com>
Tue, 16 Jun 2020 04:08:44 +0000 (12:08 +0800)
committerMoritz Fischer <mdf@kernel.org>
Sun, 28 Jun 2020 19:43:16 +0000 (12:43 -0700)
commit322b598be4d9b9090cda560c4caab78704615ab4
tree283e567dd6d5f36250dee984614ab15897d78655
parentbfef946dbe1bbe6cae97bba27594e8d5b0e01ffa
fpga: dfl: introduce interrupt trigger setting API

FPGA user applications may be interested in interrupts generated by
DFL features. For example, users can implement their own FPGA
logics with interrupts enabled in AFU (Accelerated Function Unit,
dynamic region of DFL based FPGA). So user applications need to be
notified to handle these interrupts.

In order to allow userspace applications to monitor interrupts,
driver requires userspace to provide eventfds as interrupt
notification channels. Applications then poll/select on the eventfds
to get notified.

This patch introduces a generic helper functions to do eventfds binding
with given interrupts.

Sub feature drivers are expected to use XXX_GET_IRQ_NUM to query irq
info, and XXX_SET_IRQ to set eventfds for interrupts. This patch also
introduces helper functions for these 2 ioctls.

Signed-off-by: Luwei Kang <luwei.kang@intel.com>
Signed-off-by: Wu Hao <hao.wu@intel.com>
Signed-off-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Wu Hao <hao.wu@intel.com>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
drivers/fpga/dfl.c
drivers/fpga/dfl.h
include/uapi/linux/fpga-dfl.h