diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2019-10-02 14:27:47 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-01 18:43:42 +0000 |
commit | 9577704f30c7e824c0590264df22d95a2c706575 (patch) | |
tree | 566b5beeeae8b343803718101ba0b00c940506cb /test | |
parent | e8121e83e478fef2d5a29304be900311f3f020c4 (diff) | |
download | chrome-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 'test')
-rw-r--r-- | test/charge_manager.c | 14 | ||||
-rw-r--r-- | test/fake_prl.c | 4 | ||||
-rw-r--r-- | test/test_config.h | 26 | ||||
-rw-r--r-- | test/usb_pd.c | 4 | ||||
-rw-r--r-- | test/usb_prl.c | 2 | ||||
-rw-r--r-- | test/usb_typec_ctvpd.c | 2 | ||||
-rw-r--r-- | test/usb_typec_drp_acc_trysrc.c | 4 |
7 files changed, 28 insertions, 28 deletions
diff --git a/test/charge_manager.c b/test/charge_manager.c index e50e0e38ee..30c9efc69b 100644 --- a/test/charge_manager.c +++ b/test/charge_manager.c @@ -35,8 +35,8 @@ BUILD_ASSERT(ARRAY_SIZE(supplier_priority) == CHARGE_SUPPLIER_COUNT); static unsigned int active_charge_limit = CHARGE_SUPPLIER_NONE; static unsigned int active_charge_port = CHARGE_PORT_NONE; static unsigned int charge_port_to_reject = CHARGE_PORT_NONE; -static int new_power_request[CONFIG_USB_PD_PORT_COUNT]; -static int power_role[CONFIG_USB_PD_PORT_COUNT]; +static int new_power_request[CONFIG_USB_PD_PORT_MAX_COUNT]; +static int power_role[CONFIG_USB_PD_PORT_MAX_COUNT]; /* Callback functions called by CM on state change */ void board_set_charge_limit(int port, int supplier, int charge_ma, @@ -78,7 +78,7 @@ enum battery_present battery_is_present(void) static void clear_new_power_requests(void) { int i; - for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; ++i) + for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; ++i) new_power_request[i] = 0; } @@ -115,7 +115,7 @@ static void initialize_charge_table(int current, int voltage, int ceil) charge.current = current; charge.voltage = voltage; - for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; ++i) { + for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; ++i) { for (j = 0; j < CEIL_REQUESTOR_COUNT; ++j) charge_manager_set_ceil(i, j, ceil); charge_manager_update_dualrole(i, CAP_DEDICATED); @@ -141,12 +141,12 @@ static int test_initialization(void) /* Initialize all supplier/port pairs, except for the last one */ for (i = 0; i < CHARGE_SUPPLIER_COUNT; ++i) - for (j = 0; j < CONFIG_USB_PD_PORT_COUNT; ++j) { + for (j = 0; j < CONFIG_USB_PD_PORT_MAX_COUNT; ++j) { if (i == 0) charge_manager_update_dualrole(j, CAP_DEDICATED); if (i == CHARGE_SUPPLIER_COUNT - 1 && - j == CONFIG_USB_PD_PORT_COUNT - 1) + j == CONFIG_USB_PD_PORT_MAX_COUNT - 1) break; charge_manager_update_charge(i, j, &charge); } @@ -157,7 +157,7 @@ static int test_initialization(void) /* Update last pair and verify a charge port has been selected */ charge_manager_update_charge(CHARGE_SUPPLIER_COUNT-1, - CONFIG_USB_PD_PORT_COUNT-1, + CONFIG_USB_PD_PORT_MAX_COUNT-1, &charge); wait_for_charge_manager_refresh(); TEST_ASSERT(active_charge_port != CHARGE_PORT_NONE); diff --git a/test/fake_prl.c b/test/fake_prl.c index abdc27763f..58f3c17130 100644 --- a/test/fake_prl.c +++ b/test/fake_prl.c @@ -8,7 +8,7 @@ #include "usb_emsg.h" #include "usb_prl_sm.h" -struct extended_msg emsg[CONFIG_USB_PD_PORT_COUNT]; +struct extended_msg emsg[CONFIG_USB_PD_PORT_MAX_COUNT]; void prl_end_ams(int port) {} @@ -32,7 +32,7 @@ int prl_is_running(int port) void prl_reset(int port) {} -static enum pd_ctrl_msg_type last_ctrl_msg[CONFIG_USB_PD_PORT_COUNT]; +static enum pd_ctrl_msg_type last_ctrl_msg[CONFIG_USB_PD_PORT_MAX_COUNT]; void prl_send_ctrl_msg(int port, enum tcpm_transmit_type type, enum pd_ctrl_msg_type msg) { diff --git a/test/test_config.h b/test/test_config.h index 30a82ba863..8a947d1717 100644 --- a/test/test_config.h +++ b/test/test_config.h @@ -232,7 +232,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #ifdef TEST_USB_COMMON #define CONFIG_USB_POWER_DELIVERY -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #define CONFIG_USB_PD_TCPC #define CONFIG_USB_PD_TCPM_STUB #define CONFIG_SHA256 @@ -240,7 +240,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #endif #if defined(TEST_USB_SM_FRAMEWORK_H3) -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #undef CONFIG_USB_PRL_SM #undef CONFIG_USB_PE_SM #undef CONFIG_USB_TYPEC_SM @@ -248,7 +248,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #endif #if defined(TEST_USB_SM_FRAMEWORK_H2) -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #undef CONFIG_USB_PRL_SM #undef CONFIG_USB_PE_SM #undef CONFIG_USB_TYPEC_SM @@ -256,7 +256,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #endif #if defined(TEST_USB_SM_FRAMEWORK_H1) -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #undef CONFIG_USB_PRL_SM #undef CONFIG_USB_PE_SM #undef CONFIG_USB_TYPEC_SM @@ -264,7 +264,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #endif #if defined(TEST_USB_SM_FRAMEWORK_H0) -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #undef CONFIG_USB_PRL_SM #undef CONFIG_USB_PE_SM #undef CONFIG_USB_TYPEC_SM @@ -272,7 +272,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #endif #if defined(TEST_USB_PRL) -#define CONFIG_USB_PD_PORT_COUNT 2 +#define CONFIG_USB_PD_PORT_MAX_COUNT 2 #define CONFIG_USB_SM_FRAMEWORK #undef CONFIG_USB_PE_SM #undef CONFIG_USB_TYPEC_SM @@ -286,7 +286,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #if defined(TEST_USB_PE_DRP) #define CONFIG_TEST_USB_PE_SM -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #define CONFIG_USB_PE_SM #define CONFIG_USB_PID 0x5036 #define CONFIG_USB_POWER_DELIVERY @@ -311,7 +311,7 @@ int ncp15wb_calculate_temp(uint16_t adc); /* GND impedance in milliohms */ #define VPD_GND_IMPEDANCE 33 -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #define CONFIG_USB_SM_FRAMEWORK #define CONFIG_USB_PE_SM #define CONFIG_USB_PRL_SM @@ -336,7 +336,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #define CONFIG_USB_PD_TRY_SRC #define CONFIG_USB_TYPEC_SM #define CONFIG_USB_SM_FRAMEWORK -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #define CONFIG_USBC_SS_MUX #define CONFIG_USB_PD_VBUS_DETECT_TCPC #define CONFIG_USB_POWER_DELIVERY @@ -348,7 +348,7 @@ int ncp15wb_calculate_temp(uint16_t adc); defined(TEST_USB_PD_REV30) #define CONFIG_USB_POWER_DELIVERY #define CONFIG_USB_PD_DUAL_ROLE -#define CONFIG_USB_PD_PORT_COUNT 2 +#define CONFIG_USB_PD_PORT_MAX_COUNT 2 #define CONFIG_USB_PD_TCPC #define CONFIG_USB_PD_TCPM_STUB #define CONFIG_SHA256 @@ -363,7 +363,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #endif /* TEST_USB_PD || TEST_USB_PD_GIVEBACK || TEST_USB_PD_REV30 */ #ifdef TEST_USB_PPC -#define CONFIG_USB_PD_PORT_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 1 #define CONFIG_USB_PD_VBUS_DETECT_PPC #define CONFIG_USBC_PPC #define CONFIG_USBC_PPC_POLARITY @@ -374,7 +374,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #if defined(TEST_CHARGE_MANAGER) || defined(TEST_CHARGE_MANAGER_DRP_CHARGING) #define CONFIG_CHARGE_MANAGER #define CONFIG_USB_PD_DUAL_ROLE -#define CONFIG_USB_PD_PORT_COUNT 2 +#define CONFIG_USB_PD_PORT_MAX_COUNT 2 #define CONFIG_BATTERY #define CONFIG_BATTERY_SMART #define CONFIG_I2C @@ -390,7 +390,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #ifdef TEST_CHARGE_RAMP #define CONFIG_CHARGE_RAMP_SW -#define CONFIG_USB_PD_PORT_COUNT 2 +#define CONFIG_USB_PD_PORT_MAX_COUNT 2 #endif #if defined(TEST_NVMEM) || defined(TEST_NVMEM_VARS) diff --git a/test/usb_pd.c b/test/usb_pd.c index 2ca0d1d115..96d18beafd 100644 --- a/test/usb_pd.c +++ b/test/usb_pd.c @@ -31,7 +31,7 @@ struct pd_port_t { int partner_role; /* -1 for none */ int partner_polarity; int rev; -} pd_port[CONFIG_USB_PD_PORT_COUNT]; +} pd_port[CONFIG_USB_PD_PORT_MAX_COUNT]; static int give_back_called; @@ -147,7 +147,7 @@ static void init_ports(void) { int i; - for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; ++i) { + for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; ++i) { pd_port[i].host_mode = 0; pd_port[i].partner_role = -1; pd_port[i].has_vbus = 0; diff --git a/test/usb_prl.c b/test/usb_prl.c index 3843c49381..90cadbb230 100644 --- a/test/usb_prl.c +++ b/test/usb_prl.c @@ -106,7 +106,7 @@ static struct pd_prl { int mock_pe_got_hard_reset; int mock_pe_message_received; int mock_got_soft_reset; -} pd_port[CONFIG_USB_PD_PORT_COUNT]; +} pd_port[CONFIG_USB_PD_PORT_MAX_COUNT]; static void init_port(int port, int rev) { diff --git a/test/usb_typec_ctvpd.c b/test/usb_typec_ctvpd.c index 75d620fd85..0253bd75d1 100644 --- a/test/usb_typec_ctvpd.c +++ b/test/usb_typec_ctvpd.c @@ -64,7 +64,7 @@ struct pd_port_t { int partner_role; /* -1 for none */ int partner_polarity; int rev; -} pd_port[CONFIG_USB_PD_PORT_COUNT]; +} pd_port[CONFIG_USB_PD_PORT_MAX_COUNT]; uint64_t wait_for_state_change(int port, uint64_t timeout) { diff --git a/test/usb_typec_drp_acc_trysrc.c b/test/usb_typec_drp_acc_trysrc.c index 5981001344..07496ca600 100644 --- a/test/usb_typec_drp_acc_trysrc.c +++ b/test/usb_typec_drp_acc_trysrc.c @@ -17,13 +17,13 @@ #define PORT0 0 /* Install Mock TCPC and MUX drivers */ -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] = { { .drv = &mock_tcpc_driver, }, }; -struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { +struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { .driver = &mock_usb_mux_driver, } |