[PATCH v12 19/86] media: v4l: Add V4L2_SUBDEV_ROUTE_FL_STATIC sub-device routing flag

Sakari Ailus
2026-04-09T20:15:25Z

Add a flag to denote static routes, V4L2_SUBDEV_ROUTE_FL_STATIC. Such
routes cannot be removed as they are related to hardware features.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
.../userspace-api/media/v4l/vidioc-subdev-g-routing.rst | 6 +++++-
include/uapi/linux/v4l2-subdev.h | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst b/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst
index 2fd55d875075..e99c83d21165 100644
--- a/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst
+++ b/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst
@@ -150,7 +150,11 @@ wants to retrieve the missing routes, it can issue a new
- 0x0002
- The route is immutable. Set by the driver. Indicates that the
``V4L2_SUBDEV_ROUTE_FL_ACTIVE`` flag of an immutable route may not be
- unset.
+ unset. Implies ``V4L2_SUBDEV_ROUTE_FL_STATIC``.
+ * - ``V4L2_SUBDEV_ROUTE_FL_STATIC``
+ - 0x0004
+ - The route is static. Set by the driver. Indicates that the route is
+ always present and cannot be removed.

Return Value
============
diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h
index 2be7db814288..477d3ce3ddb4 100644
--- a/include/uapi/linux/v4l2-subdev.h
+++ b/include/uapi/linux/v4l2-subdev.h
@@ -212,6 +212,10 @@ struct v4l2_subdev_capability {
* unset.
*/
#define V4L2_SUBDEV_ROUTE_FL_IMMUTABLE (1U << 1)
+/*
+ * Is the route static? Routes with the STATIC flag are not removable.
+ */
+#define V4L2_SUBDEV_ROUTE_FL_STATIC (1U << 2)

/**
* struct v4l2_subdev_route - A route inside a subdev
--
2.47.3