This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: i2c: ov5670: Parse and register properties
Author:  Jacopo Mondi <[email protected]>
Date:    Sat May 9 11:04:53 2020 +0200

Parse device properties and register controls for them using the newly
introduced helpers.

Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/i2c/ov5670.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c
index 041fcbb4eebd..f26252e35e08 100644
--- a/drivers/media/i2c/ov5670.c
+++ b/drivers/media/i2c/ov5670.c
@@ -7,6 +7,7 @@
 #include <linux/pm_runtime.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-fwnode.h>
 
 #define OV5670_REG_CHIP_ID             0x300a
 #define OV5670_CHIP_ID                 0x005670
@@ -2059,6 +2060,8 @@ static const struct v4l2_ctrl_ops ov5670_ctrl_ops = {
 /* Initialize control handlers */
 static int ov5670_init_controls(struct ov5670 *ov5670)
 {
+       struct i2c_client *client = v4l2_get_subdevdata(&ov5670->sd);
+       struct v4l2_fwnode_device_properties props;
        struct v4l2_ctrl_handler *ctrl_hdlr;
        s64 vblank_max;
        s64 vblank_def;
@@ -2067,7 +2070,7 @@ static int ov5670_init_controls(struct ov5670 *ov5670)
        int ret;
 
        ctrl_hdlr = &ov5670->ctrl_handler;
-       ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8);
+       ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10);
        if (ret)
                return ret;
 
@@ -2129,6 +2132,15 @@ static int ov5670_init_controls(struct ov5670 *ov5670)
                goto error;
        }
 
+       ret = v4l2_fwnode_device_parse(&client->dev, &props);
+       if (ret)
+               goto error;
+
+       ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &ov5670_ctrl_ops,
+                                             &props);
+       if (ret)
+               goto error;
+
        ov5670->sd.ctrl_handler = ctrl_hdlr;
 
        return 0;

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to