[PATCH v2 8/9] media: v4l2-subdev: notify the bridge when the source power changes
From: Sascha Hauer
Date: Thu Sep 24 2026 - 08:14:01 EST
Whether a source is driving the connector's +5V line is published as
V4L2_CID_DV_RX_POWER_PRESENT and nowhere else. adv7604, adv7842,
tc358743 and tda1997x all set that control from their cable detect
interrupt and stop there, so a driver that has to act on the change in
hardware, rather than hand the value to userspace, has nothing to hook.
The in-kernel channel already exists for the neighbouring events. A
format change goes out through v4l2_subdev_notify_event() as
V4L2_EVENT_SOURCE_CHANGE, and adv7604 sends a private ADV76XX_HOTPLUG
when the bridge has to drive HPD back out at the connector, which cobalt
consumes. Only the source power state is missing.
Add a generic notification for it. The argument carries the same
per-input mask as the control, so a device in front of a receiver can
pass on what it sees without the receiver having to reach into its
control handler.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
include/media/v4l2-subdev.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index c1483a85d0c72..a3ee4866cce69 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -29,6 +29,14 @@
#define V4L2_DEVICE_NOTIFY_EVENT _IOW('v', 2, struct v4l2_event)
+/*
+ * The source power state a receiver publishes as
+ * V4L2_CID_DV_RX_POWER_PRESENT has changed. The argument points at an
+ * unsigned int holding the same per-input mask as that control, so zero
+ * means no input sees a source.
+ */
+#define V4L2_DEVICE_NOTIFY_RX_POWER_PRESENT _IOW('v', 3, unsigned int)
+
struct v4l2_device;
struct v4l2_ctrl_handler;
struct v4l2_event;
--
2.47.3