summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/i2c/designware/dw_i2c.c4
-rw-r--r--src/drivers/i2c/designware/dw_i2c.h3
-rw-r--r--src/soc/intel/apollolake/i2c.c5
-rw-r--r--src/soc/intel/cannonlake/i2c.c5
-rw-r--r--src/soc/intel/common/block/i2c/i2c_early.c2
-rw-r--r--src/soc/intel/skylake/i2c.c5
6 files changed, 13 insertions, 11 deletions
diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c
index aeddbbcf01..384cca5783 100644
--- a/src/drivers/i2c/designware/dw_i2c.c
+++ b/src/drivers/i2c/designware/dw_i2c.c
@@ -772,7 +772,7 @@ void dw_i2c_dev_init(struct device *dev)
if (bus < 0)
return;
- config = dw_i2c_get_soc_cfg(bus, dev);
+ config = dw_i2c_get_soc_cfg(bus);
if (!config)
return;
@@ -806,7 +806,7 @@ void dw_i2c_acpi_fill_ssdt(struct device *dev)
if (bus < 0)
return;
- bcfg = dw_i2c_get_soc_cfg(bus, dev);
+ bcfg = dw_i2c_get_soc_cfg(bus);
if (!bcfg)
return;
diff --git a/src/drivers/i2c/designware/dw_i2c.h b/src/drivers/i2c/designware/dw_i2c.h
index c97ed7785f..be5e7e32a3 100644
--- a/src/drivers/i2c/designware/dw_i2c.h
+++ b/src/drivers/i2c/designware/dw_i2c.h
@@ -102,8 +102,7 @@ int dw_i2c_soc_bus_to_devfn(unsigned int bus);
*
* Returns NULL if i2c config is not found
*/
-const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus,
- const struct device *dev);
+const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus);
/* Get I2C controller base address */
uintptr_t dw_i2c_base_address(unsigned int bus);
diff --git a/src/soc/intel/apollolake/i2c.c b/src/soc/intel/apollolake/i2c.c
index bcaf740fe6..3df333c869 100644
--- a/src/soc/intel/apollolake/i2c.c
+++ b/src/soc/intel/apollolake/i2c.c
@@ -21,10 +21,11 @@
#include <soc/pci_devs.h>
#include "chip.h"
-const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus,
- const struct device *dev)
+const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus)
{
const struct soc_intel_apollolake_config *config;
+ const struct device *dev = dev_find_slot(0, SA_DEVFN_ROOT);
+
if (!dev || !dev->chip_info) {
printk(BIOS_ERR, "%s: Could not find SoC devicetree config!\n",
__func__);
diff --git a/src/soc/intel/cannonlake/i2c.c b/src/soc/intel/cannonlake/i2c.c
index f183253443..ef3034537f 100644
--- a/src/soc/intel/cannonlake/i2c.c
+++ b/src/soc/intel/cannonlake/i2c.c
@@ -22,10 +22,11 @@
#include <soc/pci_devs.h>
#include "chip.h"
-const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus,
- const struct device *dev)
+const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus)
{
const struct soc_intel_cannonlake_config *config;
+ const struct device *dev = dev_find_slot(0, SA_DEVFN_ROOT);
+
if (!dev || !dev->chip_info) {
printk(BIOS_ERR, "%s: Could not find SoC devicetree config!\n",
__func__);
diff --git a/src/soc/intel/common/block/i2c/i2c_early.c b/src/soc/intel/common/block/i2c/i2c_early.c
index 728e7880b5..c4af55967a 100644
--- a/src/soc/intel/common/block/i2c/i2c_early.c
+++ b/src/soc/intel/common/block/i2c/i2c_early.c
@@ -47,7 +47,7 @@ static int lpss_i2c_early_init_bus(unsigned int bus)
}
/* Skip if not enabled for early init */
- config = dw_i2c_get_soc_cfg(bus, tree_dev);
+ config = dw_i2c_get_soc_cfg(bus);
if (!config || !config->early_init) {
printk(BIOS_DEBUG, "I2C%u not enabled for early init\n", bus);
return -1;
diff --git a/src/soc/intel/skylake/i2c.c b/src/soc/intel/skylake/i2c.c
index 56260d702f..baf6335ced 100644
--- a/src/soc/intel/skylake/i2c.c
+++ b/src/soc/intel/skylake/i2c.c
@@ -20,10 +20,11 @@
#include <soc/pci_devs.h>
#include "chip.h"
-const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus,
- const struct device *dev)
+const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus)
{
const struct soc_intel_skylake_config *config;
+ const struct device *dev = dev_find_slot(0, SA_DEVFN_ROOT);
+
if (!dev || !dev->chip_info) {
printk(BIOS_ERR, "%s: Could not find SoC devicetree config!\n",
__func__);