summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2018-05-21 14:39:55 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-05-22 00:21:28 -0700
commit39767b55b4e27289ac2c10ce8114ea715509f441 (patch)
tree592265e2c4b9c3d7e2e32c517134996c0fea55f6 /driver
parentc20a6da0549197b9d35bea59473f709a757ddfcf (diff)
downloadchrome-ec-39767b55b4e27289ac2c10ce8114ea715509f441.tar.gz
tcpm: it83xx: Output error message if enabling an unsupported configuration
This patch will output an error message during compiling if we try to enable an unsupported config option for it83xx PD driver. This avoids the issue of an unknown EC reset caused by calling function at address 0x00000000. This change also remove empty definitions. BUG=b:79700229,b:79706847,b:79637786 BRANCH=none TEST=make buildall -j Change-Id: I08accb88ae7c6d574dfcd115a5122acd2dfe46b4 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1059095 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/it83xx.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c
index c8c2edbc38..f34b9271f2 100644
--- a/driver/tcpm/it83xx.c
+++ b/driver/tcpm/it83xx.c
@@ -17,6 +17,12 @@
#include "usb_pd.h"
#include "usb_pd_tcpm.h"
+#if defined(CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE) || \
+ defined(CONFIG_USB_PD_VBUS_DETECT_TCPC) || \
+ defined(CONFIG_USB_PD_DISCHARGE_TCPC)
+#error "Unsupported config options of IT83xx PD driver"
+#endif
+
/* Wait time for vconn power switch to turn off. */
#ifndef PD_IT83XX_VCONN_TURN_OFF_DELAY_US
#define PD_IT83XX_VCONN_TURN_OFF_DELAY_US 500
@@ -525,9 +531,6 @@ const struct tcpm_drv it83xx_tcpm_drv = {
.init = &it83xx_tcpm_init,
.release = &it83xx_tcpm_release,
.get_cc = &it83xx_tcpm_get_cc,
-#ifdef CONFIG_USB_PD_VBUS_DETECT_TCPC
- .get_vbus_level = NULL,
-#endif
.select_rp_value = &it83xx_tcpm_select_rp_value,
.set_cc = &it83xx_tcpm_set_cc,
.set_polarity = &it83xx_tcpm_set_polarity,
@@ -536,12 +539,5 @@ const struct tcpm_drv it83xx_tcpm_drv = {
.set_rx_enable = &it83xx_tcpm_set_rx_enable,
.get_message = &it83xx_tcpm_get_message,
.transmit = &it83xx_tcpm_transmit,
- .tcpc_alert = NULL,
-#ifdef CONFIG_USB_PD_DISCHARGE_TCPC
- .tcpc_discharge_vbus = NULL,
-#endif
-#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
- .drp_toggle = NULL,
-#endif
.get_chip_info = &it83xx_tcpm_get_chip_info,
};