Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: atomisp-ov2680: implement enum frame intervals

Allow the sensor to report the per-resolution frame interval.

It should be noticed that, despite the ov2680 datasheet says
that, for resolutions <= 1280x720, the sensor supports 60fps,
the data at ov2680.h tells otherwise, limiting it to 30fps.

Not sure yet if this is a limitation of atomisp or if it is
just because the tables are incorrect.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

+21
+21
drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
··· 1075 1075 return 0; 1076 1076 } 1077 1077 1078 + static int ov2680_enum_frame_interval(struct v4l2_subdev *sd, 1079 + struct v4l2_subdev_state *sd_state, 1080 + struct v4l2_subdev_frame_interval_enum *fie) 1081 + { 1082 + struct v4l2_fract fract; 1083 + 1084 + if (fie->index >= N_RES_PREVIEW || 1085 + fie->width > ov2680_res_preview[0].width || 1086 + fie->height > ov2680_res_preview[0].height || 1087 + fie->which > V4L2_SUBDEV_FORMAT_ACTIVE) 1088 + return -EINVAL; 1089 + 1090 + fract.denominator = ov2680_res_preview[fie->index].fps; 1091 + fract.numerator = 1; 1092 + 1093 + fie->interval = fract; 1094 + 1095 + return 0; 1096 + } 1097 + 1078 1098 static int ov2680_g_skip_frames(struct v4l2_subdev *sd, u32 *frames) 1079 1099 { 1080 1100 struct ov2680_device *dev = to_ov2680_sensor(sd); ··· 1123 1103 static const struct v4l2_subdev_pad_ops ov2680_pad_ops = { 1124 1104 .enum_mbus_code = ov2680_enum_mbus_code, 1125 1105 .enum_frame_size = ov2680_enum_frame_size, 1106 + .enum_frame_interval = ov2680_enum_frame_interval, 1126 1107 .get_fmt = ov2680_get_fmt, 1127 1108 .set_fmt = ov2680_set_fmt, 1128 1109 };