bcm27xx: switch to kernel v6.1
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0284-media-i2c-imx477-Parse-and-register-properties.patch
1 From b2334a401dd6d38b2fd38e1168480dc3ec7d704e Mon Sep 17 00:00:00 2001
2 From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
3 Date: Sat, 4 Jul 2020 01:45:08 +0300
4 Subject: [PATCH] media: i2c: imx477: Parse and register properties
5
6 Parse device properties and register controls for them using the V4L2
7 fwnode properties helpers.
8
9 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 ---
11 drivers/media/i2c/imx477.c | 12 +++++++++++-
12 1 file changed, 11 insertions(+), 1 deletion(-)
13
14 --- a/drivers/media/i2c/imx477.c
15 +++ b/drivers/media/i2c/imx477.c
16 @@ -1957,11 +1957,12 @@ static int imx477_init_controls(struct i
17 {
18 struct v4l2_ctrl_handler *ctrl_hdlr;
19 struct i2c_client *client = v4l2_get_subdevdata(&imx477->sd);
20 + struct v4l2_fwnode_device_properties props;
21 unsigned int i;
22 int ret;
23
24 ctrl_hdlr = &imx477->ctrl_handler;
25 - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 14);
26 + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 16);
27 if (ret)
28 return ret;
29
30 @@ -2045,6 +2046,15 @@ static int imx477_init_controls(struct i
31 goto error;
32 }
33
34 + ret = v4l2_fwnode_device_parse(&client->dev, &props);
35 + if (ret)
36 + goto error;
37 +
38 + ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx477_ctrl_ops,
39 + &props);
40 + if (ret)
41 + goto error;
42 +
43 imx477->sd.ctrl_handler = ctrl_hdlr;
44
45 /* Setup exposure and frame/line length limits. */