summaryrefslogtreecommitdiff
path: root/board/glkrvp
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 /board/glkrvp
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 'board/glkrvp')
-rw-r--r--board/glkrvp/board.h2
-rw-r--r--board/glkrvp/chg_usb_pd.c8
-rw-r--r--board/glkrvp/usb_pd_policy.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/board/glkrvp/board.h b/board/glkrvp/board.h
index 7ef92652f6..fd8963d8be 100644
--- a/board/glkrvp/board.h
+++ b/board/glkrvp/board.h
@@ -63,7 +63,7 @@
/* USB PD config */
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
-#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/glkrvp/chg_usb_pd.c b/board/glkrvp/chg_usb_pd.c
index 2536c051c3..f143dcece5 100644
--- a/board/glkrvp/chg_usb_pd.c
+++ b/board/glkrvp/chg_usb_pd.c
@@ -30,7 +30,7 @@ enum glkrvp_charge_ports {
DC_JACK_PORT_0 = DEDICATED_CHARGE_PORT,
};
-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 = {
@@ -48,9 +48,9 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
.drv = &tcpci_tcpm_drv,
},
};
-BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_COUNT);
+BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_MAX_COUNT);
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
+struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
.port_addr = 0x10,
.driver = &ps874x_usb_mux_driver,
@@ -200,7 +200,7 @@ DECLARE_HOOK(HOOK_INIT, board_charge_init, HOOK_PRIO_DEFAULT);
int board_set_active_charge_port(int port)
{
/* if it's a PD port and sourcing VBUS, don't enable */
- if (port >= 0 && port < CONFIG_USB_PD_PORT_COUNT)
+ if (port >= 0 && port < CONFIG_USB_PD_PORT_MAX_COUNT)
if (board_charger_port_is_sourcing_vbus(port)) {
CPRINTS("Skip enable p%d", port);
return EC_ERROR_INVAL;
diff --git a/board/glkrvp/usb_pd_policy.c b/board/glkrvp/usb_pd_policy.c
index 57b114fe5d..72c54d3ec3 100644
--- a/board/glkrvp/usb_pd_policy.c
+++ b/board/glkrvp/usb_pd_policy.c
@@ -202,8 +202,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)
{