mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 15:19:51 +00:00
media: ccs: Add support for old-style SMIA digital gain
SMIA only has per-component digital gain. Add support for it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
7eb5a7e1e7
commit
8218785789
@ -673,7 +673,34 @@ static int ccs_set_ctrl(struct v4l2_ctrl *ctrl)
|
||||
break;
|
||||
|
||||
case V4L2_CID_DIGITAL_GAIN:
|
||||
rval = ccs_write(sensor, DIGITAL_GAIN_GLOBAL, ctrl->val);
|
||||
if (CCS_LIM(sensor, DIGITAL_GAIN_CAPABILITY) ==
|
||||
CCS_DIGITAL_GAIN_CAPABILITY_GLOBAL) {
|
||||
rval = ccs_write(sensor, DIGITAL_GAIN_GLOBAL,
|
||||
ctrl->val);
|
||||
break;
|
||||
}
|
||||
|
||||
rval = ccs_write_addr(sensor,
|
||||
SMIAPP_REG_U16_DIGITAL_GAIN_GREENR,
|
||||
ctrl->val);
|
||||
if (rval)
|
||||
break;
|
||||
|
||||
rval = ccs_write_addr(sensor,
|
||||
SMIAPP_REG_U16_DIGITAL_GAIN_RED,
|
||||
ctrl->val);
|
||||
if (rval)
|
||||
break;
|
||||
|
||||
rval = ccs_write_addr(sensor,
|
||||
SMIAPP_REG_U16_DIGITAL_GAIN_BLUE,
|
||||
ctrl->val);
|
||||
if (rval)
|
||||
break;
|
||||
|
||||
rval = ccs_write_addr(sensor,
|
||||
SMIAPP_REG_U16_DIGITAL_GAIN_GREENB,
|
||||
ctrl->val);
|
||||
|
||||
break;
|
||||
case V4L2_CID_EXPOSURE:
|
||||
@ -759,7 +786,9 @@ static int ccs_init_controls(struct ccs_sensor *sensor)
|
||||
CCS_LIM(sensor, ANALOG_GAIN_CODE_MIN));
|
||||
|
||||
if (CCS_LIM(sensor, DIGITAL_GAIN_CAPABILITY) ==
|
||||
CCS_DIGITAL_GAIN_CAPABILITY_GLOBAL)
|
||||
CCS_DIGITAL_GAIN_CAPABILITY_GLOBAL ||
|
||||
CCS_LIM(sensor, DIGITAL_GAIN_CAPABILITY) ==
|
||||
SMIAPP_DIGITAL_GAIN_CAPABILITY_PER_CHANNEL)
|
||||
v4l2_ctrl_new_std(&sensor->pixel_array->ctrl_handler,
|
||||
&ccs_ctrl_ops, V4L2_CID_DIGITAL_GAIN,
|
||||
CCS_LIM(sensor, DIGITAL_GAIN_MIN),
|
||||
|
@ -535,6 +535,8 @@
|
||||
#define SMIAPP_DIGITAL_CROP_CAPABILITY_NONE 0
|
||||
#define SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP 1
|
||||
|
||||
#define SMIAPP_DIGITAL_GAIN_CAPABILITY_PER_CHANNEL 1
|
||||
|
||||
#define SMIAPP_BINNING_CAPABILITY_NO 0
|
||||
#define SMIAPP_BINNING_CAPABILITY_YES 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user