mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
media: i2c: imx219: Parse and register properties
Parse device properties and register controls for them using the newly introduced helpers. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
74c3ddd988
commit
ad3a44cbd1
1 changed files with 11 additions and 1 deletions
|
@ -1265,11 +1265,12 @@ static int imx219_init_controls(struct imx219 *imx219)
|
||||||
struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd);
|
struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd);
|
||||||
struct v4l2_ctrl_handler *ctrl_hdlr;
|
struct v4l2_ctrl_handler *ctrl_hdlr;
|
||||||
unsigned int height = imx219->mode->height;
|
unsigned int height = imx219->mode->height;
|
||||||
|
struct v4l2_fwnode_device_properties props;
|
||||||
int exposure_max, exposure_def, hblank;
|
int exposure_max, exposure_def, hblank;
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
ctrl_hdlr = &imx219->ctrl_handler;
|
ctrl_hdlr = &imx219->ctrl_handler;
|
||||||
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 9);
|
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 11);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -1348,6 +1349,15 @@ static int imx219_init_controls(struct imx219 *imx219)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = v4l2_fwnode_device_parse(&client->dev, &props);
|
||||||
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx219_ctrl_ops,
|
||||||
|
&props);
|
||||||
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
|
||||||
imx219->sd.ctrl_handler = ctrl_hdlr;
|
imx219->sd.ctrl_handler = ctrl_hdlr;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue