Message ID | de582d1f-700b-4d95-bd48-196413116455@xs4all.nl (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | media: tc358743: ignore video while HPD is low | expand |
On Tue, Apr 01, 2025 at 11:54:17AM +0200, Hans Verkuil wrote: > If the HPD is low (happens if there is no EDID or the > EDID is being updated), then return -ENOLINK in > tc358743_get_detected_timings() instead of detecting video. > > This avoids userspace thinking that it can start streaming when > the HPD is low. > > Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> > Tested-by: Maxime Ripard <mripard@kernel.org> Thanks for submitting it. It might be worth adding a Link: tag to the initial discussion? Maxime
On 01/04/2025 13:10, Maxime Ripard wrote: > On Tue, Apr 01, 2025 at 11:54:17AM +0200, Hans Verkuil wrote: >> If the HPD is low (happens if there is no EDID or the >> EDID is being updated), then return -ENOLINK in >> tc358743_get_detected_timings() instead of detecting video. >> >> This avoids userspace thinking that it can start streaming when >> the HPD is low. >> >> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> >> Tested-by: Maxime Ripard <mripard@kernel.org> > > Thanks for submitting it. It might be worth adding a Link: tag to the > initial discussion? > > Maxime Good idea: Link: https://lore.kernel.org/linux-media/20240628-stoic-bettong-of-fortitude-e25611@houat/ Regards, Hans
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index c50d4e85dfd1..44060f108277 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -313,6 +313,10 @@ static int tc358743_get_detected_timings(struct v4l2_subdev *sd, memset(timings, 0, sizeof(struct v4l2_dv_timings)); + /* if HPD is low, ignore any video */ + if (!(i2c_rd8(sd, HPD_CTL) & MASK_HPD_OUT0)) + return -ENOLINK; + if (no_signal(sd)) { v4l2_dbg(1, debug, sd, "%s: no valid signal\n", __func__); return -ENOLINK;