Attention is currently required from: Patrick Rudolph. Nick Vaccaro has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58084 )
Change subject: driver/intel/pmc_mux/conn: Move typec_orientation enum to coreboot_tables.h ......................................................................
driver/intel/pmc_mux/conn: Move typec_orientation enum to coreboot_tables.h
Move the locally declared typec_orientation enum from chip.h to coreboot_tables.h.
Change enum typec_orientation name to type_c_orientation for consistency with contents of coreboot_tables.h.
Rename TYPEC_ORIENTATION_FOLLOW_CC to TYPEC_ORIENTATION_NONE.
BUG=b:149830546 TEST="emerge-volteer coreboot" and make sure it compiles successfully.
Change-Id: I24c9177be72b0c9831791aa7d1f7b1236309c9cd Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M payloads/libpayload/include/coreboot_tables.h M src/commonlib/include/commonlib/coreboot_tables.h M src/drivers/intel/pmc_mux/conn/chip.h M src/drivers/intel/pmc_mux/conn/conn.c 4 files changed, 25 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/58084/1
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index a841e03..914cfa5 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -143,6 +143,12 @@ u8 strings[0]; };
+enum type_c_orientation { + TYPEC_ORIENTATION_NONE, + TYPEC_ORIENTATION_NORMAL, + TYPEC_ORIENTATION_REVERSE, +}; + struct type_c_port_info { /* * usb2_port_number and usb3_port_number are expected to be diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index ab8da7b..91da8e0 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -426,7 +426,17 @@ * USB Type-C Port Information * This record contains board-specific type-c port information. * There will be one record per type-C port. + * Orientation fields should be of type enum type_c_orientation. */ +enum type_c_orientation { + /* The orientation of the signal follows the orientation of the CC lines. */ + TYPEC_ORIENTATION_NONE, + /* The orientation of the signal is fixed to follow CC1 */ + TYPEC_ORIENTATION_NORMAL, + /* The orientation of the signal is fixed to follow CC2 */ + TYPEC_ORIENTATION_REVERSE, +}; + struct type_c_port_info { uint8_t usb2_port_number; uint8_t usb3_port_number; diff --git a/src/drivers/intel/pmc_mux/conn/chip.h b/src/drivers/intel/pmc_mux/conn/chip.h index 461916e..96347ae 100644 --- a/src/drivers/intel/pmc_mux/conn/chip.h +++ b/src/drivers/intel/pmc_mux/conn/chip.h @@ -3,14 +3,7 @@ #ifndef __DRIVERS_INTEL_PMC_MUX_CONN_H__ #define __DRIVERS_INTEL_PMC_MUX_CONN_H__
-enum typec_orientation { - /* The orientation of the signal follows the orientation of the CC lines. */ - TYPEC_ORIENTATION_FOLLOW_CC = 0, - /* The orientation of the signal is fixed to follow CC1 */ - TYPEC_ORIENTATION_NORMAL, - /* The orientation of the signal is fixed to follow CC2 */ - TYPEC_ORIENTATION_REVERSE, -}; +#include <boot/coreboot_tables.h>
struct drivers_intel_pmc_mux_conn_config { /* 1-based port numbers (from SoC point of view) */ @@ -18,9 +11,9 @@ /* 1-based port numbers (from SoC point of view) */ int usb3_port_number; /* Orientation of the sideband signals (SBU) */ - enum typec_orientation sbu_orientation; + enum type_c_orientation sbu_orientation; /* Orientation of the High Speed lines */ - enum typec_orientation hsl_orientation; + enum type_c_orientation hsl_orientation; };
/* diff --git a/src/drivers/intel/pmc_mux/conn/conn.c b/src/drivers/intel/pmc_mux/conn/conn.c index b6bf371..7a622c8 100644 --- a/src/drivers/intel/pmc_mux/conn/conn.c +++ b/src/drivers/intel/pmc_mux/conn/conn.c @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */
#include <acpi/acpigen.h> +#include <boot/coreboot_tables.h> #include <console/console.h> #include <intelblocks/acpi.h> + #include "chip.h"
static const char *conn_acpi_name(const struct device *dev) @@ -12,14 +14,14 @@ return name; }
-static const char *orientation_to_str(enum typec_orientation ori) +static const char *orientation_to_str(enum type_c_orientation ori) { switch (ori) { case TYPEC_ORIENTATION_NORMAL: return "normal"; case TYPEC_ORIENTATION_REVERSE: return "reverse"; - case TYPEC_ORIENTATION_FOLLOW_CC: /* Intentional fallthrough */ + case TYPEC_ORIENTATION_NONE: /* Intentional fallthrough */ default: return ""; } @@ -52,11 +54,11 @@ * The kernel assumes that these Type-C signals (SBUs and HSLs) follow the CC lines, * unless they are explicitly called out otherwise. */ - if (config->sbu_orientation != TYPEC_ORIENTATION_FOLLOW_CC) + if (config->sbu_orientation != TYPEC_ORIENTATION_NONE) acpi_dp_add_string(dsd, "sbu-orientation", orientation_to_str(config->sbu_orientation));
- if (config->hsl_orientation != TYPEC_ORIENTATION_FOLLOW_CC) + if (config->hsl_orientation != TYPEC_ORIENTATION_NONE) acpi_dp_add_string(dsd, "hsl-orientation", orientation_to_str(config->hsl_orientation));