diff options
Diffstat (limited to 'src/drivers/i2c/generic/generic.c')
-rw-r--r-- | src/drivers/i2c/generic/generic.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c index 656b9e6c16..872891b64b 100644 --- a/src/drivers/i2c/generic/generic.c +++ b/src/drivers/i2c/generic/generic.c @@ -3,6 +3,7 @@ #include <acpi/acpi_device.h> #include <acpi/acpigen.h> #include <console/console.h> +#include <device/i2c_bus.h> #include <device/i2c_simple.h> #include <device/device.h> #include <device/path.h> @@ -65,6 +66,17 @@ void i2c_generic_fill_ssdt(const struct device *dev, return; } + if (config->detect) { + struct device *const busdev = i2c_busdev(dev); + if (!i2c_dev_detect(busdev, dev->path.i2c.device)) { + printk(BIOS_SPEW, "%s: %s at %s -- NOT FOUND, skipping\n", + path, + config->desc ? : dev->chip_ops->name, + dev_path(dev)); + return; + } + } + /* Device */ acpigen_write_scope(scope); acpigen_write_device(acpi_device_name(dev)); |