diff options
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-subdev.c')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-subdev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index b4d235c13fbf..543631c3557a 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c | |||
@@ -501,11 +501,20 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd, | |||
501 | struct v4l2_subdev_format *source_fmt, | 501 | struct v4l2_subdev_format *source_fmt, |
502 | struct v4l2_subdev_format *sink_fmt) | 502 | struct v4l2_subdev_format *sink_fmt) |
503 | { | 503 | { |
504 | /* The width, height and code must match. */ | ||
504 | if (source_fmt->format.width != sink_fmt->format.width | 505 | if (source_fmt->format.width != sink_fmt->format.width |
505 | || source_fmt->format.height != sink_fmt->format.height | 506 | || source_fmt->format.height != sink_fmt->format.height |
506 | || source_fmt->format.code != sink_fmt->format.code) | 507 | || source_fmt->format.code != sink_fmt->format.code) |
507 | return -EINVAL; | 508 | return -EINVAL; |
508 | 509 | ||
510 | /* The field order must match, or the sink field order must be NONE | ||
511 | * to support interlaced hardware connected to bridges that support | ||
512 | * progressive formats only. | ||
513 | */ | ||
514 | if (source_fmt->format.field != sink_fmt->format.field && | ||
515 | sink_fmt->format.field != V4L2_FIELD_NONE) | ||
516 | return -EINVAL; | ||
517 | |||
509 | return 0; | 518 | return 0; |
510 | } | 519 | } |
511 | EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate_default); | 520 | EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate_default); |