提交 d6f59dcb 编写于 作者: L Laurent Pinchart 提交者: Zheng Zengkai

media: i2c: imx477: Parse and register properties

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

Parse device properties and register controls for them using the V4L2
fwnode properties helpers.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 4a4c51dd
...@@ -1957,11 +1957,12 @@ static int imx477_init_controls(struct imx477 *imx477) ...@@ -1957,11 +1957,12 @@ static int imx477_init_controls(struct imx477 *imx477)
{ {
struct v4l2_ctrl_handler *ctrl_hdlr; struct v4l2_ctrl_handler *ctrl_hdlr;
struct i2c_client *client = v4l2_get_subdevdata(&imx477->sd); struct i2c_client *client = v4l2_get_subdevdata(&imx477->sd);
struct v4l2_fwnode_device_properties props;
unsigned int i; unsigned int i;
int ret; int ret;
ctrl_hdlr = &imx477->ctrl_handler; ctrl_hdlr = &imx477->ctrl_handler;
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 14); ret = v4l2_ctrl_handler_init(ctrl_hdlr, 16);
if (ret) if (ret)
return ret; return ret;
...@@ -2045,6 +2046,15 @@ static int imx477_init_controls(struct imx477 *imx477) ...@@ -2045,6 +2046,15 @@ static int imx477_init_controls(struct imx477 *imx477)
goto error; goto error;
} }
ret = v4l2_fwnode_device_parse(&client->dev, &props);
if (ret)
goto error;
ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx477_ctrl_ops,
&props);
if (ret)
goto error;
imx477->sd.ctrl_handler = ctrl_hdlr; imx477->sd.ctrl_handler = ctrl_hdlr;
/* Setup exposure and frame/line length limits. */ /* Setup exposure and frame/line length limits. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册