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

media: ccs: Only add analogue gain control if the device supports it

Some devices do not implement analogue gain this way. Only add the control
when a device does have the support.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d36eb68a
...@@ -777,12 +777,16 @@ static int ccs_init_controls(struct ccs_sensor *sensor) ...@@ -777,12 +777,16 @@ static int ccs_init_controls(struct ccs_sensor *sensor)
sensor->pixel_array->ctrl_handler.lock = &sensor->mutex; sensor->pixel_array->ctrl_handler.lock = &sensor->mutex;
v4l2_ctrl_new_std(&sensor->pixel_array->ctrl_handler, &ccs_ctrl_ops, switch (CCS_LIM(sensor, ANALOG_GAIN_CAPABILITY)) {
V4L2_CID_ANALOGUE_GAIN, case CCS_ANALOG_GAIN_CAPABILITY_GLOBAL:
v4l2_ctrl_new_std(&sensor->pixel_array->ctrl_handler,
&ccs_ctrl_ops, V4L2_CID_ANALOGUE_GAIN,
CCS_LIM(sensor, ANALOG_GAIN_CODE_MIN), CCS_LIM(sensor, ANALOG_GAIN_CODE_MIN),
CCS_LIM(sensor, ANALOG_GAIN_CODE_MAX), CCS_LIM(sensor, ANALOG_GAIN_CODE_MAX),
max(CCS_LIM(sensor, ANALOG_GAIN_CODE_STEP), 1U), max(CCS_LIM(sensor, ANALOG_GAIN_CODE_STEP),
1U),
CCS_LIM(sensor, ANALOG_GAIN_CODE_MIN)); CCS_LIM(sensor, ANALOG_GAIN_CODE_MIN));
}
if (CCS_LIM(sensor, DIGITAL_GAIN_CAPABILITY) == if (CCS_LIM(sensor, DIGITAL_GAIN_CAPABILITY) ==
CCS_DIGITAL_GAIN_CAPABILITY_GLOBAL || CCS_DIGITAL_GAIN_CAPABILITY_GLOBAL ||
......
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