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>
This commit is contained in:
Dave Stevenson
2021-08-03 11:33:33 +01:00
committed by Dom Cobley
parent 47d79b3315
commit dc7fd4fd27

View File

@@ -1569,7 +1569,7 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251)
s64 pixel_rate;
int hblank;
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,
@@ -1628,6 +1628,7 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251)
static int ov7251_probe(struct i2c_client *client)
{
struct v4l2_fwnode_device_properties props;
struct device *dev = &client->dev;
struct ov7251 *ov7251;
int ret;
@@ -1696,6 +1697,15 @@ static int ov7251_probe(struct i2c_client *client)
goto destroy_mutex;
}
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.internal_ops = &ov7251_internal_ops;
ov7251->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;