summaryrefslogtreecommitdiff
path: root/baseboard/dragonegg
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/dragonegg
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/dragonegg')
-rw-r--r--baseboard/dragonegg/baseboard.c10
-rw-r--r--baseboard/dragonegg/baseboard.h2
-rw-r--r--baseboard/dragonegg/usb_pd_policy.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/baseboard/dragonegg/baseboard.c b/baseboard/dragonegg/baseboard.c
index 36f054c376..7414421c15 100644
--- a/baseboard/dragonegg/baseboard.c
+++ b/baseboard/dragonegg/baseboard.c
@@ -137,7 +137,7 @@ void board_hibernate(void)
}
/******************************************************************************/
/* 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 */
@@ -168,7 +168,7 @@ const struct tcpc_config_t tcpc_config[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,
@@ -189,7 +189,7 @@ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = {
};
unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
-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 = &virtual_usb_mux_driver,
.hpd_update = &virtual_hpd_update,
@@ -209,7 +209,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_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_ODL,
.chg_det_pin = GPIO_USB_C0_BC12_CHG_MAX,
@@ -284,7 +284,7 @@ void board_pd_vconn_ctrl(int port, enum usbpd_cc_pin cc_pin, int enabled)
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)
diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h
index 9046d4e5c3..e34f5d11c3 100644
--- a/baseboard/dragonegg/baseboard.h
+++ b/baseboard/dragonegg/baseboard.h
@@ -86,7 +86,7 @@
* on the MLB for now. In addition, this config option will likely move to
* board.h as it likely board dependent and not same across all follower boards.
*/
-#define CONFIG_USB_PD_PORT_COUNT 3
+#define CONFIG_USB_PD_PORT_MAX_COUNT 3
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_LOGGING
diff --git a/baseboard/dragonegg/usb_pd_policy.c b/baseboard/dragonegg/usb_pd_policy.c
index 37a9b51dc9..cf9d3c4885 100644
--- a/baseboard/dragonegg/usb_pd_policy.c
+++ b/baseboard/dragonegg/usb_pd_policy.c
@@ -277,8 +277,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)
{