@@ -1872,8 +1872,13 @@ ov5640_find_mode(struct ov5640_dev *sensor, enum ov5640_frame_rate fr,
(mode->crop.width != width || mode->crop.height != height)))
return NULL;
- /* Check to see if the current mode exceeds the max frame rate */
- if (ov5640_framerates[fr] > ov5640_framerates[mode->max_fps])
+ /*
+ * Check to see if the current mode exceeds the max frame rate.
+ * Only DVP mode uses the frame rate set by s_frame_interval, MIPI
+ * mode controls framerate by setting blankings.
+ */
+ if (!ov5640_is_csi2(sensor) &&
+ ov5640_framerates[fr] > ov5640_framerates[mode->max_fps])
return NULL;
return mode;
@@ -3288,15 +3293,17 @@ static int ov5640_enum_frame_size(struct v4l2_subdev *sd,
return 0;
}
-static int ov5640_enum_frame_interval(
- struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- struct v4l2_subdev_frame_interval_enum *fie)
+static int ov5640_enum_frame_interval(struct v4l2_subdev *sd,
+ struct v4l2_subdev_state *sd_state,
+ struct v4l2_subdev_frame_interval_enum *fie)
{
struct ov5640_dev *sensor = to_ov5640_dev(sd);
struct v4l2_fract tpf;
int ret;
+ if (ov5640_is_csi2(sensor))
+ return -EINVAL;
+
if (fie->pad != 0)
return -EINVAL;
if (fie->index >= OV5640_NUM_FRAMERATES)
@@ -3319,6 +3326,9 @@ static int ov5640_g_frame_interval(struct v4l2_subdev *sd,
{
struct ov5640_dev *sensor = to_ov5640_dev(sd);
+ if (ov5640_is_csi2(sensor))
+ return -EINVAL;
+
mutex_lock(&sensor->lock);
fi->interval = sensor->frame_interval;
mutex_unlock(&sensor->lock);
@@ -3333,6 +3343,9 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd,
const struct ov5640_mode_info *mode;
int frame_rate, ret = 0;
+ if (ov5640_is_csi2(sensor))
+ return -EINVAL;
+
if (fi->pad != 0)
return -EINVAL;