aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/pmc_mux
diff options
context:
space:
mode:
authorDeepti Deshatty <deepti.deshatty@intel.com>2021-05-20 21:01:52 +0530
committerPatrick Georgi <pgeorgi@google.com>2021-06-04 12:36:07 +0000
commitc146daf8a3241026c8c8906add2b5ae37cc76427 (patch)
treedea56397963aa97bc0db20d8339528ec353ae0ae /src/drivers/intel/pmc_mux
parent7014efd8cfb1c496354cc991bbb9443e882d5d82 (diff)
intel/common/block: Move mainboard api to tcss common block
As per the comments in CB:54090 mainboard api mainboard_tcss_get_port_info() is simplified and moved to tcss common block code. Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.com> Change-Id: I7894363df4862f7cfe733d93e6160677fb8a9e31 Reviewed-on: https://review.coreboot.org/c/coreboot/+/54733 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Diffstat (limited to 'src/drivers/intel/pmc_mux')
-rw-r--r--src/drivers/intel/pmc_mux/conn/chip.h8
-rw-r--r--src/drivers/intel/pmc_mux/conn/conn.c15
2 files changed, 23 insertions, 0 deletions
diff --git a/src/drivers/intel/pmc_mux/conn/chip.h b/src/drivers/intel/pmc_mux/conn/chip.h
index 8497350337..461916ed98 100644
--- a/src/drivers/intel/pmc_mux/conn/chip.h
+++ b/src/drivers/intel/pmc_mux/conn/chip.h
@@ -23,4 +23,12 @@ struct drivers_intel_pmc_mux_conn_config {
enum typec_orientation hsl_orientation;
};
+/*
+ * Method verifies input "conn" device.
+ * Returns 'true' if device passed is Intel PMC MUX Conn device else returns 'false'.
+ * Method also outputs the usb2 and usb3 port numbers associated with the 'conn' device
+ */
+bool intel_pmc_mux_conn_get_ports(const struct device *conn, unsigned int *usb2_port,
+ unsigned int *usb3_port);
+
#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
index 9fd85431f3..b6bf371471 100644
--- a/src/drivers/intel/pmc_mux/conn/conn.c
+++ b/src/drivers/intel/pmc_mux/conn/conn.c
@@ -85,3 +85,18 @@ struct chip_operations drivers_intel_pmc_mux_conn_ops = {
CHIP_NAME("Intel PMC MUX CONN Driver")
.enable_dev = conn_enable,
};
+
+bool intel_pmc_mux_conn_get_ports(const struct device *conn, unsigned int *usb2_port,
+ unsigned int *usb3_port)
+{
+ const struct drivers_intel_pmc_mux_conn_config *mux_config;
+
+ if (!conn->chip_info || conn->chip_ops != &drivers_intel_pmc_mux_conn_ops)
+ return false;
+
+ mux_config = conn->chip_info;
+ *usb2_port = mux_config->usb2_port_number;
+ *usb3_port = mux_config->usb3_port_number;
+
+ return true;
+};