aboutsummaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-11-04 05:07:49 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-11-06 10:50:10 +0000
commit78816983389392a1fcae462fd82f717a3914009c (patch)
treeb5a28ef9894e694b0a47a9bc50ed17faef24047f /src/soc
parent8585fd08725a415a03ce62573a0be8568cccffd0 (diff)
soc/amd/common/block/i2c: add pre-processor guards for ACPI
Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I8dc93b12b81abee41f6f225f41d1f9953d1d93e1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78898 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <ericllai@google.com>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/common/block/i2c/i2c.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/i2c/i2c.c b/src/soc/amd/common/block/i2c/i2c.c
index 57819fbe8f..3c3e9d393a 100644
--- a/src/soc/amd/common/block/i2c/i2c.c
+++ b/src/soc/amd/common/block/i2c/i2c.c
@@ -44,6 +44,7 @@ const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus)
return &cfg[bus];
}
+#if CONFIG(HAVE_ACPI_TABLES)
static const char *i2c_acpi_name(const struct device *dev)
{
size_t i;
@@ -71,6 +72,7 @@ static void i2c_acpi_fill_ssdt(const struct device *dev)
acpigen_write_store_int_to_namestr(acpi_device_status(dev), "STAT");
acpigen_pop_len(); /* Scope */
}
+#endif
int dw_i2c_soc_dev_to_bus(const struct device *dev)
{
@@ -138,8 +140,10 @@ struct device_operations soc_amd_i2c_mmio_ops = {
.read_resources = i2c_read_resources,
.set_resources = noop_set_resources,
.scan_bus = scan_smbus,
+#if CONFIG(HAVE_ACPI_TABLES)
.acpi_name = i2c_acpi_name,
.acpi_fill_ssdt = i2c_acpi_fill_ssdt,
+#endif
.ops_i2c_bus = &dw_i2c_bus_ops,
};