diff options
Diffstat (limited to 'common/usbc/usb_tc_drp_acc_trysrc_sm.c')
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index 61208f0edb..de95682a64 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -649,7 +649,7 @@ void pd_prepare_sysjump(void) * Exit modes before sysjump so we can cleanly enter again * later */ - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { + for (i = 0; i < board_get_usb_pd_port_count(); i++) { /* * We can't be in an alternate mode if PD comm is * disabled, so no need to send the event @@ -879,7 +879,7 @@ static void pd_update_try_source(void) int batt_soc = usb_get_battery_soc(); try_src = 0; - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) + for (i = 0; i < board_get_usb_pd_port_count(); i++) try_src |= drp_state[i] == PD_DRP_TOGGLE_ON; /* @@ -1027,7 +1027,7 @@ static enum ec_status hc_pd_ports(struct host_cmd_handler_args *args) { struct ec_response_usb_pd_ports *r = args->response; - r->num_ports = CONFIG_USB_PD_PORT_MAX_COUNT; + r->num_ports = board_get_usb_pd_port_count(); args->response_size = sizeof(*r); return EC_RES_SUCCESS; @@ -1068,7 +1068,7 @@ static enum ec_status hc_usb_pd_control(struct host_cmd_handler_args *args) struct ec_response_usb_pd_control_v2 *r_v2 = args->response; struct ec_response_usb_pd_control *r = args->response; - if (p->port >= CONFIG_USB_PD_PORT_MAX_COUNT) + if (p->port >= board_get_usb_pd_port_count()) return EC_RES_INVALID_PARAM; if (p->role >= USB_PD_CTRL_ROLE_COUNT || @@ -1163,7 +1163,7 @@ static enum ec_status hc_remote_flash(struct host_cmd_handler_args *args) const uint32_t *data = &(p->size) + 1; int i, size; - if (port >= CONFIG_USB_PD_PORT_MAX_COUNT) + if (port >= board_get_usb_pd_port_count()) return EC_RES_INVALID_PARAM; if (p->size + sizeof(*p) > args->params_size) @@ -1260,7 +1260,7 @@ static enum ec_status hc_remote_pd_dev_info(struct host_cmd_handler_args *args) const uint8_t *port = args->params; struct ec_params_usb_pd_rw_hash_entry *r = args->response; - if (*port >= CONFIG_USB_PD_PORT_MAX_COUNT) + if (*port >= board_get_usb_pd_port_count()) return EC_RES_INVALID_PARAM; r->dev_id = tc[*port].dev_id; @@ -1285,7 +1285,7 @@ static enum ec_status hc_remote_pd_chip_info(struct host_cmd_handler_args *args) const struct ec_params_pd_chip_info *p = args->params; struct ec_response_pd_chip_info_v1 *info; - if (p->port >= CONFIG_USB_PD_PORT_MAX_COUNT) + if (p->port >= board_get_usb_pd_port_count()) return EC_RES_INVALID_PARAM; if (tcpm_get_chip_info(p->port, p->live, &info)) @@ -1331,7 +1331,7 @@ static enum ec_status hc_remote_pd_set_amode(struct host_cmd_handler_args *args) { const struct ec_params_usb_pd_set_mode_request *p = args->params; - if ((p->port >= CONFIG_USB_PD_PORT_MAX_COUNT) || + if ((p->port >= board_get_usb_pd_port_count()) || (!p->svid) || (!p->opos)) return EC_RES_INVALID_PARAM; |