summaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/stoneyridge/i2c.c')
-rw-r--r--src/soc/amd/stoneyridge/i2c.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c
index 947c43f3b0..b90e5d7857 100644
--- a/src/soc/amd/stoneyridge/i2c.c
+++ b/src/soc/amd/stoneyridge/i2c.c
@@ -101,7 +101,7 @@ int dw_i2c_soc_dev_to_bus(struct device *dev)
return -1;
}
-void i2c_soc_early_init(void)
+static void dw_i2c_soc_init(bool is_early_init)
{
size_t i;
const struct soc_amd_stoneyridge_config *config;
@@ -114,7 +114,7 @@ void i2c_soc_early_init(void)
for (i = 0; i < ARRAY_SIZE(config->i2c); i++) {
const struct dw_i2c_bus_config *cfg = &config->i2c[i];
- if (!cfg->early_init)
+ if (cfg->early_init != is_early_init)
continue;
if (dw_i2c_init(i, cfg))
@@ -122,6 +122,16 @@ void i2c_soc_early_init(void)
}
}
+void i2c_soc_early_init(void)
+{
+ dw_i2c_soc_init(true);
+}
+
+void i2c_soc_init(void)
+{
+ dw_i2c_soc_init(false);
+}
+
struct device_operations stoneyridge_i2c_mmio_ops = {
/* TODO(teravest): Move I2C resource info here. */
.read_resources = DEVICE_NOOP,