diff options
author | Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> | 2017-07-27 10:44:19 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-08-09 18:18:09 +0300 |
commit | 33eea13263ed7af4784f177037eb335e55fc6b4c (patch) | |
tree | 17e135238f743b672c72bc2e53b4e5da59bd8258 /drivers/media/i2c | |
parent | b3775edc66640cfdf205f533539a2f18055783c3 (diff) | |
download | linux-33eea13263ed7af4784f177037eb335e55fc6b4c.tar.xz |
media: ov13858: Fix initial expsoure max
Previously, initial exposure max was set incorrectly to (0x7fff - 8).
Now, limit exposure max to current resolution (VTS - 8).
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')
-rw-r--r-- | drivers/media/i2c/ov13858.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c index 8e6c8f00797d..85fd82f44add 100644 --- a/drivers/media/i2c/ov13858.c +++ b/drivers/media/i2c/ov13858.c @@ -66,7 +66,6 @@ /* Exposure control */ #define OV13858_REG_EXPOSURE 0x3500 #define OV13858_EXPOSURE_MIN 4 -#define OV13858_EXPOSURE_MAX (OV13858_VTS_MAX - 8) #define OV13858_EXPOSURE_STEP 1 #define OV13858_EXPOSURE_DEFAULT 0x640 @@ -1605,6 +1604,7 @@ static int ov13858_init_controls(struct ov13858 *ov13858) { struct i2c_client *client = v4l2_get_subdevdata(&ov13858->sd); struct v4l2_ctrl_handler *ctrl_hdlr; + s64 exposure_max; int ret; ctrl_hdlr = &ov13858->ctrl_handler; @@ -1643,10 +1643,11 @@ static int ov13858_init_controls(struct ov13858 *ov13858) OV13858_PPL_1080MHZ - ov13858->cur_mode->width); ov13858->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; + exposure_max = ov13858->cur_mode->vts - 8; ov13858->exposure = v4l2_ctrl_new_std( ctrl_hdlr, &ov13858_ctrl_ops, V4L2_CID_EXPOSURE, OV13858_EXPOSURE_MIN, - OV13858_EXPOSURE_MAX, OV13858_EXPOSURE_STEP, + exposure_max, OV13858_EXPOSURE_STEP, OV13858_EXPOSURE_DEFAULT); v4l2_ctrl_new_std(ctrl_hdlr, &ov13858_ctrl_ops, V4L2_CID_ANALOGUE_GAIN, |