1 From 5aab08f11efaa42a97a9c046c956a16c331dd067 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 3 Aug 2021 11:33:33 +0100
4 Subject: [PATCH] media: i2c: ov7251: 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/ov7251.c | 12 +++++++++++-
12 1 file changed, 11 insertions(+), 1 deletion(-)
14 --- a/drivers/media/i2c/ov7251.c
15 +++ b/drivers/media/i2c/ov7251.c
16 @@ -1256,6 +1256,7 @@ static const struct v4l2_subdev_ops ov72
18 static int ov7251_probe(struct i2c_client *client)
20 + struct v4l2_fwnode_device_properties props;
21 struct device *dev = &client->dev;
22 struct fwnode_handle *endpoint;
23 struct ov7251 *ov7251;
24 @@ -1341,7 +1342,7 @@ static int ov7251_probe(struct i2c_clien
26 mutex_init(&ov7251->lock);
28 - v4l2_ctrl_handler_init(&ov7251->ctrls, 7);
29 + v4l2_ctrl_handler_init(&ov7251->ctrls, 9);
30 ov7251->ctrls.lock = &ov7251->lock;
32 v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
33 @@ -1377,6 +1378,15 @@ static int ov7251_probe(struct i2c_clien
37 + ret = v4l2_fwnode_device_parse(&client->dev, &props);
41 + ret = v4l2_ctrl_new_fwnode_properties(&ov7251->ctrls, &ov7251_ctrl_ops,
46 v4l2_i2c_subdev_init(&ov7251->sd, client, &ov7251_subdev_ops);
47 ov7251->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
48 ov7251->pad.flags = MEDIA_PAD_FL_SOURCE;