Commit e47a81d8 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

[media] smiapp: Use unlocked __v4l2_ctrl_modify_range()

Instead of modifying the control ranges directly by manipulating struct
v4l2_ctrl, use __v4l2_ctrl_modify_range() for the purpose.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent f23797b6
...@@ -320,13 +320,7 @@ static void __smiapp_update_exposure_limits(struct smiapp_sensor *sensor) ...@@ -320,13 +320,7 @@ static void __smiapp_update_exposure_limits(struct smiapp_sensor *sensor)
+ sensor->vblank->val + sensor->vblank->val
- sensor->limits[SMIAPP_LIMIT_COARSE_INTEGRATION_TIME_MAX_MARGIN]; - sensor->limits[SMIAPP_LIMIT_COARSE_INTEGRATION_TIME_MAX_MARGIN];
ctrl->maximum = max; __v4l2_ctrl_modify_range(ctrl, ctrl->minimum, max, ctrl->step, max);
if (ctrl->default_value > max)
ctrl->default_value = max;
if (ctrl->val > max)
ctrl->val = max;
if (ctrl->cur.val > max)
ctrl->cur.val = max;
} }
/* /*
...@@ -834,36 +828,25 @@ static void smiapp_update_blanking(struct smiapp_sensor *sensor) ...@@ -834,36 +828,25 @@ static void smiapp_update_blanking(struct smiapp_sensor *sensor)
{ {
struct v4l2_ctrl *vblank = sensor->vblank; struct v4l2_ctrl *vblank = sensor->vblank;
struct v4l2_ctrl *hblank = sensor->hblank; struct v4l2_ctrl *hblank = sensor->hblank;
int min, max;
vblank->minimum = min = max_t(int,
max_t(int, sensor->limits[SMIAPP_LIMIT_MIN_FRAME_BLANKING_LINES],
sensor->limits[SMIAPP_LIMIT_MIN_FRAME_BLANKING_LINES], sensor->limits[SMIAPP_LIMIT_MIN_FRAME_LENGTH_LINES_BIN] -
sensor->limits[SMIAPP_LIMIT_MIN_FRAME_LENGTH_LINES_BIN] - sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].height);
sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].height); max = sensor->limits[SMIAPP_LIMIT_MAX_FRAME_LENGTH_LINES_BIN] -
vblank->maximum =
sensor->limits[SMIAPP_LIMIT_MAX_FRAME_LENGTH_LINES_BIN] -
sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].height; sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].height;
vblank->val = clamp_t(int, vblank->val, __v4l2_ctrl_modify_range(vblank, min, max, vblank->step, min);
vblank->minimum, vblank->maximum);
vblank->default_value = vblank->minimum; min = max_t(int,
vblank->val = vblank->val; sensor->limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK_BIN] -
vblank->cur.val = vblank->val; sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].width,
sensor->limits[SMIAPP_LIMIT_MIN_LINE_BLANKING_PCK_BIN]);
hblank->minimum = max = sensor->limits[SMIAPP_LIMIT_MAX_LINE_LENGTH_PCK_BIN] -
max_t(int,
sensor->limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK_BIN] -
sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].width,
sensor->limits[SMIAPP_LIMIT_MIN_LINE_BLANKING_PCK_BIN]);
hblank->maximum =
sensor->limits[SMIAPP_LIMIT_MAX_LINE_LENGTH_PCK_BIN] -
sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].width; sensor->pixel_array->crop[SMIAPP_PA_PAD_SRC].width;
hblank->val = clamp_t(int, hblank->val, __v4l2_ctrl_modify_range(hblank, min, max, hblank->step, min);
hblank->minimum, hblank->maximum);
hblank->default_value = hblank->minimum;
hblank->val = hblank->val;
hblank->cur.val = hblank->val;
__smiapp_update_exposure_limits(sensor); __smiapp_update_exposure_limits(sensor);
} }
......
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