summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-05-16 14:09:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-21 08:56:00 -0700
commite69840b434035ae581e31a29efc1a333d0b390da (patch)
tree59ad1d150fa43b981452067baf88365f6671736d
parentf2431315c39d344fa6c99042a6b6cc9d68b7db93 (diff)
downloadchrome-ec-e69840b434035ae581e31a29efc1a333d0b390da.tar.gz
USB-PD: Consolidate tcpc_config declarations in usb_pd_tcpm.h
Currently, tcpc_config is declared in two places. This patch consolidates declarations in usb_pd_tcpm.h. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: I4f30d06b1eaeb6a83b664de76116d85d65a9fc97 Reviewed-on: https://chromium-review.googlesource.com/1616007 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--common/system.c1
-rw-r--r--driver/tcpm/tcpm.h5
-rw-r--r--include/usb_pd_tcpm.h6
3 files changed, 6 insertions, 6 deletions
diff --git a/common/system.c b/common/system.c
index 430b611174..632cc19695 100644
--- a/common/system.c
+++ b/common/system.c
@@ -353,7 +353,6 @@ const uint8_t *system_get_jump_tag(uint16_t tag, int *version, int *size)
#if defined(CONFIG_USB_POWER_DELIVERY) && !defined(CONFIG_USB_PD_TCPM_STUB) && \
defined(CONFIG_I2C_MASTER)
-extern const struct tcpc_config_t tcpc_config[];
static void system_protect_tcpc_i2c_ports(void)
{
diff --git a/driver/tcpm/tcpm.h b/driver/tcpm/tcpm.h
index 52314151ae..0dee179e36 100644
--- a/driver/tcpm/tcpm.h
+++ b/driver/tcpm/tcpm.h
@@ -22,11 +22,6 @@
#endif
#ifndef CONFIG_USB_PD_TCPC
-#ifndef CONFIG_USB_PD_TCPC_RUNTIME_CONFIG
-extern const struct tcpc_config_t tcpc_config[];
-#else
-extern struct tcpc_config_t tcpc_config[];
-#endif
/* I2C wrapper functions - get I2C port / slave addr from config struct. */
#ifndef CONFIG_USB_PD_TCPC_LOW_POWER
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index c256a8961f..89704737b7 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -333,6 +333,12 @@ struct tcpc_config_t {
uint32_t flags;
};
+#ifndef CONFIG_USB_PD_TCPC_RUNTIME_CONFIG
+extern const struct tcpc_config_t tcpc_config[];
+#else
+extern struct tcpc_config_t tcpc_config[];
+#endif
+
/**
* Returns the PD_STATUS_TCPC_ALERT_* mask corresponding to the TCPC ports
* that are currently asserting ALERT.