[PATCH 02/16] media: v4l2-device: Add struct v4l2_device.flags

Daniel Scally dan.scally at ideasonboard.com
Mon Nov 2 23:40:38 PST 2026


Add a flags field to struct v4l2_device, along with a single flag
value that is designed to tell v4l2-async in which direction data
flows for this v4l2 device so that it knows how to set up device
links between subdevices connected using the async APIs.

Signed-off-by: Daniel Scally <dan.scally at ideasonboard.com>
---
 include/media/v4l2-device.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index 25f69b1b8db03d077f7570471d5c6910fcafe110..9b17916d63641ba637cf8c37aa925749bd4e2134 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -15,6 +15,9 @@
 
 struct v4l2_ctrl_handler;
 
+/* Set this flag if this V4L2 device is an "output" rather than an "input". */
+#define V4L2_DEVICE_FL_IS_OUTPUT			BIT(0)
+
 /**
  * struct v4l2_device - main struct to for V4L2 device drivers
  *
@@ -30,6 +33,9 @@ struct v4l2_ctrl_handler;
  * @ref: Keep track of the references to this struct.
  * @release: Release function that is called when the ref count
  *	goes to 0.
+ * @flags: device flags. Can be:
+ *   %V4L2_DEVICE_FL_IS_OUTPUT - Set this flag if this V4L2 device is an
+ *   "output" rather than an "input"
  *
  * Each instance of a V4L2 device should create the v4l2_device struct,
  * either stand-alone or embedded in a larger struct.
@@ -54,6 +60,7 @@ struct v4l2_device {
 	struct v4l2_prio_state prio;
 	struct kref ref;
 	void (*release)(struct v4l2_device *v4l2_dev);
+	u32 flags;
 };
 
 /**

-- 
2.43.0




More information about the linux-arm-kernel mailing list