summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2024-04-15 15:03:18 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-04-22 11:41:05 +0200
commitbcbafe5a0548511f6153121d8f978d764dbe013b (patch)
tree2e6ade422f619481dc5015bacde70489839f7fe0
parentmedia: ov2680: Add hblank control (diff)
downloadlinux-bcbafe5a0548511f6153121d8f978d764dbe013b.tar.xz
linux-bcbafe5a0548511f6153121d8f978d764dbe013b.zip
media: ov2680: Add camera orientation and sensor rotation controls
Add camera orientation and sensor rotation controls using the v4l2_fwnode_device_parse() and v4l2_ctrl_new_fwnode_properties() helpers. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/i2c/ov2680.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c
index 03df910f7564..3ae0ea58668d 100644
--- a/drivers/media/i2c/ov2680.c
+++ b/drivers/media/i2c/ov2680.c
@@ -957,6 +957,7 @@ static int ov2680_v4l2_register(struct ov2680_dev *sensor)
const struct v4l2_ctrl_ops *ops = &ov2680_ctrl_ops;
struct ov2680_ctrls *ctrls = &sensor->ctrls;
struct v4l2_ctrl_handler *hdl = &ctrls->handler;
+ struct v4l2_fwnode_device_properties props;
int def, max, ret = 0;
v4l2_i2c_subdev_init(&sensor->sd, client, &ov2680_subdev_ops);
@@ -1004,6 +1005,12 @@ static int ov2680_v4l2_register(struct ov2680_dev *sensor)
ctrls->hblank = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_HBLANK,
def, def, 1, def);
+ ret = v4l2_fwnode_device_parse(sensor->dev, &props);
+ if (ret)
+ goto cleanup_entity;
+
+ v4l2_ctrl_new_fwnode_properties(hdl, ops, &props);
+
if (hdl->error) {
ret = hdl->error;
goto cleanup_entity;