diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2011-10-10 16:01:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 07:45:31 -0400 |
commit | 8227c92b69688403dee2adf5f399a49539ae5049 (patch) | |
tree | b9f4775e4f9ed99c41aca6cf6334aaef6f861d69 /include/media | |
parent | 48398f932b4ddcc8fa9a890595645cc14f6889a8 (diff) |
[media] v4l: Implement v4l2_subdev_link_validate()
v4l2_subdev_link_validate() is the default op for validating a link. In V4L2
subdev context, it is used to call a pad op which performs the proper link
check without much extra work.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/v4l2-subdev.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 7e850355a6f0..1c2318b15bd2 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -470,6 +470,11 @@ struct v4l2_subdev_pad_ops { | |||
470 | struct v4l2_subdev_selection *sel); | 470 | struct v4l2_subdev_selection *sel); |
471 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 471 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
472 | struct v4l2_subdev_selection *sel); | 472 | struct v4l2_subdev_selection *sel); |
473 | #ifdef CONFIG_MEDIA_CONTROLLER | ||
474 | int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link, | ||
475 | struct v4l2_subdev_format *source_fmt, | ||
476 | struct v4l2_subdev_format *sink_fmt); | ||
477 | #endif /* CONFIG_MEDIA_CONTROLLER */ | ||
473 | }; | 478 | }; |
474 | 479 | ||
475 | struct v4l2_subdev_ops { | 480 | struct v4l2_subdev_ops { |
@@ -602,6 +607,13 @@ static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd) | |||
602 | return sd->host_priv; | 607 | return sd->host_priv; |
603 | } | 608 | } |
604 | 609 | ||
610 | #ifdef CONFIG_MEDIA_CONTROLLER | ||
611 | int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd, | ||
612 | struct media_link *link, | ||
613 | struct v4l2_subdev_format *source_fmt, | ||
614 | struct v4l2_subdev_format *sink_fmt); | ||
615 | int v4l2_subdev_link_validate(struct media_link *link); | ||
616 | #endif /* CONFIG_MEDIA_CONTROLLER */ | ||
605 | void v4l2_subdev_init(struct v4l2_subdev *sd, | 617 | void v4l2_subdev_init(struct v4l2_subdev *sd, |
606 | const struct v4l2_subdev_ops *ops); | 618 | const struct v4l2_subdev_ops *ops); |
607 | 619 | ||