summaryrefslogtreecommitdiff
path: root/baseboard/octopus
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/octopus
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/octopus')
-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
5 files changed, 13 insertions, 13 deletions
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,