aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/i2c/ov13858.c
diff options
context:
space:
mode:
authorChiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>2017-07-27 03:28:05 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-09 11:17:45 -0400
commitb3775edc66640cfdf205f533539a2f18055783c3 (patch)
treea3e8384c9e1eb8bb926d014ef3e899113b18100b /drivers/media/i2c/ov13858.c
parentmedia: cx231xx: only unregister successfully registered i2c adapters (diff)
downloadwireguard-linux-b3775edc66640cfdf205f533539a2f18055783c3.tar.xz
wireguard-linux-b3775edc66640cfdf205f533539a2f18055783c3.zip
media: ov13858: Set default fps as current fps
On format change, sometimes, sensor was streaming at a much higher FPS than the default. This was resulting in various problems like frame drops/corruption. Upon format change, set default vblank as current vblank. This will ensure that sensor will start streaming at default fps. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/ov13858.c')
-rw-r--r--drivers/media/i2c/ov13858.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 86550d8ddfee..8e6c8f00797d 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -1377,6 +1377,7 @@ ov13858_set_pad_format(struct v4l2_subdev *sd,
struct ov13858 *ov13858 = to_ov13858(sd);
const struct ov13858_mode *mode;
struct v4l2_mbus_framefmt *framefmt;
+ s32 vblank_def;
s64 h_blank;
mutex_lock(&ov13858->mutex);
@@ -1397,10 +1398,12 @@ ov13858_set_pad_format(struct v4l2_subdev *sd,
ov13858->pixel_rate,
link_freq_configs[mode->link_freq_index].pixel_rate);
/* Update limits and set FPS to default */
+ vblank_def = ov13858->cur_mode->vts - ov13858->cur_mode->height;
__v4l2_ctrl_modify_range(
ov13858->vblank, OV13858_VBLANK_MIN,
OV13858_VTS_MAX - ov13858->cur_mode->height, 1,
- ov13858->cur_mode->vts - ov13858->cur_mode->height);
+ vblank_def);
+ __v4l2_ctrl_s_ctrl(ov13858->vblank, vblank_def);
h_blank =
link_freq_configs[mode->link_freq_index].pixels_per_line
- ov13858->cur_mode->width;