From e9667f4df146ec82511975175fb03287afde4296 Mon Sep 17 00:00:00 2001 From: Tim Van Patten Date: Wed, 13 Apr 2022 11:48:36 -0600 Subject: drivers/usb/acpi: acpi_power_res_params: Add use_gpio_for_status Add the member `use_gpio_for_status` to the structure `drivers_usb_acpi_config`, so the `devicetree.cb` can specify it. This field is then used to initialize the corresponding field in the structure `acpi_power_res_params` in `usb_acpi_fill_ssdt_generator()`. The member `acpi_power_res_params::use_gpio_for_status()` is already being used by `acpi_device_add_power_res()` to determine which version of the `_STA()` method to output. BRANCH=None BUG=b:225022810 TEST=Dump SSDT table for guybrush Signed-off-by: Tim Van Patten Change-Id: I69eb5f1ad79f3b2980f43dcf4a36585fca198ec9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63558 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/drivers/usb/acpi/chip.h | 6 ++++++ src/drivers/usb/acpi/usb_acpi.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/drivers/usb') diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h index 41481f1c872e..4adffcf2c0d0 100644 --- a/src/drivers/usb/acpi/chip.h +++ b/src/drivers/usb/acpi/chip.h @@ -66,6 +66,12 @@ struct drivers_usb_acpi_config { * E.g. On a mic: if it is one, it is recording white-noise. */ struct acpi_gpio privacy_gpio; + + /* Write a _STA method that uses the state of the GPIOs to determine if + * the PowerResource is ON or OFF. If this is false, the _STA method + * will always return ON. + */ + bool use_gpio_for_status; }; /* Method to get PLD structure from USB device */ diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index fb9f7f198f52..f72129cba8f6 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -95,7 +95,8 @@ static void usb_acpi_fill_ssdt_generator(const struct device *dev) config->enable_off_delay_ms, NULL, 0, - 0 + 0, + config->use_gpio_for_status }; acpi_device_add_power_res(&power_res_params); } -- cgit v1.2.3