summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2010-03-03 12:49:38 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 20:32:42 -0300
commit02adb1cc765b8c29dc83c6602bda19003cce62f1 (patch)
tree067fd5a73251f6dc33567926c409a0b1070710ab /include
parentea8aa4349e11c62242a8908fc172de27d7a151d7 (diff)
downloadlinux-stable-02adb1cc765b8c29dc83c6602bda19003cce62f1.tar.gz
linux-stable-02adb1cc765b8c29dc83c6602bda19003cce62f1.tar.bz2
linux-stable-02adb1cc765b8c29dc83c6602bda19003cce62f1.zip
[media] v4l: subdev: Events support
Provide v4l2_subdevs with v4l2_event support. Subdev drivers only need very little to support events. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: David Cohen <dacohen@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/v4l2-subdev.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 3276065022ef..0f9937be53d2 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -37,6 +37,8 @@
struct v4l2_device;
struct v4l2_ctrl_handler;
+struct v4l2_event_subscription;
+struct v4l2_fh;
struct v4l2_subdev;
struct tuner_setup;
@@ -161,6 +163,10 @@ struct v4l2_subdev_core_ops {
int (*s_power)(struct v4l2_subdev *sd, int on);
int (*interrupt_service_routine)(struct v4l2_subdev *sd,
u32 status, bool *handled);
+ int (*subscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
+ struct v4l2_event_subscription *sub);
+ int (*unsubscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
+ struct v4l2_event_subscription *sub);
};
/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio.
@@ -437,6 +443,8 @@ struct v4l2_subdev_internal_ops {
#define V4L2_SUBDEV_FL_IS_SPI (1U << 1)
/* Set this flag if this subdev needs a device node. */
#define V4L2_SUBDEV_FL_HAS_DEVNODE (1U << 2)
+/* Set this flag if this subdev generates events. */
+#define V4L2_SUBDEV_FL_HAS_EVENTS (1U << 3)
/* Each instance of a subdev driver should create this struct, either
stand-alone or embedded in a larger struct.
@@ -460,6 +468,8 @@ struct v4l2_subdev {
void *host_priv;
/* subdev device node */
struct video_device devnode;
+ /* number of events to be allocated on open */
+ unsigned int nevents;
};
#define vdev_to_v4l2_subdev(vdev) \