summaryrefslogtreecommitdiff
path: root/drivers/video/dw_hdmi.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-29 09:02:46 -0400
committerTom Rini <trini@konsulko.com>2019-07-29 09:02:46 -0400
commitad4a699cfe36639979d27a1045d766397b2cb0bb (patch)
tree9bc67763b8d48d950ae08d29ec75605138ba0b4d /drivers/video/dw_hdmi.c
parentc957be9ba006789c7ca1158120ed40265bfeed8a (diff)
parent970baf16d1322d3930a57fc78ddfb15d594d690c (diff)
Merge tag 'video-for-2019.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-video
- dcu and imx7 DM_VIDEO conversion - lb070wv8 compatible in simple_panel driver - bmp_logo improvements for DM_VIDEO - EDID updates to filter supported modes - meson_dw_hdmi: support EDID mode filtering - dw_hdmi: support ddc-i2c-bus phandle for external I2C masters - fix rpi crash when firmware doesn't report connected display
Diffstat (limited to 'drivers/video/dw_hdmi.c')
-rw-r--r--drivers/video/dw_hdmi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c
index 463436edf3..bf74d6adf2 100644
--- a/drivers/video/dw_hdmi.c
+++ b/drivers/video/dw_hdmi.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <fdtdec.h>
#include <asm/io.h>
+#include <i2c.h>
#include <media_bus_format.h>
#include "dw_hdmi.h"
@@ -812,6 +813,18 @@ static int hdmi_read_edid(struct dw_hdmi *hdmi, int block, u8 *buff)
u32 trytime = 5;
u32 n;
+ if (CONFIG_IS_ENABLED(DM_I2C) && hdmi->ddc_bus) {
+ struct udevice *chip;
+
+ edid_read_err = i2c_get_chip(hdmi->ddc_bus,
+ HDMI_I2CM_SLAVE_DDC_ADDR,
+ 1, &chip);
+ if (edid_read_err)
+ return edid_read_err;
+
+ return dm_i2c_read(chip, shift, buff, HDMI_EDID_BLOCK_SIZE);
+ }
+
/* set ddc i2c clk which devided from ddc_clk to 100khz */
hdmi_write(hdmi, hdmi->i2c_clk_high, HDMI_I2CM_SS_SCL_HCNT_0_ADDR);
hdmi_write(hdmi, hdmi->i2c_clk_low, HDMI_I2CM_SS_SCL_LCNT_0_ADDR);