mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
media: i2c: imx219: Replace exposure magic value with named constant
Introduce IMX219_EXPOSURE_OFFSET (4) and use it instead of the literal '4' when computing the maximum coarse exposure. The IMX219 datasheet specifies the maximum storage time as frame_length_lines - 4. (Ref: Datasheet section 5-7-1) Also fix one indentation issue for consistency. Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
dff10c7044
commit
9a9ba098e7
|
|
@ -68,6 +68,7 @@
|
|||
#define IMX219_EXPOSURE_STEP 1
|
||||
#define IMX219_EXPOSURE_DEFAULT 0x640
|
||||
#define IMX219_EXPOSURE_MAX 65535
|
||||
#define IMX219_EXPOSURE_OFFSET 4
|
||||
|
||||
/* V_TIMING internal */
|
||||
#define IMX219_REG_FRM_LENGTH_A CCI_REG16(0x0160)
|
||||
|
|
@ -450,9 +451,9 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl)
|
|||
int exposure_max, exposure_def;
|
||||
|
||||
/* Update max exposure while meeting expected vblanking */
|
||||
exposure_max = format->height + ctrl->val - 4;
|
||||
exposure_max = format->height + ctrl->val - IMX219_EXPOSURE_OFFSET;
|
||||
exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ?
|
||||
exposure_max : IMX219_EXPOSURE_DEFAULT;
|
||||
exposure_max : IMX219_EXPOSURE_DEFAULT;
|
||||
ret = __v4l2_ctrl_modify_range(imx219->exposure,
|
||||
imx219->exposure->minimum,
|
||||
exposure_max,
|
||||
|
|
@ -579,9 +580,9 @@ static int imx219_init_controls(struct imx219 *imx219)
|
|||
IMX219_LLP_MIN - mode->width,
|
||||
IMX219_LLP_MAX - mode->width, 1,
|
||||
IMX219_LLP_MIN - mode->width);
|
||||
exposure_max = mode->fll_def - 4;
|
||||
exposure_max = mode->fll_def - IMX219_EXPOSURE_OFFSET;
|
||||
exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ?
|
||||
exposure_max : IMX219_EXPOSURE_DEFAULT;
|
||||
exposure_max : IMX219_EXPOSURE_DEFAULT;
|
||||
imx219->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &imx219_ctrl_ops,
|
||||
V4L2_CID_EXPOSURE,
|
||||
IMX219_EXPOSURE_MIN, exposure_max,
|
||||
|
|
@ -900,9 +901,9 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
|
|||
return ret;
|
||||
|
||||
/* Update max exposure while meeting expected vblanking */
|
||||
exposure_max = mode->fll_def - 4;
|
||||
exposure_max = mode->fll_def - IMX219_EXPOSURE_OFFSET;
|
||||
exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ?
|
||||
exposure_max : IMX219_EXPOSURE_DEFAULT;
|
||||
exposure_max : IMX219_EXPOSURE_DEFAULT;
|
||||
ret = __v4l2_ctrl_modify_range(imx219->exposure,
|
||||
imx219->exposure->minimum,
|
||||
exposure_max,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user