Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7be4f888 authored by Mats Randgaard's avatar Mats Randgaard Committed by Mauro Carvalho Chehab
Browse files

[media] ad9389b: no monitor if EDID is wrong



state->have_monitor is set to false if the EDID that is read from
the monitor has too many segments or wrong CRC.

Signed-off-by: default avatarMats Randgaard <matrandg@cisco.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 70028fe6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1019,6 +1019,7 @@ static bool ad9389b_check_edid_status(struct v4l2_subdev *sd)
	segment = ad9389b_rd(sd, 0xc4);
	if (segment >= EDID_MAX_SEGM) {
		v4l2_err(sd, "edid segment number too big\n");
		state->have_monitor = false;
		return false;
	}
	v4l2_dbg(1, debug, sd, "%s: got segment %d\n", __func__, segment);
@@ -1032,6 +1033,8 @@ static bool ad9389b_check_edid_status(struct v4l2_subdev *sd)
	}
	if (!edid_segment_verify_crc(sd, segment)) {
		/* edid crc error, force reread of edid segment */
		v4l2_err(sd, "%s: edid crc error\n", __func__);
		state->have_monitor = false;
		ad9389b_s_power(sd, false);
		ad9389b_s_power(sd, true);
		return false;