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 /board/oak | |
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 'board/oak')
-rw-r--r-- | board/oak/board.c | 12 | ||||
-rw-r--r-- | board/oak/board.h | 2 | ||||
-rw-r--r-- | board/oak/usb_pd_policy.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/board/oak/board.c b/board/oak/board.c index 2cc9b23457..3cd77454f1 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -112,7 +112,7 @@ const struct spi_device_t spi_devices[] = { const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); #endif -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] = { { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { @@ -174,7 +174,7 @@ struct als_t als[] = { BUILD_ASSERT(ARRAY_SIZE(als) == ALS_COUNT); #endif -struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { +struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { .port_addr = 0x54, .driver = &pi3usb30532_usb_mux_driver, @@ -290,7 +290,7 @@ int board_set_active_charge_port(int charge_port) { /* charge port is a physical port */ int is_real_port = (charge_port >= 0 && - charge_port < CONFIG_USB_PD_PORT_COUNT); + charge_port < CONFIG_USB_PD_PORT_MAX_COUNT); /* check if we are source VBUS on the port */ int source = gpio_get_level(charge_port == 0 ? GPIO_USB_C0_5V_EN : GPIO_USB_C1_5V_EN); @@ -338,7 +338,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, * 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 board_typec_set_dp_hpd(int port, int level) { @@ -479,11 +479,11 @@ void vbus_task(void) uint8_t device_type; uint8_t charger_status; uint8_t vbus; - } bc12[CONFIG_USB_PD_PORT_COUNT]; + } bc12[CONFIG_USB_PD_PORT_MAX_COUNT]; uint8_t port, vbus, reg, wake; while (1) { - for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) { + for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) { #if BOARD_REV == OAK_REV3 vbus = !gpio_get_level(port ? GPIO_USB_C1_VBUS_WAKE_L : GPIO_USB_C0_VBUS_WAKE_L); diff --git a/board/oak/board.h b/board/oak/board.h index b2e07c8107..afd063a4f9 100644 --- a/board/oak/board.h +++ b/board/oak/board.h @@ -95,7 +95,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 2 +#define CONFIG_USB_PD_PORT_MAX_COUNT 2 #define CONFIG_USB_PD_TCPM_TCPCI #define CONFIG_USB_PD_TRY_SRC #define CONFIG_USB_PD_VBUS_DETECT_TCPC diff --git a/board/oak/usb_pd_policy.c b/board/oak/usb_pd_policy.c index 2268945144..be6868f268 100644 --- a/board/oak/usb_pd_policy.c +++ b/board/oak/usb_pd_policy.c @@ -207,9 +207,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]; static void svdm_safe_dp_mode(int port) { |