aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga
diff options
context:
space:
mode:
authorWu Hao <hao.wu@intel.com>2018-06-29 20:53:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-15 07:55:46 -0400
commit620e1902f6fe57ddacdabd9e33fadbd290be9652 (patch)
tree54421a52be2100c00c5afb11102c927b1cdd8b55 /drivers/fpga
parent0a27ff24d59662b1ca8b3f7721a965918f115074 (diff)
fpga: dfl: fme: add DFL_FPGA_GET_API_VERSION/CHECK_EXTENSION ioctls support
DFL_FPGA_GET_API_VERSION and DFL_FPGA_CHECK_EXTENSION ioctls are common ones which need to be supported by all feature devices drivers including FME and AFU. Userspace application can use these ioctl interfaces to get the API info and check if specific extension is supported or not in current driver. This patch implements above 2 ioctls in FPGA Management Engine (FME) driver. Signed-off-by: Tim Whisonant <tim.whisonant@intel.com> Signed-off-by: Enno Luebbers <enno.luebbers@intel.com> Signed-off-by: Shiva Rao <shiva.rao@intel.com> Signed-off-by: Christopher Rauer <christopher.rauer@intel.com> Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com> Signed-off-by: Wu Hao <hao.wu@intel.com> Acked-by: Alan Tull <atull@kernel.org> Acked-by: Moritz Fischer <mdf@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/dfl-fme-main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/fpga/dfl-fme-main.c b/drivers/fpga/dfl-fme-main.c
index c23c56fe3f4b..c83ff88e3bbb 100644
--- a/drivers/fpga/dfl-fme-main.c
+++ b/drivers/fpga/dfl-fme-main.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/fpga-dfl.h>
19 20
20#include "dfl.h" 21#include "dfl.h"
21 22
@@ -116,6 +117,13 @@ static struct dfl_feature_driver fme_feature_drvs[] = {
116 }, 117 },
117}; 118};
118 119
120static long fme_ioctl_check_extension(struct dfl_feature_platform_data *pdata,
121 unsigned long arg)
122{
123 /* No extension support for now */
124 return 0;
125}
126
119static int fme_open(struct inode *inode, struct file *filp) 127static int fme_open(struct inode *inode, struct file *filp)
120{ 128{
121 struct platform_device *fdev = dfl_fpga_inode_to_feature_dev(inode); 129 struct platform_device *fdev = dfl_fpga_inode_to_feature_dev(inode);
@@ -156,6 +164,10 @@ static long fme_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
156 dev_dbg(&pdev->dev, "%s cmd 0x%x\n", __func__, cmd); 164 dev_dbg(&pdev->dev, "%s cmd 0x%x\n", __func__, cmd);
157 165
158 switch (cmd) { 166 switch (cmd) {
167 case DFL_FPGA_GET_API_VERSION:
168 return DFL_FPGA_API_VERSION;
169 case DFL_FPGA_CHECK_EXTENSION:
170 return fme_ioctl_check_extension(pdata, arg);
159 default: 171 default:
160 /* 172 /*
161 * Let sub-feature's ioctl function to handle the cmd. 173 * Let sub-feature's ioctl function to handle the cmd.