diff options
| author | Sakari Ailus <[email protected]> | 2023-03-28 11:39:26 +0000 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2023-04-11 16:54:02 +0000 |
| commit | c2fc1693ab3051382f62738f3289910470f3bf39 (patch) | |
| tree | 0958462fdede927d4b8460728a61ecff874aa69c /drivers/media/i2c/ccs/ccs-core.c | |
| parent | media: ccs: Align flipping behaviour with other drivers (diff) | |
| download | kernel-c2fc1693ab3051382f62738f3289910470f3bf39.tar.gz kernel-c2fc1693ab3051382f62738f3289910470f3bf39.zip | |
media: ccs: Add V4L2 controls from properties
Add V4L2 controls (currently CAMERA_SENSOR_ROTATION and
CAMERA_SENSOR_ORIENTATION) from properties.
Signed-off-by: Sakari Ailus <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'drivers/media/i2c/ccs/ccs-core.c')
| -rw-r--r-- | drivers/media/i2c/ccs/ccs-core.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index d15d49273892..daee36c1f545 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -796,14 +796,24 @@ static const struct v4l2_ctrl_ops ccs_ctrl_ops = { static int ccs_init_controls(struct ccs_sensor *sensor) { struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); + struct v4l2_fwnode_device_properties props; int rval; - rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 17); + rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 19); if (rval) return rval; sensor->pixel_array->ctrl_handler.lock = &sensor->mutex; + rval = v4l2_fwnode_device_parse(&client->dev, &props); + if (rval) + return rval; + + rval = v4l2_ctrl_new_fwnode_properties(&sensor->pixel_array->ctrl_handler, + &ccs_ctrl_ops, &props); + if (rval) + return rval; + switch (CCS_LIM(sensor, ANALOG_GAIN_CAPABILITY)) { case CCS_ANALOG_GAIN_CAPABILITY_GLOBAL: { struct { |
