aboutsummaryrefslogtreecommitdiff
path: root/src/include/acpi/acpi_pld.h
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-02-10 16:17:48 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-02-18 14:53:49 +0000
commitb832955161e978e7587e36feb01de354d5d14d6f (patch)
tree473863a797172c53d86a7fb7817859a91db32cd2 /src/include/acpi/acpi_pld.h
parentcb6e4926e78dda8b09eef5fc7371942f0bccc1fb (diff)
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>
Diffstat (limited to 'src/include/acpi/acpi_pld.h')
-rw-r--r--src/include/acpi/acpi_pld.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/acpi/acpi_pld.h b/src/include/acpi/acpi_pld.h
index 5a7663c177..f89a68054e 100644
--- a/src/include/acpi/acpi_pld.h
+++ b/src/include/acpi/acpi_pld.h
@@ -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;