1 From 10594f95e425d0eb7d36344cac5f276ab7e99658 Mon Sep 17 00:00:00 2001
2 From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
3 Date: Sun, 16 Oct 2022 09:15:19 +0300
4 Subject: [PATCH] media: i2c: imx290: Create controls for fwnode
7 Upstream commit 4c9c93cf8657.
9 Create the V4L2_CID_ORIENTATION and V4L2_CID_ROTATION controls to
10 expose the corresponding fwnode properties.
12 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
13 Acked-by: Alexander Stein <alexander.stein@ew.tq-group.com>
14 Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
16 drivers/media/i2c/imx290.c | 10 +++++++++-
17 1 file changed, 9 insertions(+), 1 deletion(-)
19 --- a/drivers/media/i2c/imx290.c
20 +++ b/drivers/media/i2c/imx290.c
21 @@ -896,10 +896,15 @@ static const struct media_entity_operati
23 static int imx290_ctrl_init(struct imx290 *imx290)
25 + struct v4l2_fwnode_device_properties props;
29 - v4l2_ctrl_handler_init(&imx290->ctrls, 7);
30 + ret = v4l2_fwnode_device_parse(imx290->dev, &props);
34 + v4l2_ctrl_handler_init(&imx290->ctrls, 9);
35 imx290->ctrls.lock = &imx290->lock;
38 @@ -954,6 +959,9 @@ static int imx290_ctrl_init(struct imx29
40 imx290->vblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
42 + v4l2_ctrl_new_fwnode_properties(&imx290->ctrls, &imx290_ctrl_ops,
45 imx290->sd.ctrl_handler = &imx290->ctrls;
47 if (imx290->ctrls.error) {