mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
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 <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
6b3980e045
commit
c2fc1693ab
1 changed files with 11 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue