0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-09-21 12:19:24 +00:00
Files
openwrt/target/linux/bcm27xx/patches-5.15/950-0459-media-i2c-ov7251-Add-fwnode-properties-controls.patch
Hauke Mehrtens 87bc997e53 kernel: Update to version 5.15.181
Manually adapted the following patches:
   bcm27xx/patches-5.15/950-0612-media-i2c-ov7251-Make-the-enable-GPIO-optional.patch

Link: https://github.com/openwrt/openwrt/pull/18710
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-05-07 21:27:25 +02:00

49 lines
1.5 KiB
Diff

From 5aab08f11efaa42a97a9c046c956a16c331dd067 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 3 Aug 2021 11:33:33 +0100
Subject: [PATCH] media: i2c: ov7251: Add fwnode properties controls
Add call to v4l2_ctrl_new_fwnode_properties to read and
create the fwnode based controls.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/ov7251.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1258,6 +1258,7 @@ static const struct v4l2_subdev_ops ov72
static int ov7251_probe(struct i2c_client *client)
{
+ struct v4l2_fwnode_device_properties props;
struct device *dev = &client->dev;
struct fwnode_handle *endpoint;
struct ov7251 *ov7251;
@@ -1343,7 +1344,7 @@ static int ov7251_probe(struct i2c_clien
mutex_init(&ov7251->lock);
- v4l2_ctrl_handler_init(&ov7251->ctrls, 7);
+ v4l2_ctrl_handler_init(&ov7251->ctrls, 9);
ov7251->ctrls.lock = &ov7251->lock;
v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
@@ -1379,6 +1380,15 @@ static int ov7251_probe(struct i2c_clien
goto free_ctrl;
}
+ ret = v4l2_fwnode_device_parse(&client->dev, &props);
+ if (ret)
+ goto free_ctrl;
+
+ ret = v4l2_ctrl_new_fwnode_properties(&ov7251->ctrls, &ov7251_ctrl_ops,
+ &props);
+ if (ret)
+ goto free_ctrl;
+
v4l2_i2c_subdev_init(&ov7251->sd, client, &ov7251_subdev_ops);
ov7251->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
ov7251->pad.flags = MEDIA_PAD_FL_SOURCE;