Skip to content

Commit a5f6da0

Browse files
committed
drm: adv7511: do 4 regmap_bulk_read() calls for EDID
Previously, 4 x i2c_transfer() calls used to be done, to read the EDID. This does the same thing using regmap_bulk_read(). The i2c-cadence driver can only do 252 bytes, and some i2c controllers can do 64-byte transfer-sizes. The issue that is visible [without this change] is that the resolution [read-back from the monitor] is reduced to a minimal [640x480]. I tried to see whether we can extend that 252-byte-transfer limit, but that is a bit too difficult, because it requires too many i2c framework changes that wouldn't make sense. The i2c controller is configured to issue an i2c transfer, then an interrupt shoots to notify that it completed. Fixes 6a83880: ("drm: bridge: adv7511: Implement regmap for EDID memory map") Signed-off-by: Alexandru Ardelean <[email protected]>
1 parent 44e7b75 commit a5f6da0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block,
531531
size_t len)
532532
{
533533
struct adv7511 *adv7511 = data;
534-
int ret;
534+
int ret, off;
535535

536536
if (len > 128)
537537
return -EINVAL;
@@ -553,10 +553,12 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block,
553553
return ret;
554554
}
555555

556-
ret = regmap_bulk_read(adv7511->regmap_edid, 0,
557-
adv7511->edid_buf, 256);
558-
if (ret < 0)
559-
return ret;
556+
for (off = 0; off < 256; off+= 64) {
557+
ret = regmap_bulk_read(adv7511->regmap_edid, off,
558+
&adv7511->edid_buf[off], 64);
559+
if (ret < 0)
560+
return ret;
561+
}
560562

561563
adv7511->current_edid_segment = block / 2;
562564
}

0 commit comments

Comments
 (0)