aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorStanimir Varbanov <svarbanov@mm-sol.com>2010-05-21 05:04:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:53:26 -0400
commit7cd5a16b22af7dc92190a60f336b6854a6fcb99d (patch)
treecce6aabf2417030946c5605fa11e83c902431192 /include/media
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/media')
-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 6f51ce4d7ee7..72f49eb3002b 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -24,6 +24,7 @@
24#include <media/media-entity.h> 24#include <media/media-entity.h>
25#include <media/v4l2-common.h> 25#include <media/v4l2-common.h>
26#include <media/v4l2-dev.h> 26#include <media/v4l2-dev.h>
27#include <media/v4l2-fh.h>
27#include <media/v4l2-mediabus.h> 28#include <media/v4l2-mediabus.h>
28 29
29/* generic v4l2_device notify callback notification values */ 30/* generic v4l2_device notify callback notification values */
@@ -481,6 +482,34 @@ struct v4l2_subdev {
481#define vdev_to_v4l2_subdev(vdev) \ 482#define vdev_to_v4l2_subdev(vdev) \
482 container_of(vdev, struct v4l2_subdev, devnode) 483 container_of(vdev, struct v4l2_subdev, devnode)
483 484
485/*
486 * Used for storing subdev information per file handle
487 */
488struct v4l2_subdev_fh {
489 struct v4l2_fh vfh;
490#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
491 struct v4l2_mbus_framefmt *try_fmt;
492 struct v4l2_rect *try_crop;
493#endif
494};
495
496#define to_v4l2_subdev_fh(fh) \
497 container_of(fh, struct v4l2_subdev_fh, vfh)
498
499#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
500static inline struct v4l2_mbus_framefmt *
501v4l2_subdev_get_try_format(struct v4l2_subdev_fh *fh, unsigned int pad)
502{
503 return &fh->try_fmt[pad];
504}
505
506static inline struct v4l2_rect *
507v4l2_subdev_get_try_crop(struct v4l2_subdev_fh *fh, unsigned int pad)
508{
509 return &fh->try_crop[pad];
510}
511#endif
512
484extern const struct v4l2_file_operations v4l2_subdev_fops; 513extern const struct v4l2_file_operations v4l2_subdev_fops;
485 514
486static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) 515static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)