]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: ov5647: Parse and register properties
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 22 Dec 2025 08:15:33 +0000 (13:45 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 14 Jan 2026 22:33:03 +0000 (23:33 +0100)
Parse device properties and register controls for them using the V4L2
fwnode properties helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/ov5647.c

index 774d16335ebf4bdd0076cd4fdd2d8ef4a7c34906..6f07cac12c6c157e1b20abe000f95de82abd877a 100644 (file)
@@ -1320,9 +1320,11 @@ static int ov5647_configure_regulators(struct device *dev,
 static int ov5647_init_controls(struct ov5647 *sensor)
 {
        struct i2c_client *client = v4l2_get_subdevdata(&sensor->sd);
+       struct v4l2_fwnode_device_properties props;
        int hblank, exposure_max, exposure_def;
+       struct device *dev = &client->dev;
 
-       v4l2_ctrl_handler_init(&sensor->ctrls, 9);
+       v4l2_ctrl_handler_init(&sensor->ctrls, 11);
 
        v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
                          V4L2_CID_AUTOGAIN, 0, 1, 1, 0);
@@ -1371,6 +1373,11 @@ static int ov5647_init_controls(struct ov5647 *sensor)
                                     ARRAY_SIZE(ov5647_test_pattern_menu) - 1,
                                     0, 0, ov5647_test_pattern_menu);
 
+       v4l2_fwnode_device_parse(dev, &props);
+
+       v4l2_ctrl_new_fwnode_properties(&sensor->ctrls, &ov5647_ctrl_ops,
+                                       &props);
+
        if (sensor->ctrls.error)
                goto handler_free;