static int ov8856_init_controls(struct ov8856 *ov8856)
{
+ struct i2c_client *client = v4l2_get_subdevdata(&ov8856->sd);
+ struct v4l2_fwnode_device_properties props;
struct v4l2_ctrl_handler *ctrl_hdlr;
s64 exposure_max, h_blank;
int ret;
ctrl_hdlr = &ov8856->ctrl_handler;
- ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8);
+ ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10);
if (ret)
return ret;
goto err_ctrl_handler_free;
}
+ ret = v4l2_fwnode_device_parse(&client->dev, &props);
+ if (ret)
+ goto err_ctrl_handler_free;
+
+ ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &ov8856_ctrl_ops,
+ &props);
+ if (ret)
+ goto err_ctrl_handler_free;
+
ov8856->sd.ctrl_handler = ctrl_hdlr;
return 0;