From a1a3be1df84fd76c9195dff182e77fe391101c7f Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Thu, 22 Dec 2022 09:25:07 +0100 Subject: mb/siemens/mc_apl7: Init I2C controller before PTN3460 is initialized When PTN3460_EARLY_INIT is selected, the PTN3460 (DP-2-LVDS-bridge) will be initialized before all devices are initialized. This is necessary to get a valid EDID data set into the PTN3460 before the graphic controller is initialized in order to be able to show a splash screen. For ptn3460_init() to work properly the I2C bus this bridge is connected to needs to be initialized. As this I2C bus initialization would be done too late in the normal flow, it needs to be called here explicitly before ptn3460_init() to initialize the I2C bus with the needed conditions. Otherwise the default I2C settings of the controller will be used which results in a clock rate too high for this mainboard. Test=Measure I2C bus signals and make sure that the clock is <= 400 kHz. Change-Id: I1775fb7c2d29f765224d0e7c7ff9fcd4dbf847c5 Signed-off-by: Werner Zeh Reviewed-on: https://review.coreboot.org/c/coreboot/+/71226 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/drivers/i2c/ptn3460/ptn3460.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/drivers/i2c') diff --git a/src/drivers/i2c/ptn3460/ptn3460.c b/src/drivers/i2c/ptn3460/ptn3460.c index 46719dc5e6..3ea41ba22c 100644 --- a/src/drivers/i2c/ptn3460/ptn3460.c +++ b/src/drivers/i2c/ptn3460/ptn3460.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -170,7 +171,9 @@ static void ptn3460_early_init(void *unused) printk(BIOS_ERR, "Failed to find the PTN3460 device!\n"); return; } - + /* Initialize the I2C controller before it is used. */ + if (ptn_dev->bus && ptn_dev->bus->dev->ops && ptn_dev->bus->dev->ops->init) + ptn_dev->bus->dev->ops->init(ptn_dev->bus->dev); ptn3460_init(ptn_dev); } -- cgit v1.2.3