aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStanimir Varbanov <svarbanov@mm-sol.com>2010-05-21 06:04:24 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 04:53:26 -0300
commit7cd5a16b22af7dc92190a60f336b6854a6fcb99d (patch)
treecce6aabf2417030946c5605fa11e83c902431192 /include
parentdacdde78b39e49edf2f7af85be4b613978280b26 (diff)
[media] v4l: Create v4l2 subdev file handle structure
Used for storing subdev information per file handle and hold V4L2 file handle. Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com> Signed-off-by: Antti Koskipaa <akoskipa@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.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 6f51ce4d7ee..72f49eb3002 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -24,6 +24,7 @@
#include <media/media-entity.h>
#include <media/v4l2-common.h>
#include <media/v4l2-dev.h>
+#include <media/v4l2-fh.h>
#include <media/v4l2-mediabus.h>
/* generic v4l2_device notify callback notification values */
@@ -481,6 +482,34 @@ struct v4l2_subdev {
#define vdev_to_v4l2_subdev(vdev) \
container_of(vdev, struct v4l2_subdev, devnode)
+/*
+ * Used for storing subdev information per file handle
+ */
+struct v4l2_subdev_fh {
+ struct v4l2_fh vfh;
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
+ struct v4l2_mbus_framefmt *try_fmt;
+ struct v4l2_rect *try_crop;
+#endif
+};
+
+#define to_v4l2_subdev_fh(fh) \
+ container_of(fh, struct v4l2_subdev_fh, vfh)
+
+#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
+static inline struct v4l2_mbus_framefmt *
+v4l2_subdev_get_try_format(struct v4l2_subdev_fh *fh, unsigned int pad)
+{
+ return &fh->try_fmt[pad];
+}
+
+static inline struct v4l2_rect *
+v4l2_subdev_get_try_crop(struct v4l2_subdev_fh *fh, unsigned int pad)
+{
+ return &fh->try_crop[pad];
+}
+#endif
+
extern const struct v4l2_file_operations v4l2_subdev_fops;
static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)