vfio/fsl-mc: Add irq infrastructure for fsl-mc devices
[linux-block.git] / drivers / vfio / fsl-mc / vfio_fsl_mc_intr.c
CommitLineData
2e0d2956
DC
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright 2013-2016 Freescale Semiconductor Inc.
4 * Copyright 2019 NXP
5 */
6
7#include <linux/vfio.h>
8#include <linux/slab.h>
9#include <linux/types.h>
10#include <linux/eventfd.h>
11#include <linux/msi.h>
12
13#include "linux/fsl/mc.h"
14#include "vfio_fsl_mc_private.h"
15
16static int vfio_fsl_mc_set_irq_trigger(struct vfio_fsl_mc_device *vdev,
17 unsigned int index, unsigned int start,
18 unsigned int count, u32 flags,
19 void *data)
20{
21 return -EINVAL;
22}
23
24int vfio_fsl_mc_set_irqs_ioctl(struct vfio_fsl_mc_device *vdev,
25 u32 flags, unsigned int index,
26 unsigned int start, unsigned int count,
27 void *data)
28{
29 if (flags & VFIO_IRQ_SET_ACTION_TRIGGER)
30 return vfio_fsl_mc_set_irq_trigger(vdev, index, start,
31 count, flags, data);
32 else
33 return -EINVAL;
34}