[PATCH 2/3] media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT
From: Sascha Hauer
Date: Mon Sep 21 2026 - 03:16:19 EST
From: Gerald Loacker <gerald.loacker@xxxxxxxxxxxxxx>
Userspace currently has to learn the cable and lock state from the error
VIDIOC_QUERY_DV_TIMINGS returns, -ENOLINK or -ENOLCK. Both of those paths
log at v4l2_err level, so waiting for a cable fills the kernel log.
Report it where it belongs instead: V4L2_IN_ST_NO_POWER while the source
is not driving the connector's +5V line, V4L2_IN_ST_NO_SIGNAL while the
receiver has not locked. Both come from the helpers
hdmirx_query_dv_timings() already uses, so the two cannot disagree.
adv76xx_g_input_status() and adv7842_g_input_status() report the same two
flags the same way.
Signed-off-by: Gerald Loacker <gerald.loacker@xxxxxxxxxxxxxx>
Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index 24ec6138a1fb6..75576a9366fd0 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -1199,6 +1199,9 @@ static void hdmirx_submodule_init(struct snps_hdmirx_dev *hdmirx_dev)
static int hdmirx_enum_input(struct file *file, void *priv,
struct v4l2_input *input)
{
+ struct hdmirx_stream *stream = video_drvdata(file);
+ struct snps_hdmirx_dev *hdmirx_dev = stream->hdmirx_dev;
+
if (input->index > 0)
return -EINVAL;
@@ -1207,6 +1210,12 @@ static int hdmirx_enum_input(struct file *file, void *priv,
strscpy(input->name, "HDMI IN", sizeof(input->name));
input->capabilities = V4L2_IN_CAP_DV_TIMINGS;
+ input->status = 0;
+ if (port_no_link(hdmirx_dev))
+ input->status |= V4L2_IN_ST_NO_POWER;
+ if (signal_not_lock(hdmirx_dev))
+ input->status |= V4L2_IN_ST_NO_SIGNAL;
+
return 0;
}
--
2.47.3