diff options
author | Kun Liu <liukun11@huaqin.corp-partner.google.com> | 2024-06-20 13:35:42 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-07-01 13:38:53 +0000 |
commit | c693e92c7482557a4685c6ce8dda0db5cfdd734f (patch) | |
tree | 702316baaa986487a57b3973dbcd8602514e2e42 | |
parent | 06575901cfd47fb02706f253a7b335aeb70664cd (diff) |
drivers/spi/acpi: Add generic property list
The touchscreen vendor (Goodix) needs to use this value
(hid-report-addr) in the touch driver, and this value
needs to be changed later.So add generic property list to allow populating vendor specific device properties to ACPI SSDT table.
BUG=b:342932183
BRANCH=None
TEST=emerge-brox coreboot
Change-Id: I8b18e0a2925e6fd36e3a470bde9910661b7558b8
Signed-off-by: Kun Liu <liukun11@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83139
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/drivers/spi/acpi/acpi.c | 5 | ||||
-rw-r--r-- | src/drivers/spi/acpi/chip.h | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/drivers/spi/acpi/acpi.c b/src/drivers/spi/acpi/acpi.c index 6d92776683..687dd52d56 100644 --- a/src/drivers/spi/acpi/acpi.c +++ b/src/drivers/spi/acpi/acpi.c @@ -131,7 +131,7 @@ static void spi_acpi_fill_ssdt_generator(const struct device *dev) /* Write device properties if needed */ if (config->compat_string || irq_gpio_index >= 0 || - reset_gpio_index >= 0 || enable_gpio_index >= 0) { + reset_gpio_index >= 0 || enable_gpio_index >= 0 || config->property_count) { struct acpi_dp *dsd = acpi_dp_new_table("_DSD"); if (config->compat_string) acpi_dp_add_string(dsd, "compatible", @@ -148,6 +148,9 @@ static void spi_acpi_fill_ssdt_generator(const struct device *dev) acpi_dp_add_gpio(dsd, "enable-gpios", path, enable_gpio_index, 0, config->enable_gpio.active_low); + /* Add generic property list */ + acpi_dp_add_property_list(dsd, config->property_list, + config->property_count); acpi_dp_write(dsd); } diff --git a/src/drivers/spi/acpi/chip.h b/src/drivers/spi/acpi/chip.h index 9bee847f2b..b7b39f7c3a 100644 --- a/src/drivers/spi/acpi/chip.h +++ b/src/drivers/spi/acpi/chip.h @@ -5,6 +5,8 @@ #include <acpi/acpi_device.h> +#define MAX_GENERIC_PROPERTY_LIST 10 + struct drivers_spi_acpi_config { const char *hid; /* ACPI _HID (required) */ const char *cid; /* ACPI _CID */ @@ -42,6 +44,9 @@ struct drivers_spi_acpi_config { unsigned int stop_delay_ms; /* Delay to be inserted after enabling stop. */ unsigned int stop_off_delay_ms; + /* Generic properties for exporting device-specific data to the OS */ + struct acpi_dp property_list[MAX_GENERIC_PROPERTY_LIST]; + unsigned int property_count; }; #endif /* __SPI_ACPI_CHIP_H__ */ |