[media] adv7842: Add pad-level DV timings operations
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 25 May 2014 15:40:26 +0000 (12:40 -0300)
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/adv7842.c

index 6a4d389c749ccf2e14c77f566062d7c94172e158..56b8ec95d9344a4fb9de8a27ce379bd6dfa6c4ee 100644 (file)
@@ -1399,6 +1399,9 @@ static int read_stdi(struct v4l2_subdev *sd, struct stdi_readback *stdi)
 static int adv7842_enum_dv_timings(struct v4l2_subdev *sd,
                                   struct v4l2_enum_dv_timings *timings)
 {
+       if (timings->pad != 0)
+               return -EINVAL;
+
        return v4l2_enum_dv_timings_cap(timings,
                adv7842_get_dv_timings_cap(sd), adv7842_check_dv_timings, NULL);
 }
@@ -1406,6 +1409,9 @@ static int adv7842_enum_dv_timings(struct v4l2_subdev *sd,
 static int adv7842_dv_timings_cap(struct v4l2_subdev *sd,
                                  struct v4l2_dv_timings_cap *cap)
 {
+       if (cap->pad != 0)
+               return -EINVAL;
+
        *cap = *adv7842_get_dv_timings_cap(sd);
        return 0;
 }
@@ -2901,6 +2907,8 @@ static const struct v4l2_subdev_video_ops adv7842_video_ops = {
 static const struct v4l2_subdev_pad_ops adv7842_pad_ops = {
        .get_edid = adv7842_get_edid,
        .set_edid = adv7842_set_edid,
+       .enum_dv_timings = adv7842_enum_dv_timings,
+       .dv_timings_cap = adv7842_dv_timings_cap,
 };
 
 static const struct v4l2_subdev_ops adv7842_ops = {