Created
June 30, 2018 17:49
-
-
Save anarsoul/67b4512571fdaba2664fffccd74b91ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/drivers/video/bridge/anx6345.c b/drivers/video/bridge/anx6345.c | |
index 28cf2a9c2d..7e47f15f50 100644 | |
--- a/drivers/video/bridge/anx6345.c | |
+++ b/drivers/video/bridge/anx6345.c | |
@@ -336,7 +336,30 @@ static int anx6345_enable(struct udevice *dev) | |
anx6345_write_r0(dev, ANX9804_HDCP_CONTROL_0_REG, 0x00); | |
anx6345_write_r0(dev, 0xa7, 0x00); | |
- anx6345_read_aux_i2c(dev, 0x50, 0x0, EDID_SIZE, priv->edid); | |
+ for (i = 0; i < 3; i++) { | |
+ ret = anx6345_read_aux_i2c(dev, 0x50, 0x0, EDID_SIZE, priv->edid); | |
+ if (!ret) | |
+ break; | |
+ debug("Failed to read I2C, %d retries remain\n", 3 - i); | |
+ } | |
+ if (ret) { | |
+ char hardcoded_edid[] = { | |
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x09, 0xe5, 0xf0, 0x05, | |
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x18, 0x01, 0x04, 0x95, 0x1f, 0x11, 0x78, | |
+ 0x02, 0x8f, 0xa0, 0x92, 0x5c, 0x56, 0x95, 0x28, 0x1a, 0x50, 0x54, 0x00, | |
+ 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | |
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3e, 0x1c, 0x56, 0xa0, 0x50, 0x00, | |
+ 0x16, 0x30, 0x30, 0x20, 0x36, 0x00, 0x35, 0xad, 0x10, 0x00, 0x00, 0x1a, | |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x42, | |
+ 0x4f, 0x45, 0x20, 0x44, 0x54, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
+ 0x00, 0x00, 0x00, 0xfe, 0x00, 0x48, 0x42, 0x31, 0x34, 0x30, 0x57, 0x58, | |
+ 0x31, 0x2d, 0x33, 0x30, 0x31, 0x0a, 0x00, 0x18 | |
+ | |
+ }; | |
+ debug("Failed to read I2C, will used hardcoded\n"); | |
+ memcpy(priv->edid, hardcoded_edid, EDID_SIZE); | |
+ } | |
if (edid_get_timing(priv->edid, EDID_SIZE, &timing, &bpp) != 0) { | |
debug("Failed to parse EDID\n"); | |
return -EIO; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment