@@ -2002,8 +2002,13 @@ ov5640_find_mode(struct ov5640_dev *sensor, enum ov5640_frame_rate fr,
(mode->width != width || mode->height != height)))
return NULL;
- /* Check to see if the current mode exceeds the max frame rate */
- if (ov5640_framerates[fr] > ov5640_framerates[mode->dvp_timings.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->dvp_timings.max_fps])
return NULL;
return mode;
@@ -3431,15 +3436,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)
@@ -3462,6 +3469,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);
@@ -3476,6 +3486,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;