Commit 6949d864 authored by Hugues Fruchet's avatar Hugues Fruchet Committed by Mauro Carvalho Chehab

media: ov5640: do not change mode if format or frame interval is unchanged

Save load of mode registers array when V4L2 client sets a format or a
frame interval which selects the same mode than the current one.
Signed-off-by: default avatarHugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent b5f6ec53
...@@ -1966,9 +1966,11 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, ...@@ -1966,9 +1966,11 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd,
goto out; goto out;
} }
sensor->current_mode = new_mode; if (new_mode != sensor->current_mode) {
sensor->fmt = *mbus_fmt; sensor->current_mode = new_mode;
sensor->pending_mode_change = true; sensor->fmt = *mbus_fmt;
sensor->pending_mode_change = true;
}
out: out:
mutex_unlock(&sensor->lock); mutex_unlock(&sensor->lock);
return ret; return ret;
...@@ -2508,8 +2510,10 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd, ...@@ -2508,8 +2510,10 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd,
goto out; goto out;
} }
sensor->current_mode = mode; if (mode != sensor->current_mode) {
sensor->pending_mode_change = true; sensor->current_mode = mode;
sensor->pending_mode_change = true;
}
out: out:
mutex_unlock(&sensor->lock); mutex_unlock(&sensor->lock);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment