aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0068-drm-adv7511-use-smbus-to-retrieve-edid.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0068-drm-adv7511-use-smbus-to-retrieve-edid.patch')
-rw-r--r--meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0068-drm-adv7511-use-smbus-to-retrieve-edid.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0068-drm-adv7511-use-smbus-to-retrieve-edid.patch b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0068-drm-adv7511-use-smbus-to-retrieve-edid.patch
new file mode 100644
index 0000000..1b4dbd8
--- /dev/null
+++ b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0068-drm-adv7511-use-smbus-to-retrieve-edid.patch
@@ -0,0 +1,53 @@
+From 2e2b673a2a47e8358ef92ec4019be87552949304 Mon Sep 17 00:00:00 2001
+From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
+Date: Wed, 9 Aug 2017 11:52:22 +0300
+Subject: [PATCH] drm: adv7511: use smbus to retrieve edid
+
+Get EDID using smbus protocol instead block i2c transfer
+This fixes often checksum errors while retriving EDID at 400kHz bus speed
+
+Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
+---
+ drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+index d3ece87..b2e1b58 100644
+--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
++++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+@@ -500,18 +500,19 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block,
+ * support 64 byte transfers than 256 byte transfers
+ */
+
++#define CHUNK_SIZE 1
+ xfer[0].addr = adv7511->i2c_edid->addr;
+ xfer[0].flags = 0;
+ xfer[0].len = 1;
+ xfer[0].buf = &offset;
+ xfer[1].addr = adv7511->i2c_edid->addr;
+ xfer[1].flags = I2C_M_RD;
+- xfer[1].len = 64;
++ xfer[1].len = CHUNK_SIZE;
+ xfer[1].buf = adv7511->edid_buf;
+
+ offset = 0;
+
+- for (i = 0; i < 4; ++i) {
++ for (i = 0; i < 256/CHUNK_SIZE; ++i) {
+ ret = i2c_transfer(adv7511->i2c_edid->adapter, xfer,
+ ARRAY_SIZE(xfer));
+ if (ret < 0)
+@@ -519,8 +520,8 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block,
+ else if (ret != 2)
+ return -EIO;
+
+- xfer[1].buf += 64;
+- offset += 64;
++ xfer[1].buf += CHUNK_SIZE;
++ offset += CHUNK_SIZE;
+ }
+
+ adv7511->current_edid_segment = block / 2;
+--
+1.9.1
+