Skip to content

Commit 8273deb

Browse files
pinchartlpopcornmix
authored andcommitted
media: i2c: imx477: Parse and register properties
Parse device properties and register controls for them using the V4L2 fwnode properties helpers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
1 parent d6a8915 commit 8273deb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎drivers/media/i2c/imx477.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,11 +1957,12 @@ static int imx477_init_controls(struct imx477 *imx477)
19571957
{
19581958
struct v4l2_ctrl_handler *ctrl_hdlr;
19591959
struct i2c_client *client = v4l2_get_subdevdata(&imx477->sd);
1960+
struct v4l2_fwnode_device_properties props;
19601961
unsigned int i;
19611962
int ret;
19621963

19631964
ctrl_hdlr = &imx477->ctrl_handler;
1964-
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 14);
1965+
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 16);
19651966
if (ret)
19661967
return ret;
19671968

@@ -2045,6 +2046,15 @@ static int imx477_init_controls(struct imx477 *imx477)
20452046
goto error;
20462047
}
20472048

2049+
ret = v4l2_fwnode_device_parse(&client->dev, &props);
2050+
if (ret)
2051+
goto error;
2052+
2053+
ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx477_ctrl_ops,
2054+
&props);
2055+
if (ret)
2056+
goto error;
2057+
20482058
imx477->sd.ctrl_handler = ctrl_hdlr;
20492059

20502060
/* Setup exposure and frame/line length limits. */

0 commit comments

Comments
 (0)