Add generic sensor property information as controĺs by using v4l2_fwnode_device_parse() and v4l2_ctrl_new_fwnode_properties(). Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> --- drivers/media/i2c/ov2740.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index dc0931308053..e37d824291fe 100644 --- a/drivers/media/i2c/ov2740.c +++ b/drivers/media/i2c/ov2740.c @@ -779,6 +779,8 @@ static const struct v4l2_ctrl_ops ov2740_ctrl_ops = { static int ov2740_init_controls(struct ov2740 *ov2740) { + struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd); + struct v4l2_fwnode_device_properties props; struct v4l2_ctrl_handler *ctrl_hdlr; s64 exposure_max, h_blank, pixel_rate; u32 vblank_min, vblank_max, vblank_default; @@ -789,6 +791,10 @@ static int ov2740_init_controls(struct ov2740 *ov2740) if (ret) return ret; + if (!v4l2_fwnode_device_parse(&client->dev, &props)) + v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &ov2740_ctrl_ops, + &props); + ov2740->link_freq = v4l2_ctrl_new_int_menu(ctrl_hdlr, &ov2740_ctrl_ops, V4L2_CID_LINK_FREQ, -- 2.39.2