On Mon Sep 21 09:15:34 2026 +0200, Gerald Loacker wrote:
> 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 <[email protected]>
> Signed-off-by: Sascha Hauer <[email protected]>
> Reviewed-by: Dmitry Osipenko <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 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 6810bfc39da7..1737d741a54e 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -1208,6 +1208,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;
 
@@ -1216,6 +1219,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;
 }
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to