summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/veyron_brain/mainboard.c4
-rw-r--r--src/mainboard/google/veyron_danger/mainboard.c4
-rw-r--r--src/mainboard/google/veyron_mickey/mainboard.c4
-rw-r--r--src/soc/rockchip/rk3288/hdmi.c16
4 files changed, 16 insertions, 12 deletions
diff --git a/src/mainboard/google/veyron_brain/mainboard.c b/src/mainboard/google/veyron_brain/mainboard.c
index 336879c61b..22faf6440b 100644
--- a/src/mainboard/google/veyron_brain/mainboard.c
+++ b/src/mainboard/google/veyron_brain/mainboard.c
@@ -82,10 +82,6 @@ static void configure_hdmi(void)
/* set POWER_HDMI_ON */
gpio_output(GPIO(7, A, 2), 1);
-
- /* HDMI I2C */
- write32(&rk3288_grf->iomux_i2c5sda, IOMUX_HDMI_EDP_I2C_SDA);
- write32(&rk3288_grf->iomux_i2c5scl, IOMUX_HDMI_EDP_I2C_SCL);
}
static void mainboard_init(device_t dev)
diff --git a/src/mainboard/google/veyron_danger/mainboard.c b/src/mainboard/google/veyron_danger/mainboard.c
index 8288e4d8dd..f923da9d01 100644
--- a/src/mainboard/google/veyron_danger/mainboard.c
+++ b/src/mainboard/google/veyron_danger/mainboard.c
@@ -137,10 +137,6 @@ static void configure_hdmi(void)
gpio_output(GPIO(5, C, 3), 1);
break;
}
-
- /* HDMI I2C */
- write32(&rk3288_grf->iomux_i2c5sda, IOMUX_HDMI_EDP_I2C_SDA);
- write32(&rk3288_grf->iomux_i2c5scl, IOMUX_HDMI_EDP_I2C_SCL);
}
static void mainboard_init(device_t dev)
diff --git a/src/mainboard/google/veyron_mickey/mainboard.c b/src/mainboard/google/veyron_mickey/mainboard.c
index f07e5f22fd..27e9f745e5 100644
--- a/src/mainboard/google/veyron_mickey/mainboard.c
+++ b/src/mainboard/google/veyron_mickey/mainboard.c
@@ -75,10 +75,6 @@ static void configure_vop(void)
static void configure_hdmi(void)
{
- /* HDMI I2C */
- write32(&rk3288_grf->iomux_i2c5sda, IOMUX_HDMI_EDP_I2C_SDA);
- write32(&rk3288_grf->iomux_i2c5scl, IOMUX_HDMI_EDP_I2C_SCL);
-
gpio_output(GPIO(7, B, 3), 1); /* POWER_HDMI_ON */
}
diff --git a/src/soc/rockchip/rk3288/hdmi.c b/src/soc/rockchip/rk3288/hdmi.c
index 805b98a6e5..1a825abfca 100644
--- a/src/soc/rockchip/rk3288/hdmi.c
+++ b/src/soc/rockchip/rk3288/hdmi.c
@@ -15,6 +15,7 @@
#include <console/console.h>
#include <delay.h>
#include <edid.h>
+#include <gpio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@@ -774,8 +775,23 @@ int rk_hdmi_get_edid(struct edid *edid)
{
u8 edid_buf[HDMI_EDID_BLOCK_SIZE * 2];
u32 edid_size = HDMI_EDID_BLOCK_SIZE;
+ gpio_t hdmi_i2c_sda = GPIO(7, C, 3);
+ gpio_t hdmi_i2c_scl = GPIO(7, C, 4);
int ret;
+ /* If SDA is low, try to clock once to fix it */
+ gpio_input_pullup(hdmi_i2c_sda);
+ if (gpio_get(hdmi_i2c_sda) == 0) {
+ gpio_output(hdmi_i2c_scl, 0);
+ udelay(1000);
+ gpio_input_pullup(hdmi_i2c_scl);
+ udelay(1000);
+ }
+
+ /* HDMI I2C */
+ write32(&rk3288_grf->iomux_i2c5sda, IOMUX_HDMI_EDP_I2C_SDA);
+ write32(&rk3288_grf->iomux_i2c5scl, IOMUX_HDMI_EDP_I2C_SCL);
+
ret = hdmi_read_edid(0, edid_buf);
if (ret) {
hdmi_debug("failed to read edid.\n");