<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 10594f95e425d0eb7d36344cac5f276ab7e99658 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Date: Sun, 16 Oct 2022 09:15:19 +0300
Subject: [PATCH] media: i2c: imx290: Create controls for fwnode
 properties

Upstream commit 4c9c93cf8657.

Create the V4L2_CID_ORIENTATION and V4L2_CID_ROTATION controls to
expose the corresponding fwnode properties.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Alexander Stein &lt;alexander.stein@ew.tq-group.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
---
 drivers/media/i2c/imx290.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -896,10 +896,15 @@ static const struct media_entity_operati
 
 static int imx290_ctrl_init(struct imx290 *imx290)
 {
+	struct v4l2_fwnode_device_properties props;
 	unsigned int blank;
 	int ret;
 
-	v4l2_ctrl_handler_init(&amp;imx290-&gt;ctrls, 7);
+	ret = v4l2_fwnode_device_parse(imx290-&gt;dev, &amp;props);
+	if (ret &lt; 0)
+		return ret;
+
+	v4l2_ctrl_handler_init(&amp;imx290-&gt;ctrls, 9);
 	imx290-&gt;ctrls.lock = &amp;imx290-&gt;lock;
 
 	/*
@@ -954,6 +959,9 @@ static int imx290_ctrl_init(struct imx29
 	if (imx290-&gt;vblank)
 		imx290-&gt;vblank-&gt;flags |= V4L2_CTRL_FLAG_READ_ONLY;
 
+	v4l2_ctrl_new_fwnode_properties(&amp;imx290-&gt;ctrls, &amp;imx290_ctrl_ops,
+					&amp;props);
+
 	imx290-&gt;sd.ctrl_handler = &amp;imx290-&gt;ctrls;
 
 	if (imx290-&gt;ctrls.error) {
</pre></body></html>