acpi: Use ACPI macros to configure USB port _PLD object

This patch adds two ACPI macros for USB port A and C _PLD object
configuration as:
1. ACPI_PLD_TYPE_A
2. ACPI_PLD_TYPE_C

The configurable parameters are
- Panel, Port is exposed on which face of a panel.
- Horizontal, Horizontal position on the panel where the device
               connection point resides.
- Group
   - Token, Unique numerical value identifying a group.
   - Position, Identifies this device connection point’s position
                 in the group (i.e. 1st, 2nd).

BUG=b:216490477
TEST=emerge-brya coreboot

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I245b17019b6d3c5e380c16cb3c9f4edc4dd10cc6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61801
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
This commit is contained in:
Subrata Banik 2022-02-10 16:17:48 +05:30 committed by Felix Held
parent cb6e4926e7
commit b832955161
1 changed files with 27 additions and 0 deletions

View File

@ -68,6 +68,33 @@ enum acpi_pld_rotate {
.position = __position, \
}
/*
* ACPI specification 6.3 third paragraph of section 6.1.8:
* All Panel references (Top, Bottom, Right, Left, etc.) are interpreted
* as though the user is facing the front of the system.
*
* A `_PLD` describes the offset and rotation of a single device connection point
* from an `origin` that resides in the lower left hand corner of its Panel.
*/
#define ACPI_PLD_TYPE_A(__panel, __horiz, __grp) \
{ \
.visible = true, \
.panel = PLD_PANEL_##__panel, \
.shape = PLD_SHAPE_HORIZONTAL_RECTANGLE, \
.horizontal_position = PLD_HORIZONTAL_POSITION_##__horiz, \
.group = __grp, \
}
#define ACPI_PLD_TYPE_C(__panel, __horiz, __grp) \
{ \
.visible = true, \
.panel = PLD_PANEL_##__panel, \
.shape = PLD_SHAPE_OVAL, \
.horizontal_position = PLD_HORIZONTAL_POSITION_##__horiz, \
.group = __grp, \
}
struct acpi_pld_group {
uint8_t token;
uint8_t position;