driver/usb/acpi: Add power resources for devices on USB ports
commit5eac877b75f4c21970f4df777461879aeec2520e
authorKarthikeyan Ramasubramanian <kramasub@google.com>
Fri, 23 Oct 2020 21:15:01 +0000 (23 15:15 -0600)
committerPatrick Georgi <pgeorgi@google.com>
Mon, 9 Nov 2020 07:36:50 +0000 (9 07:36 +0000)
tree0956f90dda44a1f8859f8d463c557e1a52a88b50
parent835a2fa73727578e95fc7d0058f6ef89e93d56dc
driver/usb/acpi: Add power resources for devices on USB ports

Allow a USB device to define PowerResource in its SSDT AML code.
PowerResouce ACPI generation expects SoC to define the callbacks for
generating AML code for GPIO manipulation.

Device requiring PowerResource needs to define following parameters:
* Reset GPIO - Optional, GPIO to put device into reset or take it out
of reset.
* Reset delay - Delay after reset GPIO is asserted (default 0).
* Reset off delay - Delay after reset GPIO is de-asserted (default 0).
* Enable GPIO - Optional, GPIO to enable device.
* Enable delay - Delay after enable GPIO is asserted (default 0).
* Enable off delay - Delay after enable GPIO is de-asserted (default 0).

BUG=b:163100335
TEST=Ensure that the Power Resource ACPI object is added under the
concerned USB device.

Change-Id: Icc1aebfb9e3e646a7f608f0cd391079fd30dd1c0
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46713
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Peichao Wang <pwang12@lenovo.corp-partner.google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
src/drivers/usb/acpi/chip.h
src/drivers/usb/acpi/usb_acpi.c