aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/stoneyridge/chip.c')
-rw-r--r--src/soc/amd/stoneyridge/chip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/chip.c b/src/soc/amd/stoneyridge/chip.c
index d447ffa8ab..d3a8bc4044 100644
--- a/src/soc/amd/stoneyridge/chip.c
+++ b/src/soc/amd/stoneyridge/chip.c
@@ -20,6 +20,7 @@
#include <cpu/cpu.h>
#include <device/device.h>
#include <device/pci.h>
+#include <drivers/i2c/designware/dw_i2c.h>
#include <soc/cpu.h>
#include <soc/northbridge.h>
#include <soc/pci_devs.h>
@@ -28,6 +29,10 @@
#include <amdblocks/agesawrapper.h>
#include <amdblocks/agesawrapper_call.h>
+/* Supplied by i2c.c */
+extern struct device_operations stoneyridge_i2c_mmio_ops;
+extern const char *i2c_acpi_name(const struct device *dev);
+
struct device_operations cpu_bus_ops = {
.read_resources = DEVICE_NOOP,
.set_resources = DEVICE_NOOP,
@@ -79,6 +84,9 @@ static void enable_dev(device_t dev)
dev->ops = &cpu_bus_ops;
else if (dev->path.type == DEVICE_PATH_PCI)
sb_enable(dev);
+ else if (dev->path.type == DEVICE_PATH_MMIO)
+ if (i2c_acpi_name(dev) != NULL)
+ dev->ops = &stoneyridge_i2c_mmio_ops;
}
static void soc_init(void *chip_info)