summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-05-23 14:11:06 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-31 18:07:26 +0300
commit93a9d9008d3c963d5d12c56460b5e1d93dad3ea8 (patch)
tree0f24b743fe509b3010fa0a557580783a92706f3c /include/media
parent0ca0e8442dcd5da2af5ce35e90b083a492b4cbac (diff)
downloadlinux-93a9d9008d3c963d5d12c56460b5e1d93dad3ea8.tar.xz
media: v4l2-device.h: add v4l2_device_supports_requests() helper
Add a simple helper function that tests if the driver supports the request API. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-device.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index b330e4a08a6b..ac7677a183ff 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -211,6 +211,17 @@ static inline void v4l2_subdev_notify(struct v4l2_subdev *sd,
sd->v4l2_dev->notify(sd, notification, arg);
}
+/**
+ * v4l2_device_supports_requests - Test if requests are supported.
+ *
+ * @v4l2_dev: pointer to struct v4l2_device
+ */
+static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev)
+{
+ return v4l2_dev->mdev && v4l2_dev->mdev->ops &&
+ v4l2_dev->mdev->ops->req_queue;
+}
+
/* Helper macros to iterate over all subdevs. */
/**