e1abb9465db7305ca03c169e978386aab923624f
[openwrt/staging/linusw.git] /
1 From f6f294c227272fe1de3c95d4ad89594e0a74aee8 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 15 Jun 2021 19:01:46 +0100
4 Subject: [PATCH] media: i2c: imx258: Register the ctrls from fwnode
5 properties
6
7 Use v4l2_ctrl_new_fwnode_properties to register the standard
8 fwnode properties for the driver.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 drivers/media/i2c/imx258.c | 6 +++++-
13 1 file changed, 5 insertions(+), 1 deletion(-)
14
15 --- a/drivers/media/i2c/imx258.c
16 +++ b/drivers/media/i2c/imx258.c
17 @@ -1201,7 +1201,7 @@ static int imx258_init_controls(struct i
18 int ret;
19
20 ctrl_hdlr = &imx258->ctrl_handler;
21 - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10);
22 + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 12);
23 if (ret)
24 return ret;
25
26 @@ -1270,6 +1270,10 @@ static int imx258_init_controls(struct i
27 ret = v4l2_fwnode_device_parse(&client->dev, &props);
28 if (ret)
29 goto error;
30 + ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx258_ctrl_ops,
31 + &props);
32 + if (ret)
33 + goto error;
34
35 imx258->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx258_ctrl_ops,
36 V4L2_CID_HFLIP, 0, 1, 1,