ec/google/chromeec: Define ACPI_NOTIFY_CROS_EC_MKBP constant
[coreboot.git] / src / soc / intel / pantherlake / retimer.c
blobd55cd7de3d40ca720b9ef500be72514b03aa4ecb
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <drivers/intel/usb4/retimer/retimer.h>
6 #include <intelblocks/tcss.h>
7 #include <static.h>
9 int retimer_get_index_for_typec(uint8_t typec_port)
11 const struct device *tcss_port_arr[] = {
12 DEV_PTR(tcss_usb3_port0),
13 DEV_PTR(tcss_usb3_port1),
14 DEV_PTR(tcss_usb3_port2),
15 DEV_PTR(tcss_usb3_port3),
18 for (int i = 0, ec_port = 0; i < MAX_TYPE_C_PORTS; i++) {
19 if (i == typec_port) {
20 printk(BIOS_INFO, "USB Type-C %d mapped to EC port %d\n", typec_port,
21 ec_port);
22 return ec_port;
25 if (is_dev_enabled(tcss_port_arr[i]))
26 ec_port++;
29 /* Code should not come here if typec_port input is correct */
30 return -1;