drivers/i2c/generic: Add option to set ACPI subsystem ID
Change-Id: I7c9c938bd20d36be8fdfb0d95bb58a7259650693
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76801
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: CoolStar <coolstarorganization@gmail.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h
index 0942d00..8e13ffc 100644
--- a/src/drivers/i2c/generic/chip.h
+++ b/src/drivers/i2c/generic/chip.h
@@ -11,6 +11,7 @@
struct drivers_i2c_generic_config {
const char *hid; /* ACPI _HID (required) */
const char *cid; /* ACPI _CID */
+ const char *sub; /* ACPI _SUB */
const char *name; /* ACPI Device Name */
const char *desc; /* Device Description */
unsigned int uid; /* ACPI _UID */
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c
index d1baeb7..1a3ec40 100644
--- a/src/drivers/i2c/generic/generic.c
+++ b/src/drivers/i2c/generic/generic.c
@@ -83,6 +83,8 @@
acpigen_write_name_string("_HID", config->hid);
if (config->cid)
acpigen_write_name_string("_CID", config->cid);
+ if (config->sub)
+ acpigen_write_name_string("_SUB", config->sub);
acpigen_write_name_integer("_UID", config->uid);
if (config->desc)
acpigen_write_name_string("_DDN", config->desc);