summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAlain Volmat <alain.volmat@foss.st.com>2023-11-27 16:51:12 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-12-04 12:37:47 +0300
commit998ba665e16e651715d80d1795044c02fa4eb35d (patch)
tree02ad0e6f4d03078826235213373bdae556c088b6 /drivers/media
parentb4c4f8b81694f16b602e5e7b6d308d5ec69e6207 (diff)
downloadlinux-998ba665e16e651715d80d1795044c02fa4eb35d.tar.xz
media: i2c: st-vgxy61: add v4l2_fwnode ctrls parse and addition
Allow parsing of the v4l2_fwnode properties from the DT and addition of those properties (such as orientation, rotation). Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/st-vgxy61.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c
index c85fd580dcf4..e4d37a197724 100644
--- a/drivers/media/i2c/st-vgxy61.c
+++ b/drivers/media/i2c/st-vgxy61.c
@@ -1403,6 +1403,7 @@ static int vgxy61_init_controls(struct vgxy61_dev *sensor)
const struct v4l2_ctrl_ops *ops = &vgxy61_ctrl_ops;
struct v4l2_ctrl_handler *hdl = &sensor->ctrl_handler;
const struct vgxy61_mode_info *cur_mode = sensor->current_mode;
+ struct v4l2_fwnode_device_properties props;
struct v4l2_ctrl *ctrl;
int ret;
@@ -1457,6 +1458,14 @@ static int vgxy61_init_controls(struct vgxy61_dev *sensor)
goto free_ctrls;
}
+ ret = v4l2_fwnode_device_parse(&sensor->i2c_client->dev, &props);
+ if (ret)
+ goto free_ctrls;
+
+ ret = v4l2_ctrl_new_fwnode_properties(hdl, ops, &props);
+ if (ret)
+ goto free_ctrls;
+
sensor->sd.ctrl_handler = hdl;
return 0;