From e414ce45325d05dbdcc6b9b89b3703371a7d3411 Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Fri, 3 Jul 2020 09:36:11 -0600 Subject: drivers/intel/pmc_mux: Rename con driver to conn For historical reasons, Windows has issues with certain names being used for files and directories, 'con' or 'CON' being one of them. Therefore, rename the pmc_mux/con driver to pmc_mux/conn in order to work around this issue. TEST=built volteer (only user of this driver as of now) Signed-off-by: Tim Wawrzynczak Change-Id: Ia78dc4efe647c96a7169a3b95fc3b8944d052c83 Reviewed-on: https://review.coreboot.org/c/coreboot/+/43090 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Caveh Jalali --- src/drivers/intel/pmc_mux/Makefile.inc | 2 +- src/drivers/intel/pmc_mux/con/Makefile.inc | 1 - src/drivers/intel/pmc_mux/con/chip.h | 26 ------- src/drivers/intel/pmc_mux/con/con.c | 90 ---------------------- src/drivers/intel/pmc_mux/conn/Makefile.inc | 1 + src/drivers/intel/pmc_mux/conn/chip.h | 26 +++++++ src/drivers/intel/pmc_mux/conn/conn.c | 90 ++++++++++++++++++++++ src/ec/google/chromeec/ec_acpi.c | 22 +++--- .../volteer/variants/volteer/overridetree.cb | 4 +- .../volteer/variants/volteer2/overridetree.cb | 4 +- 10 files changed, 133 insertions(+), 133 deletions(-) delete mode 100644 src/drivers/intel/pmc_mux/con/Makefile.inc delete mode 100644 src/drivers/intel/pmc_mux/con/chip.h delete mode 100644 src/drivers/intel/pmc_mux/con/con.c create mode 100644 src/drivers/intel/pmc_mux/conn/Makefile.inc create mode 100644 src/drivers/intel/pmc_mux/conn/chip.h create mode 100644 src/drivers/intel/pmc_mux/conn/conn.c (limited to 'src') diff --git a/src/drivers/intel/pmc_mux/Makefile.inc b/src/drivers/intel/pmc_mux/Makefile.inc index f27f01444b..61c957e514 100644 --- a/src/drivers/intel/pmc_mux/Makefile.inc +++ b/src/drivers/intel/pmc_mux/Makefile.inc @@ -1,2 +1,2 @@ -subdirs-y += con +subdirs-y += conn ramstage-$(CONFIG_DRIVERS_INTEL_PMC) += mux.c diff --git a/src/drivers/intel/pmc_mux/con/Makefile.inc b/src/drivers/intel/pmc_mux/con/Makefile.inc deleted file mode 100644 index 213e8fc7ec..0000000000 --- a/src/drivers/intel/pmc_mux/con/Makefile.inc +++ /dev/null @@ -1 +0,0 @@ -ramstage-$(CONFIG_DRIVERS_INTEL_PMC) += con.c diff --git a/src/drivers/intel/pmc_mux/con/chip.h b/src/drivers/intel/pmc_mux/con/chip.h deleted file mode 100644 index 02d018a2e9..0000000000 --- a/src/drivers/intel/pmc_mux/con/chip.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#ifndef __DRIVERS_INTEL_PMC_MUX_CON_H__ -#define __DRIVERS_INTEL_PMC_MUX_CON_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, -}; - -struct drivers_intel_pmc_mux_con_config { - /* 1-based port numbers (from SoC point of view) */ - int usb2_port_number; - /* 1-based port numbers (from SoC point of view) */ - int usb3_port_number; - /* Orientation of the sideband signals (SBU) */ - enum typec_orientation sbu_orientation; - /* Orientation of the High Speed lines */ - enum typec_orientation hsl_orientation; -}; - -#endif /* __DRIVERS_INTEL_PMC_MUX_CON_H__ */ diff --git a/src/drivers/intel/pmc_mux/con/con.c b/src/drivers/intel/pmc_mux/con/con.c deleted file mode 100644 index ad95905a9f..0000000000 --- a/src/drivers/intel/pmc_mux/con/con.c +++ /dev/null @@ -1,90 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#include -#include -#include -#include "chip.h" - -static const char *con_acpi_name(const struct device *dev) -{ - static char name[5]; - snprintf(name, sizeof(name), "CON%1X", dev->path.generic.id); - return name; -} - -static const char *orientation_to_str(enum typec_orientation ori) -{ - switch (ori) { - case TYPEC_ORIENTATION_NORMAL: - return "normal"; - case TYPEC_ORIENTATION_REVERSE: - return "reverse"; - case TYPEC_ORIENTATION_FOLLOW_CC: /* Intentional fallthrough */ - default: - return ""; - } -} - -static void con_fill_ssdt(const struct device *dev) -{ - struct drivers_intel_pmc_mux_con_config *config = dev->chip_info; - struct acpi_dp *dsd; - const char *scope; - const char *name; - - if (!dev->enabled) - return; - - /* Reference the existing scope and write CONx device */ - scope = acpi_device_scope(dev); - name = acpi_device_name(dev); - if (!scope || !name) - return; - - acpigen_write_scope(scope); - acpigen_write_device(name); - - acpigen_write_name_integer("_ADR", dev->path.generic.id); - - /* _DSD, Device-Specific Data */ - dsd = acpi_dp_new_table("_DSD"); - acpi_dp_add_integer(dsd, "usb2-port-number", config->usb2_port_number); - acpi_dp_add_integer(dsd, "usb3-port-number", config->usb3_port_number); - - /* - * 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) - acpi_dp_add_string(dsd, "sbu-orientation", - orientation_to_str(config->sbu_orientation)); - - if (config->hsl_orientation != TYPEC_ORIENTATION_FOLLOW_CC) - acpi_dp_add_string(dsd, "hsl-orientation", - orientation_to_str(config->hsl_orientation)); - - acpi_dp_write(dsd); - - acpigen_pop_len(); /* CONx Device */ - acpigen_pop_len(); /* Scope */ - - printk(BIOS_INFO, "%s: %s at %s\n", acpi_device_path(dev), dev->chip_ops->name, - dev_path(dev)); -} - -static struct device_operations con_dev_ops = { - .read_resources = noop_read_resources, - .set_resources = noop_set_resources, - .acpi_name = con_acpi_name, - .acpi_fill_ssdt = con_fill_ssdt, -}; - -static void con_enable(struct device *dev) -{ - dev->ops = &con_dev_ops; -} - -struct chip_operations drivers_intel_pmc_mux_con_ops = { - CHIP_NAME("Intel PMC MUX CON Driver") - .enable_dev = con_enable, -}; diff --git a/src/drivers/intel/pmc_mux/conn/Makefile.inc b/src/drivers/intel/pmc_mux/conn/Makefile.inc new file mode 100644 index 0000000000..babca2f9bb --- /dev/null +++ b/src/drivers/intel/pmc_mux/conn/Makefile.inc @@ -0,0 +1 @@ +ramstage-$(CONFIG_DRIVERS_INTEL_PMC) += conn.c diff --git a/src/drivers/intel/pmc_mux/conn/chip.h b/src/drivers/intel/pmc_mux/conn/chip.h new file mode 100644 index 0000000000..8497350337 --- /dev/null +++ b/src/drivers/intel/pmc_mux/conn/chip.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#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, +}; + +struct drivers_intel_pmc_mux_conn_config { + /* 1-based port numbers (from SoC point of view) */ + int usb2_port_number; + /* 1-based port numbers (from SoC point of view) */ + int usb3_port_number; + /* Orientation of the sideband signals (SBU) */ + enum typec_orientation sbu_orientation; + /* Orientation of the High Speed lines */ + enum typec_orientation hsl_orientation; +}; + +#endif /* __DRIVERS_INTEL_PMC_MUX_CONN_H__ */ diff --git a/src/drivers/intel/pmc_mux/conn/conn.c b/src/drivers/intel/pmc_mux/conn/conn.c new file mode 100644 index 0000000000..16d113bcb1 --- /dev/null +++ b/src/drivers/intel/pmc_mux/conn/conn.c @@ -0,0 +1,90 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include +#include +#include "chip.h" + +static const char *conn_acpi_name(const struct device *dev) +{ + static char name[5]; + snprintf(name, sizeof(name), "CON%1X", dev->path.generic.id); + return name; +} + +static const char *orientation_to_str(enum typec_orientation ori) +{ + switch (ori) { + case TYPEC_ORIENTATION_NORMAL: + return "normal"; + case TYPEC_ORIENTATION_REVERSE: + return "reverse"; + case TYPEC_ORIENTATION_FOLLOW_CC: /* Intentional fallthrough */ + default: + return ""; + } +} + +static void conn_fill_ssdt(const struct device *dev) +{ + struct drivers_intel_pmc_mux_conn_config *config = dev->chip_info; + struct acpi_dp *dsd; + const char *scope; + const char *name; + + if (!dev->enabled) + return; + + /* Reference the existing scope and write CONx device */ + scope = acpi_device_scope(dev); + name = acpi_device_name(dev); + if (!scope || !name) + return; + + acpigen_write_scope(scope); + acpigen_write_device(name); + + acpigen_write_name_integer("_ADR", dev->path.generic.id); + + /* _DSD, Device-Specific Data */ + dsd = acpi_dp_new_table("_DSD"); + acpi_dp_add_integer(dsd, "usb2-port-number", config->usb2_port_number); + acpi_dp_add_integer(dsd, "usb3-port-number", config->usb3_port_number); + + /* + * 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) + acpi_dp_add_string(dsd, "sbu-orientation", + orientation_to_str(config->sbu_orientation)); + + if (config->hsl_orientation != TYPEC_ORIENTATION_FOLLOW_CC) + acpi_dp_add_string(dsd, "hsl-orientation", + orientation_to_str(config->hsl_orientation)); + + acpi_dp_write(dsd); + + acpigen_pop_len(); /* CONx Device */ + acpigen_pop_len(); /* Scope */ + + printk(BIOS_INFO, "%s: %s at %s\n", acpi_device_path(dev), dev->chip_ops->name, + dev_path(dev)); +} + +static struct device_operations conn_dev_ops = { + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, + .acpi_name = conn_acpi_name, + .acpi_fill_ssdt = conn_fill_ssdt, +}; + +static void conn_enable(struct device *dev) +{ + dev->ops = &conn_dev_ops; +} + +struct chip_operations drivers_intel_pmc_mux_conn_ops = { + CHIP_NAME("Intel PMC MUX CONN Driver") + .enable_dev = conn_enable, +}; diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index 8c80382b18..dca52854c5 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -124,17 +124,17 @@ static void add_port_location(struct acpi_dp *dsd, int port_number) port_location_to_str(port_caps.port_location)); } -static int con_id_to_match; +static int conn_id_to_match; /* A callback to match a port's connector for dev_find_matching_device_on_bus */ static bool match_connector(DEVTREE_CONST struct device *dev) { if (CONFIG(DRIVERS_INTEL_PMC)) { - extern struct chip_operations drivers_intel_pmc_mux_con_ops; + extern struct chip_operations drivers_intel_pmc_mux_conn_ops; - return (dev->chip_ops == &drivers_intel_pmc_mux_con_ops && + return (dev->chip_ops == &drivers_intel_pmc_mux_conn_ops && dev->path.type == DEVICE_PATH_GENERIC && - dev->path.generic.id == con_id_to_match); + dev->path.generic.id == conn_id_to_match); } return false; @@ -148,7 +148,7 @@ static void fill_ssdt_typec_device(const struct device *dev) struct device *usb3_port; struct device *usb4_port; const struct device *mux; - const struct device *con; + const struct device *conn; if (google_chromeec_get_num_pd_ports(&num_ports)) return; @@ -165,11 +165,11 @@ static void fill_ssdt_typec_device(const struct device *dev) continue; /* Get the MUX device, and find the matching connector on its bus */ - con = NULL; + conn = NULL; mux = soc_get_pmc_mux_device(i); if (mux) { - con_id_to_match = i; - con = dev_find_matching_device_on_bus(mux->link_list, match_connector); + conn_id_to_match = i; + conn = dev_find_matching_device_on_bus(mux->link_list, match_connector); } usb2_port = NULL; @@ -184,9 +184,9 @@ static void fill_ssdt_typec_device(const struct device *dev) .usb2_port = usb2_port, .usb3_port = usb3_port, .usb4_port = usb4_port, - .orientation_switch = con, - .usb_role_switch = con, - .mode_switch = con, + .orientation_switch = conn, + .usb_role_switch = conn, + .mode_switch = conn, }; acpigen_write_typec_connector(&config, i, add_port_location); diff --git a/src/mainboard/google/volteer/variants/volteer/overridetree.cb b/src/mainboard/google/volteer/variants/volteer/overridetree.cb index 24b869ced9..c32b80e9ec 100644 --- a/src/mainboard/google/volteer/variants/volteer/overridetree.cb +++ b/src/mainboard/google/volteer/variants/volteer/overridetree.cb @@ -145,13 +145,13 @@ chip soc/intel/tigerlake # PMC.MUX device in the ACPI hierarchy. chip drivers/intel/pmc_mux device generic 0 on - chip drivers/intel/pmc_mux/con + chip drivers/intel/pmc_mux/conn register "usb2_port_number" = "9" register "usb3_port_number" = "1" # SBU & HSL follow CC device generic 0 on end end - chip drivers/intel/pmc_mux/con + chip drivers/intel/pmc_mux/conn register "usb2_port_number" = "4" register "usb3_port_number" = "2" # SBU is fixed, HSL follows CC diff --git a/src/mainboard/google/volteer/variants/volteer2/overridetree.cb b/src/mainboard/google/volteer/variants/volteer2/overridetree.cb index 24b869ced9..c32b80e9ec 100644 --- a/src/mainboard/google/volteer/variants/volteer2/overridetree.cb +++ b/src/mainboard/google/volteer/variants/volteer2/overridetree.cb @@ -145,13 +145,13 @@ chip soc/intel/tigerlake # PMC.MUX device in the ACPI hierarchy. chip drivers/intel/pmc_mux device generic 0 on - chip drivers/intel/pmc_mux/con + chip drivers/intel/pmc_mux/conn register "usb2_port_number" = "9" register "usb3_port_number" = "1" # SBU & HSL follow CC device generic 0 on end end - chip drivers/intel/pmc_mux/con + chip drivers/intel/pmc_mux/conn register "usb2_port_number" = "4" register "usb3_port_number" = "2" # SBU is fixed, HSL follows CC -- cgit v1.2.3