diff options
author | Kane Chen <kane.chen@intel.com> | 2022-12-12 13:15:03 +0800 |
---|---|---|
committer | Eric Lai <eric_lai@quanta.corp-partner.google.com> | 2023-01-19 05:58:33 +0000 |
commit | 56e448b8d5079e418d1be56c31a8e82bf5b95566 (patch) | |
tree | 4f94e685564b470d72ad03964c9eb7fcd5eb8083 /src/acpi | |
parent | 56d831392566713ba416b822cf2416a6d78a51ae (diff) |
drivers/usb/acpi: Add USB _DSM method to enable/disable USB LPM per port
This patch supports projects to use _DSM to control USB3 U1/U2
transition per port.
More details can be found in
https://web.archive.org/web/20230116084819/https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/usb-device-specific-method---dsm-
The ACPI and USB driver of linux kernel need corresponding functions
to support this feature. Please see
https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git/log/?h=port_check_acpi_dsm
BUG=b:253402457
TEST=tested on felwinter and found _DSM method is created.
Change-Id: Iffb2498e26352a3f120c097c50587324e311e8ba
Signed-off-by: Kane Chen <kane.chen@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71924
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src/acpi')
-rw-r--r-- | src/acpi/acpigen_dsm.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/acpi/acpigen_dsm.c b/src/acpi/acpigen_dsm.c index 734fbd5cfb..d51d643c7e 100644 --- a/src/acpi/acpigen_dsm.c +++ b/src/acpi/acpigen_dsm.c @@ -47,3 +47,26 @@ void acpigen_write_dsm_i2c_hid(struct dsm_i2c_hid_config *config) } /* ------------------- End: I2C HID DSM ------------------------- */ + +#define USB_DSM_UUID "CE2EE385-00E6-48CB-9F05-2EDB927C4899" + +static void usb_dsm_func5_cb(void *arg) +{ + struct dsm_usb_config *config = arg; + acpigen_write_return_byte(config->usb_lpm_incapable); +} + +static void (*usb_dsm_callbacks[6])(void *) = { + NULL, + NULL, + NULL, + NULL, + NULL, + usb_dsm_func5_cb, +}; + +void acpigen_write_dsm_usb(struct dsm_usb_config *config) +{ + acpigen_write_dsm(USB_DSM_UUID, usb_dsm_callbacks, + ARRAY_SIZE(usb_dsm_callbacks), config); +} |