summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorMats Randgaard <matrandg@cisco.com>2013-08-14 09:23:48 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-24 04:24:58 -0300
commit7be4f888112eeebd7ce33bca49b3a1df1fd52295 (patch)
tree7bf955334a58e0ab666dc2e9ddf825d7ea6201cd /drivers/media/i2c
parent70028fe646e63dd01070d1aaf304bbbc80e4a90a (diff)
downloadop-kernel-dev-7be4f888112eeebd7ce33bca49b3a1df1fd52295.zip
op-kernel-dev-7be4f888112eeebd7ce33bca49b3a1df1fd52295.tar.gz
[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: Mats Randgaard <matrandg@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/ad9389b.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 7e68d8f..52384e8 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -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;
OpenPOWER on IntegriCloud