summaryrefslogtreecommitdiff
path: root/common/usb_pd_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb_pd_policy.c')
-rw-r--r--common/usb_pd_policy.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c
index 090588a034..f36ec396ab 100644
--- a/common/usb_pd_policy.c
+++ b/common/usb_pd_policy.c
@@ -99,22 +99,22 @@ __attribute__((weak)) int pd_board_check_request(uint32_t rdo, int pdo_cnt)
#ifdef CONFIG_USB_PD_DUAL_ROLE
/* Last received source cap */
-static uint32_t pd_src_caps[CONFIG_USB_PD_PORT_COUNT][PDO_MAX_OBJECTS];
-static uint8_t pd_src_cap_cnt[CONFIG_USB_PD_PORT_COUNT];
+static uint32_t pd_src_caps[CONFIG_USB_PD_PORT_MAX_COUNT][PDO_MAX_OBJECTS];
+static uint8_t pd_src_cap_cnt[CONFIG_USB_PD_PORT_MAX_COUNT];
/* Cap on the max voltage requested as a sink (in millivolts) */
static unsigned max_request_mv = PD_MAX_VOLTAGE_MV; /* no cap */
const uint32_t * const pd_get_src_caps(int port)
{
- ASSERT(port < CONFIG_USB_PD_PORT_COUNT);
+ ASSERT(port < CONFIG_USB_PD_PORT_MAX_COUNT);
return pd_src_caps[port];
}
uint8_t pd_get_src_cap_cnt(int port)
{
- ASSERT(port < CONFIG_USB_PD_PORT_COUNT);
+ ASSERT(port < CONFIG_USB_PD_PORT_MAX_COUNT);
return pd_src_cap_cnt[port];
}
@@ -164,7 +164,7 @@ int pd_charge_from_device(uint16_t vid, uint16_t pid)
}
#endif /* CONFIG_USB_PD_DUAL_ROLE */
-static struct pd_cable cable[CONFIG_USB_PD_PORT_COUNT];
+static struct pd_cable cable[CONFIG_USB_PD_PORT_MAX_COUNT];
static uint8_t is_transmit_msg_sop_prime(int port)
{
@@ -209,7 +209,7 @@ enum idh_ptype get_usb_pd_mux_cable_type(int port)
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static struct pd_policy pe[CONFIG_USB_PD_PORT_COUNT];
+static struct pd_policy pe[CONFIG_USB_PD_PORT_MAX_COUNT];
static int is_vdo_present(int cnt, int index)
{
@@ -629,7 +629,7 @@ static int command_pe(int argc, char **argv)
return EC_ERROR_PARAM_COUNT;
/* command: pe <port> <subcmd> <args> */
port = strtoi(argv[1], &e, 10);
- if (*e || port >= CONFIG_USB_PD_PORT_COUNT)
+ if (*e || port >= CONFIG_USB_PD_PORT_MAX_COUNT)
return EC_ERROR_PARAM2;
if (!strncasecmp(argv[2], "dump", 4))
dump_pe(port);
@@ -884,7 +884,7 @@ static int command_cable(int argc, char **argv)
if (argc < 2)
return EC_ERROR_PARAM_COUNT;
port = strtoi(argv[1], &e, 0);
- if (*e || port >= CONFIG_USB_PD_PORT_COUNT)
+ if (*e || port >= CONFIG_USB_PD_PORT_MAX_COUNT)
return EC_ERROR_PARAM2;
if (!cable[port].is_identified) {
@@ -984,7 +984,7 @@ static enum ec_status hc_remote_pd_discovery(struct host_cmd_handler_args *args)
const uint8_t *port = args->params;
struct ec_params_usb_pd_discovery_entry *r = args->response;
- if (*port >= CONFIG_USB_PD_PORT_COUNT)
+ if (*port >= CONFIG_USB_PD_PORT_MAX_COUNT)
return EC_RES_INVALID_PARAM;
r->vid = pd_get_identity_vid(*port);
@@ -1006,7 +1006,7 @@ static enum ec_status hc_remote_pd_get_amode(struct host_cmd_handler_args *args)
const struct ec_params_usb_pd_get_mode_request *p = args->params;
struct ec_params_usb_pd_get_mode_response *r = args->response;
- if (p->port >= CONFIG_USB_PD_PORT_COUNT)
+ if (p->port >= CONFIG_USB_PD_PORT_MAX_COUNT)
return EC_RES_INVALID_PARAM;
/* no more to send */
@@ -1135,17 +1135,17 @@ int pd_custom_flash_vdm(int port, int cnt, uint32_t *payload)
#ifdef CONFIG_USB_PD_DISCHARGE
void pd_set_vbus_discharge(int port, int enable)
{
- static struct mutex discharge_lock[CONFIG_USB_PD_PORT_COUNT];
+ static struct mutex discharge_lock[CONFIG_USB_PD_PORT_MAX_COUNT];
mutex_lock(&discharge_lock[port]);
enable &= !board_vbus_source_enabled(port);
#ifdef CONFIG_USB_PD_DISCHARGE_GPIO
if (!port)
gpio_set_level(GPIO_USB_C0_DISCHARGE, enable);
-#if CONFIG_USB_PD_PORT_COUNT > 1
+#if CONFIG_USB_PD_PORT_MAX_COUNT > 1
else
gpio_set_level(GPIO_USB_C1_DISCHARGE, enable);
-#endif /* CONFIG_USB_PD_PORT_COUNT */
+#endif /* CONFIG_USB_PD_PORT_MAX_COUNT */
#elif defined(CONFIG_USB_PD_DISCHARGE_TCPC)
tcpc_discharge_vbus(port, enable);
#elif defined(CONFIG_USB_PD_DISCHARGE_PPC)