1 From dfaa98b5db1b6ec5f73b18f997cf18c18099d571 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 3 Aug 2021 11:30:58 +0100
4 Subject: [PATCH] media: i2c: ov9281: 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/ov9281.c | 13 ++++++++++++-
12 1 file changed, 12 insertions(+), 1 deletion(-)
14 --- a/drivers/media/i2c/ov9281.c
15 +++ b/drivers/media/i2c/ov9281.c
17 #include <media/media-entity.h>
18 #include <media/v4l2-async.h>
19 #include <media/v4l2-ctrls.h>
20 +#include <media/v4l2-fwnode.h>
21 #include <media/v4l2-subdev.h>
23 #define OV9281_LINK_FREQ_400MHZ 400000000
24 @@ -1023,6 +1024,7 @@ static const struct v4l2_ctrl_ops ov9281
26 static int ov9281_initialize_controls(struct ov9281 *ov9281)
28 + struct v4l2_fwnode_device_properties props;
29 const struct ov9281_mode *mode;
30 struct v4l2_ctrl_handler *handler;
31 struct v4l2_ctrl *ctrl;
32 @@ -1032,7 +1034,7 @@ static int ov9281_initialize_controls(st
34 handler = &ov9281->ctrl_handler;
35 mode = ov9281->cur_mode;
36 - ret = v4l2_ctrl_handler_init(handler, 9);
37 + ret = v4l2_ctrl_handler_init(handler, 11);
40 handler->lock = &ov9281->mutex;
41 @@ -1094,6 +1096,15 @@ static int ov9281_initialize_controls(st
42 goto err_free_handler;
45 + ret = v4l2_fwnode_device_parse(&ov9281->client->dev, &props);
47 + goto err_free_handler;
49 + ret = v4l2_ctrl_new_fwnode_properties(handler, &ov9281_ctrl_ops,
52 + goto err_free_handler;
54 ov9281->subdev.ctrl_handler = handler;