From: Krzysztof Hałasa Date: Mon, 26 Jul 2021 10:49:30 +0000 (+0200) Subject: media: TDA1997x: report -ENOLINK after disconnecting HDMI source X-Git-Tag: accepted/tizen/unified/20230118.172025~6519^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cdd19bbad75f6cf1c44ac494b92a3b8d8826001;p=platform%2Fkernel%2Flinux-rpi.git media: TDA1997x: report -ENOLINK after disconnecting HDMI source The TD1997x chip retains vper, hper and hsper register values when the HDMI source is disconnected. Use a different means of checking if the link is still valid. Signed-off-by: Krzysztof Hałasa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 98b7c39..6070aaf 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -1107,7 +1107,8 @@ tda1997x_detect_std(struct tda1997x_state *state, hper = io_read16(sd, REG_H_PER) & MASK_HPER; hsper = io_read16(sd, REG_HS_WIDTH) & MASK_HSWIDTH; v4l2_dbg(1, debug, sd, "Signal Timings: %u/%u/%u\n", vper, hper, hsper); - if (!vper || !hper || !hsper) + + if (!state->input_detect[0] && !state->input_detect[1]) return -ENOLINK; for (i = 0; v4l2_dv_timings_presets[i].bt.width; i++) {