[media] adv7842: clear edid, if no edid just disable Edid-DDC access
authorMartin Bugge <marbugge@cisco.com>
Thu, 5 Dec 2013 15:09:51 +0000 (12:09 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 7 Jan 2014 08:35:06 +0000 (06:35 -0200)
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/adv7842.c

index bbd80acbabfe01ddab415b78cb28bcca78500b74..eab9a1b8b54bed9b47c3dd72fa6b3a231f1d1db9 100644 (file)
@@ -700,6 +700,9 @@ static int edid_write_hdmi_segment(struct v4l2_subdev *sd, u8 port)
        /* Disable I2C access to internal EDID ram from HDMI DDC ports */
        rep_write_and_or(sd, 0x77, 0xf3, 0x00);
 
+       if (!state->hdmi_edid.present)
+               return 0;
+
        /* edid segment pointer '0' for HDMI ports */
        rep_write_and_or(sd, 0x77, 0xef, 0x00);
 
@@ -2638,8 +2641,8 @@ static int adv7842_command_ram_test(struct v4l2_subdev *sd)
        adv7842_s_dv_timings(sd, &state->timings);
 
        edid_write_vga_segment(sd);
-       edid_write_hdmi_segment(sd, 0);
-       edid_write_hdmi_segment(sd, 1);
+       edid_write_hdmi_segment(sd, ADV7842_EDID_PORT_A);
+       edid_write_hdmi_segment(sd, ADV7842_EDID_PORT_B);
 
        return ret;
 }