1 From 5aeffc428adfd3a97014056e36fd5496119da743 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 3 Aug 2021 11:25:59 +0100
4 Subject: [PATCH] media: i2c: imx290: Add fwnode properties controls
6 Add call to v4l2_ctrl_new_fwnode_properties to read and
7 create the fwnode based controls.
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 drivers/media/i2c/imx290.c | 12 +++++++++++-
12 1 file changed, 11 insertions(+), 1 deletion(-)
14 --- a/drivers/media/i2c/imx290.c
15 +++ b/drivers/media/i2c/imx290.c
16 @@ -1242,6 +1242,7 @@ static const struct of_device_id imx290_
18 static int imx290_probe(struct i2c_client *client)
20 + struct v4l2_fwnode_device_properties props;
21 struct device *dev = &client->dev;
22 struct fwnode_handle *endpoint;
23 /* Only CSI2 is supported for now: */
24 @@ -1363,7 +1364,7 @@ static int imx290_probe(struct i2c_clien
26 imx290_entity_init_cfg(&imx290->sd, NULL);
28 - v4l2_ctrl_handler_init(&imx290->ctrls, 9);
29 + v4l2_ctrl_handler_init(&imx290->ctrls, 11);
31 v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
32 V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
33 @@ -1411,6 +1412,15 @@ static int imx290_probe(struct i2c_clien
34 ARRAY_SIZE(imx290_test_pattern_menu) - 1,
35 0, 0, imx290_test_pattern_menu);
37 + ret = v4l2_fwnode_device_parse(&client->dev, &props);
41 + ret = v4l2_ctrl_new_fwnode_properties(&imx290->ctrls, &imx290_ctrl_ops,
46 imx290->sd.ctrl_handler = &imx290->ctrls;
48 if (imx290->ctrls.error) {