summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@google.com>2019-10-02 14:27:47 -0600
committerCommit Bot <commit-bot@chromium.org>2019-11-01 18:43:42 +0000
commit9577704f30c7e824c0590264df22d95a2c706575 (patch)
tree566b5beeeae8b343803718101ba0b00c940506cb /baseboard
parente8121e83e478fef2d5a29304be900311f3f020c4 (diff)
downloadchrome-ec-9577704f30c7e824c0590264df22d95a2c706575.tar.gz
Rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNT
Certain SKUs of certain boards have lesser number of USB PD ports than defined by CONFIG_USB_PD_PORT_COUNT. Hence rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNT. BUG=b:140816510, b:143196487 BRANCH=octopus TEST=make -j buildall; Boot to ChromeOS Change-Id: I7c33b27150730a1a3b5813b7b4a72fd24ab73c6a Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879337 Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/dragonegg/baseboard.c10
-rw-r--r--baseboard/dragonegg/baseboard.h2
-rw-r--r--baseboard/dragonegg/usb_pd_policy.c4
-rw-r--r--baseboard/grunt/baseboard.c8
-rw-r--r--baseboard/grunt/baseboard.h2
-rw-r--r--baseboard/grunt/usb_pd_policy.c6
-rw-r--r--baseboard/hatch/baseboard.c6
-rw-r--r--baseboard/hatch/baseboard.h2
-rw-r--r--baseboard/hatch/usb_pd_policy.c4
-rw-r--r--baseboard/intelrvp/bc12.c4
-rw-r--r--baseboard/intelrvp/chg_usb_pd.c4
-rw-r--r--baseboard/intelrvp/ite_ec.c4
-rw-r--r--baseboard/intelrvp/retimer.c4
-rw-r--r--baseboard/intelrvp/usb_mux.c4
-rw-r--r--baseboard/intelrvp/usb_pd_policy.c4
-rw-r--r--baseboard/kalista/baseboard.c6
-rw-r--r--baseboard/kalista/baseboard.h2
-rw-r--r--baseboard/kalista/usb_pd_policy.c4
-rw-r--r--baseboard/kukui/baseboard.h2
-rw-r--r--baseboard/kukui/usb_pd_policy.c6
-rw-r--r--baseboard/octopus/baseboard.c8
-rw-r--r--baseboard/octopus/baseboard.h2
-rw-r--r--baseboard/octopus/usb_pd_policy.c4
-rw-r--r--baseboard/octopus/variant_usbc_ec_tcpcs.c6
-rw-r--r--baseboard/octopus/variant_usbc_standalone_tcpcs.c6
-rw-r--r--baseboard/zork/baseboard.c4
-rw-r--r--baseboard/zork/baseboard.h2
-rw-r--r--baseboard/zork/usb_pd_policy.c6
28 files changed, 63 insertions, 63 deletions
diff --git a/baseboard/dragonegg/baseboard.c b/baseboard/dragonegg/baseboard.c
index 36f054c376..7414421c15 100644
--- a/baseboard/dragonegg/baseboard.c
+++ b/baseboard/dragonegg/baseboard.c
@@ -137,7 +137,7 @@ void board_hibernate(void)
}
/******************************************************************************/
/* USB-C TPCP Configuration */
-const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_ITE_0] = {
.bus_type = EC_BUS_TYPE_EMBEDDED,
/* TCPC is embedded within EC so no i2c config needed */
@@ -168,7 +168,7 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
/******************************************************************************/
/* USB-C PPC Configuration */
-struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = {
+struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_ITE_0] = {
.i2c_port = I2C_PORT_USBC0,
.i2c_addr_flags = SN5S330_ADDR0_FLAGS,
@@ -189,7 +189,7 @@ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = {
};
unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
+struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_ITE_0] = {
.driver = &virtual_usb_mux_driver,
.hpd_update = &virtual_hpd_update,
@@ -209,7 +209,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
/******************************************************************************/
/* BC 1.2 chip Configuration */
-const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
.chip_enable_pin = GPIO_USB_C0_BC12_VBUS_ON_ODL,
.chg_det_pin = GPIO_USB_C0_BC12_CHG_MAX,
@@ -284,7 +284,7 @@ void board_pd_vconn_ctrl(int port, enum usbpd_cc_pin cc_pin, int enabled)
int board_set_active_charge_port(int port)
{
int is_valid_port = (port >= 0 &&
- port < CONFIG_USB_PD_PORT_COUNT);
+ port < CONFIG_USB_PD_PORT_MAX_COUNT);
int i;
if (!is_valid_port && port != CHARGE_PORT_NONE)
diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h
index 9046d4e5c3..e34f5d11c3 100644
--- a/baseboard/dragonegg/baseboard.h
+++ b/baseboard/dragonegg/baseboard.h
@@ -86,7 +86,7 @@
* on the MLB for now. In addition, this config option will likely move to
* board.h as it likely board dependent and not same across all follower boards.
*/
-#define CONFIG_USB_PD_PORT_COUNT 3
+#define CONFIG_USB_PD_PORT_MAX_COUNT 3
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_LOGGING
diff --git a/baseboard/dragonegg/usb_pd_policy.c b/baseboard/dragonegg/usb_pd_policy.c
index 37a9b51dc9..cf9d3c4885 100644
--- a/baseboard/dragonegg/usb_pd_policy.c
+++ b/baseboard/dragonegg/usb_pd_policy.c
@@ -277,8 +277,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
}
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
static void svdm_safe_dp_mode(int port)
{
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c
index 02641f9e66..977b4fc6ed 100644
--- a/baseboard/grunt/baseboard.c
+++ b/baseboard/grunt/baseboard.c
@@ -78,7 +78,7 @@ const struct power_signal_info power_signal_list[] = {
};
BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
-const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
#ifdef VARIANT_GRUNT_TCPC_0_ANX3429
[USB_PD_PORT_ANX74XX] = {
.bus_type = EC_BUS_TYPE_I2C,
@@ -156,7 +156,7 @@ void board_tcpc_init(void)
* Initialize HPD to low; after sysjump SOC needs to see
* HPD pulse to enable video path
*/
- for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) {
+ for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) {
const struct usb_mux *mux = &usb_muxes[port];
mux->hpd_update(port, 0, 0);
@@ -288,7 +288,7 @@ static int ps8751_tune_mux(int port)
return EC_SUCCESS;
}
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
+struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
#ifdef VARIANT_GRUNT_TCPC_0_ANX3429
[USB_PD_PORT_ANX74XX] = {
.driver = &anx74xx_tcpm_usb_mux_driver,
@@ -349,7 +349,7 @@ void board_overcurrent_event(int port, int is_overcurrented)
}
/* BC 1.2 chip Configuration */
-const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_ANX74XX] = {
.chip_enable_pin = GPIO_USB_C0_BC12_VBUS_ON_L,
.chg_det_pin = GPIO_USB_C0_BC12_CHG_DET,
diff --git a/baseboard/grunt/baseboard.h b/baseboard/grunt/baseboard.h
index 65fbf57383..7a2504dcfe 100644
--- a/baseboard/grunt/baseboard.h
+++ b/baseboard/grunt/baseboard.h
@@ -117,7 +117,7 @@
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
#define CONFIG_USB_PD_LOGGING
-#define CONFIG_USB_PD_PORT_COUNT 2
+#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_PD_TCPC_LOW_POWER
#ifdef VARIANT_GRUNT_TCPC_0_ANX3429
#define CONFIG_USB_PD_TCPM_ANX3429
diff --git a/baseboard/grunt/usb_pd_policy.c b/baseboard/grunt/usb_pd_policy.c
index c24dc92942..9b3cfc647e 100644
--- a/baseboard/grunt/usb_pd_policy.c
+++ b/baseboard/grunt/usb_pd_policy.c
@@ -235,8 +235,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
}
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
static int svdm_enter_dp_mode(int port, uint32_t mode_caps)
{
@@ -316,7 +316,7 @@ static int svdm_dp_config(int port, uint32_t *payload)
* timestamp of the next possible toggle to ensure the 2-ms spacing
* between IRQ_HPD.
*/
-static uint64_t hpd_deadline[CONFIG_USB_PD_PORT_COUNT];
+static uint64_t hpd_deadline[CONFIG_USB_PD_PORT_MAX_COUNT];
#define PORT_TO_HPD(port) ((port) ? GPIO_USB_C1_DP_HPD : GPIO_USB_C0_DP_HPD)
static void svdm_dp_post_config(int port)
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c
index b495c539fb..209dbb9bf7 100644
--- a/baseboard/hatch/baseboard.c
+++ b/baseboard/hatch/baseboard.c
@@ -142,7 +142,7 @@ void board_hibernate(void)
* if it is later connected to ensure that AC_PRESENT
* will wake up the EC from this state
*/
- for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; ++port)
+ for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; ++port)
ppc_vbus_sink_enable(port, 1);
/*
@@ -155,7 +155,7 @@ void board_hibernate(void)
/******************************************************************************/
/* USB-C PPC Configuration */
-struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = {
+struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_TCPC_0] = {
.i2c_port = I2C_PORT_PPC0,
.i2c_addr_flags = SN5S330_ADDR0_FLAGS,
@@ -254,7 +254,7 @@ void board_reset_pd_mcu(void)
int board_set_active_charge_port(int port)
{
int is_valid_port = (port >= 0 &&
- port < CONFIG_USB_PD_PORT_COUNT);
+ port < CONFIG_USB_PD_PORT_MAX_COUNT);
int i;
if (!is_valid_port && port != CHARGE_PORT_NONE)
diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h
index 2b8b94ca00..ffe104c7bf 100644
--- a/baseboard/hatch/baseboard.h
+++ b/baseboard/hatch/baseboard.h
@@ -116,7 +116,7 @@
/* USB Type C and USB PD defines */
#define CONFIG_USB_POWER_DELIVERY
-#define CONFIG_USB_PD_PORT_COUNT 2
+#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
diff --git a/baseboard/hatch/usb_pd_policy.c b/baseboard/hatch/usb_pd_policy.c
index 46ca0a84c3..0477edb499 100644
--- a/baseboard/hatch/usb_pd_policy.c
+++ b/baseboard/hatch/usb_pd_policy.c
@@ -252,8 +252,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
}
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
static void svdm_safe_dp_mode(int port)
{
diff --git a/baseboard/intelrvp/bc12.c b/baseboard/intelrvp/bc12.c
index 4f1d1808cc..5a5807a325 100644
--- a/baseboard/intelrvp/bc12.c
+++ b/baseboard/intelrvp/bc12.c
@@ -10,7 +10,7 @@
/* BC1.2 chip Configuration */
#ifdef CONFIG_BC12_DETECT_MAX14637
-const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[TYPE_C_PORT_0] = {
.chip_enable_pin = GPIO_USB_C0_BC12_VBUS_ON_ODL,
.chg_det_pin = GPIO_USB_C0_BC12_CHG_DET_L,
@@ -24,5 +24,5 @@ const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_COUNT] = {
},
#endif /* HAS_TASK_PD_C1 */
};
-BUILD_ASSERT(ARRAY_SIZE(max14637_config) == CONFIG_USB_PD_PORT_COUNT);
+BUILD_ASSERT(ARRAY_SIZE(max14637_config) == CONFIG_USB_PD_PORT_MAX_COUNT);
#endif /* CONFIG_BC12_DETECT_MAX14637 */
diff --git a/baseboard/intelrvp/chg_usb_pd.c b/baseboard/intelrvp/chg_usb_pd.c
index 86360caeae..7c8834806a 100644
--- a/baseboard/intelrvp/chg_usb_pd.c
+++ b/baseboard/intelrvp/chg_usb_pd.c
@@ -93,7 +93,7 @@ void board_tcpc_init(void)
board_reset_pd_mcu();
/* Enable TCPCx interrupt */
- for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; i++)
+ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++)
gpio_enable_interrupt(tcpc_gpios[i].vbus.pin);
}
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C + 1);
@@ -170,7 +170,7 @@ int board_set_active_charge_port(int port)
}
/* Make sure non-charging ports are disabled */
- for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; i++) {
+ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) {
if (i == port)
continue;
diff --git a/baseboard/intelrvp/ite_ec.c b/baseboard/intelrvp/ite_ec.c
index b5a3547269..2faa17ad08 100644
--- a/baseboard/intelrvp/ite_ec.c
+++ b/baseboard/intelrvp/ite_ec.c
@@ -14,7 +14,7 @@
#include "usb_pd_tcpm.h"
/* USB-C TPCP Configuration */
-const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[TYPE_C_PORT_0] = {
.bus_type = EC_BUS_TYPE_EMBEDDED,
/* TCPC is embedded within EC so no i2c config needed */
@@ -34,7 +34,7 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
},
#endif /* HAS_TASK_PD_C1 */
};
-BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_COUNT);
+BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_MAX_COUNT);
/* Reset PD MCU */
void board_reset_pd_mcu(void)
diff --git a/baseboard/intelrvp/retimer.c b/baseboard/intelrvp/retimer.c
index 54c350017e..4ab6785d6f 100644
--- a/baseboard/intelrvp/retimer.c
+++ b/baseboard/intelrvp/retimer.c
@@ -11,7 +11,7 @@
/* USB Retimers configuration */
#ifdef CONFIG_USB_PD_RETIMER_INTEL_BB
-struct bb_retimer bb_retimers[CONFIG_USB_PD_PORT_COUNT] = {
+struct bb_retimer bb_retimers[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[TYPE_C_PORT_0] = {
.i2c_port = I2C_PORT0_BB_RETIMER,
.i2c_addr = I2C_PORT0_BB_RETIMER_ADDR,
@@ -31,5 +31,5 @@ struct bb_retimer bb_retimers[CONFIG_USB_PD_PORT_COUNT] = {
},
#endif /* HAS_TASK_PD_C1 */
};
-BUILD_ASSERT(ARRAY_SIZE(bb_retimers) == CONFIG_USB_PD_PORT_COUNT);
+BUILD_ASSERT(ARRAY_SIZE(bb_retimers) == CONFIG_USB_PD_PORT_MAX_COUNT);
#endif /* CONFIG_USB_PD_RETIMER_INTEL_BB */
diff --git a/baseboard/intelrvp/usb_mux.c b/baseboard/intelrvp/usb_mux.c
index e4e45de188..2526fa5450 100644
--- a/baseboard/intelrvp/usb_mux.c
+++ b/baseboard/intelrvp/usb_mux.c
@@ -10,7 +10,7 @@
/* USB muxes Configuration */
#ifdef CONFIG_USB_MUX_VIRTUAL
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
+struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[TYPE_C_PORT_0] = {
.driver = &virtual_usb_mux_driver,
.hpd_update = &virtual_hpd_update,
@@ -22,5 +22,5 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
},
#endif /* HAS_TASK_PD_C1 */
};
-BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == CONFIG_USB_PD_PORT_COUNT);
+BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == CONFIG_USB_PD_PORT_MAX_COUNT);
#endif /* CONFIG_USB_MUX_VIRTUAL */
diff --git a/baseboard/intelrvp/usb_pd_policy.c b/baseboard/intelrvp/usb_pd_policy.c
index dff7a89e46..db03f227b0 100644
--- a/baseboard/intelrvp/usb_pd_policy.c
+++ b/baseboard/intelrvp/usb_pd_policy.c
@@ -213,8 +213,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
}
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
static void svdm_safe_dp_mode(int port)
{
diff --git a/baseboard/kalista/baseboard.c b/baseboard/kalista/baseboard.c
index c3c2fa4970..b466517496 100644
--- a/baseboard/kalista/baseboard.c
+++ b/baseboard/kalista/baseboard.c
@@ -138,7 +138,7 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
/* TCPC mux configuration */
-const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
/* Alert is active-low, push-pull */
{
.bus_type = EC_BUS_TYPE_I2C,
@@ -157,7 +157,7 @@ static int ps8751_tune_mux(int port)
return EC_SUCCESS;
}
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
+struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
.driver = &tcpci_tcpm_usb_mux_driver,
.hpd_update = &ps8xxx_tcpc_update_hpd_status,
@@ -202,7 +202,7 @@ void board_tcpc_init(void)
* Initialize HPD to low; after sysjump SOC needs to see
* HPD pulse to enable video path
*/
- for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) {
+ for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) {
const struct usb_mux *mux = &usb_muxes[port];
mux->hpd_update(port, 0, 0);
}
diff --git a/baseboard/kalista/baseboard.h b/baseboard/kalista/baseboard.h
index 751a1ae8a9..7f576cdb4f 100644
--- a/baseboard/kalista/baseboard.h
+++ b/baseboard/kalista/baseboard.h
@@ -89,7 +89,7 @@
#define CONFIG_USB_PD_ALT_MODE_DFP
#define CONFIG_USB_PD_DISCHARGE_TCPC
#define CONFIG_USB_PD_LOGGING
-#define CONFIG_USB_PD_PORT_COUNT 1
+#define CONFIG_USB_PD_PORT_MAX_COUNT 1
#define CONFIG_USB_PD_VBUS_DETECT_GPIO
#define CONFIG_USB_PD_TCPM_MUX
#define CONFIG_USB_PD_TCPM_TCPCI
diff --git a/baseboard/kalista/usb_pd_policy.c b/baseboard/kalista/usb_pd_policy.c
index 107543a82a..ad40a95436 100644
--- a/baseboard/kalista/usb_pd_policy.c
+++ b/baseboard/kalista/usb_pd_policy.c
@@ -168,8 +168,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
return 0;
}
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
static void svdm_safe_dp_mode(int port)
{
diff --git a/baseboard/kukui/baseboard.h b/baseboard/kukui/baseboard.h
index 4b6467462c..2a1e5d43b0 100644
--- a/baseboard/kukui/baseboard.h
+++ b/baseboard/kukui/baseboard.h
@@ -174,7 +174,7 @@
#define CONFIG_USB_PD_ALT_MODE_DFP
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_LOGGING
-#define CONFIG_USB_PD_PORT_COUNT 1
+#define CONFIG_USB_PD_PORT_MAX_COUNT 1
#define CONFIG_USB_PD_TCPM_TCPCI
#define CONFIG_USB_PD_VBUS_DETECT_TCPC
#define CONFIG_USB_PD_5V_EN_CUSTOM
diff --git a/baseboard/kukui/usb_pd_policy.c b/baseboard/kukui/usb_pd_policy.c
index 3258aef847..260cff54cc 100644
--- a/baseboard/kukui/usb_pd_policy.c
+++ b/baseboard/kukui/usb_pd_policy.c
@@ -236,9 +236,9 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
}
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
/* DP Status VDM as returned by UFP */
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
__overridable int board_has_virtual_mux(void)
{
@@ -326,7 +326,7 @@ static int svdm_dp_config(int port, uint32_t *payload)
* timestamp of the next possible toggle to ensure the 2-ms spacing
* between IRQ_HPD.
*/
-static uint64_t hpd_deadline[CONFIG_USB_PD_PORT_COUNT];
+static uint64_t hpd_deadline[CONFIG_USB_PD_PORT_MAX_COUNT];
static void svdm_dp_post_config(int port)
{
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c
index 9bf8347756..f263f4a97e 100644
--- a/baseboard/octopus/baseboard.c
+++ b/baseboard/octopus/baseboard.c
@@ -64,7 +64,7 @@ const int usb_port_enable[USB_PORT_COUNT] = {
/******************************************************************************/
/* BC 1.2 chip Configuration */
-const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
.chip_enable_pin = GPIO_USB_C0_BC12_VBUS_ON,
.chg_det_pin = GPIO_USB_C0_BC12_CHG_DET_L,
@@ -211,7 +211,7 @@ void baseboard_tcpc_init(void)
* Initialize HPD to low; after sysjump SOC needs to see
* HPD pulse to enable video path
*/
- for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) {
+ for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) {
const struct usb_mux *mux = &usb_muxes[port];
mux->hpd_update(port, 0, 0);
@@ -223,7 +223,7 @@ DECLARE_HOOK(HOOK_INIT, baseboard_tcpc_init, HOOK_PRIO_INIT_I2C + 2);
int board_set_active_charge_port(int port)
{
int is_valid_port = (port >= 0 &&
- port < CONFIG_USB_PD_PORT_COUNT);
+ port < CONFIG_USB_PD_PORT_MAX_COUNT);
int i;
if (!is_valid_port && port != CHARGE_PORT_NONE)
@@ -329,7 +329,7 @@ void board_hibernate(void)
* low power mode or open the SNK FET based on which signals wake up
* the EC from hibernate.
*/
- for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) {
+ for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) {
if (!pd_is_vbus_present(port)) {
#ifdef VARIANT_OCTOPUS_EC_ITE8320
/*
diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h
index 83e708715d..4001c2bb2d 100644
--- a/baseboard/octopus/baseboard.h
+++ b/baseboard/octopus/baseboard.h
@@ -184,7 +184,7 @@
/* Common USB-C defines */
#define CONFIG_USB_POWER_DELIVERY
-#define CONFIG_USB_PD_PORT_COUNT 2
+#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_ALT_MODE
diff --git a/baseboard/octopus/usb_pd_policy.c b/baseboard/octopus/usb_pd_policy.c
index 0f4bc06440..1dccc424d6 100644
--- a/baseboard/octopus/usb_pd_policy.c
+++ b/baseboard/octopus/usb_pd_policy.c
@@ -254,8 +254,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
}
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
static void svdm_safe_dp_mode(int port)
{
diff --git a/baseboard/octopus/variant_usbc_ec_tcpcs.c b/baseboard/octopus/variant_usbc_ec_tcpcs.c
index cd119acc80..a247ef6452 100644
--- a/baseboard/octopus/variant_usbc_ec_tcpcs.c
+++ b/baseboard/octopus/variant_usbc_ec_tcpcs.c
@@ -27,7 +27,7 @@
/******************************************************************************/
/* USB-C TPCP Configuration */
-const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_ITE_0] = {
.bus_type = EC_BUS_TYPE_EMBEDDED,
/* TCPC is embedded within EC so no i2c config needed */
@@ -65,7 +65,7 @@ static void board_it83xx_hpd_status(int port, int hpd_lvl, int hpd_irq)
}
/* This configuration might be override by each boards */
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
+struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_ITE_0] = {
/* Driver uses I2C_PORT_USB_MUX as I2C port */
.port_addr = IT5205_I2C_ADDR1_FLAGS,
@@ -84,7 +84,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
/******************************************************************************/
/* USB-C PPC Configuration */
-struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = {
+struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_ITE_0] = {
.i2c_port = I2C_PORT_USBC0,
.i2c_addr_flags = SN5S330_ADDR0_FLAGS,
diff --git a/baseboard/octopus/variant_usbc_standalone_tcpcs.c b/baseboard/octopus/variant_usbc_standalone_tcpcs.c
index 567d26341a..41025de7fa 100644
--- a/baseboard/octopus/variant_usbc_standalone_tcpcs.c
+++ b/baseboard/octopus/variant_usbc_standalone_tcpcs.c
@@ -29,7 +29,7 @@
/******************************************************************************/
/* USB-C TPCP Configuration */
-const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
+const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_TCPC_0] = {
#if defined(VARIANT_OCTOPUS_TCPC_0_PS8751)
.bus_type = EC_BUS_TYPE_I2C,
@@ -69,7 +69,7 @@ static int ps8751_tune_mux(int port)
}
#endif
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
+struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_TCPC_0] = {
#if defined(VARIANT_OCTOPUS_TCPC_0_PS8751)
.driver = &tcpci_tcpm_usb_mux_driver,
@@ -88,7 +88,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
/******************************************************************************/
/* USB-C PPC Configuration */
-struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = {
+struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_TCPC_0] = {
.i2c_port = I2C_PORT_TCPC0,
.i2c_addr_flags = NX20P3483_ADDR2_FLAGS,
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c
index 2bbf4cc1bb..44f23a4938 100644
--- a/baseboard/zork/baseboard.c
+++ b/baseboard/zork/baseboard.c
@@ -244,7 +244,7 @@ void ppc_interrupt(enum gpio_signal signal)
int board_set_active_charge_port(int port)
{
int is_valid_port = (port >= 0 &&
- port < CONFIG_USB_PD_PORT_COUNT);
+ port < CONFIG_USB_PD_PORT_MAX_COUNT);
int i;
if (port == CHARGE_PORT_NONE) {
@@ -314,7 +314,7 @@ const struct tcpc_config_t tcpc_config[] = {
},
};
BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == USBC_PORT_COUNT);
-BUILD_ASSERT(CONFIG_USB_PD_PORT_COUNT == USBC_PORT_COUNT);
+BUILD_ASSERT(CONFIG_USB_PD_PORT_MAX_COUNT == USBC_PORT_COUNT);
const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
[USBC_PORT_C0] = {
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h
index 66d12bb316..b0070e86f3 100644
--- a/baseboard/zork/baseboard.h
+++ b/baseboard/zork/baseboard.h
@@ -125,7 +125,7 @@
#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
-#define CONFIG_USB_PD_PORT_COUNT 2
+#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_TCPM_MUX
#define CONFIG_USB_PD_TCPM_NCT38XX
diff --git a/baseboard/zork/usb_pd_policy.c b/baseboard/zork/usb_pd_policy.c
index 48b9101c01..9c61a020db 100644
--- a/baseboard/zork/usb_pd_policy.c
+++ b/baseboard/zork/usb_pd_policy.c
@@ -252,8 +252,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
}
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static int dp_flags[CONFIG_USB_PD_PORT_COUNT];
-static uint32_t dp_status[CONFIG_USB_PD_PORT_COUNT];
+static int dp_flags[CONFIG_USB_PD_PORT_MAX_COUNT];
+static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT];
static int svdm_enter_dp_mode(int port, uint32_t mode_caps)
{
@@ -348,7 +348,7 @@ static int svdm_dp_config(int port, uint32_t *payload)
* timestamp of the next possible toggle to ensure the 2-ms spacing
* between IRQ_HPD.
*/
-static uint64_t hpd_deadline[CONFIG_USB_PD_PORT_COUNT];
+static uint64_t hpd_deadline[CONFIG_USB_PD_PORT_MAX_COUNT];
#define PORT_TO_HPD(port) ((port) ? GPIO_DP2_HPD : GPIO_USB_C0_HPD)
static void svdm_dp_post_config(int port)