Skip to content

Commit a1be997

Browse files
rmaderHans Verkuil
authored andcommitted
media: i2c: imx355: Parse and register properties
Analogous to e.g. the imx219 driver. This enables propagating the V4L2_CID_CAMERA_SENSOR_ROTATION and V4L2_CID_CAMERA_ORIENTATION values so that userspace - e.g. libcamera - can detect the correct rotation and orientation from the device tree. Signed-off-by: Robert Mader <robert.mader@collabora.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 4596c55 commit a1be997

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/media/i2c/imx355.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,7 @@ static const struct v4l2_subdev_internal_ops imx355_internal_ops = {
15201520
static int imx355_init_controls(struct imx355 *imx355)
15211521
{
15221522
struct i2c_client *client = v4l2_get_subdevdata(&imx355->sd);
1523+
struct v4l2_fwnode_device_properties props;
15231524
struct v4l2_ctrl_handler *ctrl_hdlr;
15241525
s64 exposure_max;
15251526
s64 vblank_def;
@@ -1531,7 +1532,7 @@ static int imx355_init_controls(struct imx355 *imx355)
15311532
int ret;
15321533

15331534
ctrl_hdlr = &imx355->ctrl_handler;
1534-
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10);
1535+
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 12);
15351536
if (ret)
15361537
return ret;
15371538

@@ -1603,6 +1604,15 @@ static int imx355_init_controls(struct imx355 *imx355)
16031604
goto error;
16041605
}
16051606

1607+
ret = v4l2_fwnode_device_parse(&client->dev, &props);
1608+
if (ret)
1609+
goto error;
1610+
1611+
ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx355_ctrl_ops,
1612+
&props);
1613+
if (ret)
1614+
goto error;
1615+
16061616
imx355->sd.ctrl_handler = ctrl_hdlr;
16071617

16081618
return 0;

0 commit comments

Comments
 (0)