diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/v4l2-subdev.h | 29 |
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 @@ #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) |