summaryrefslogtreecommitdiff
path: root/driver/tcpm
diff options
context:
space:
mode:
authorEric Herrmann <eherrmann@chromium.org>2020-07-08 16:32:44 -0700
committerCommit Bot <commit-bot@chromium.org>2020-07-09 04:27:24 +0000
commitf05303b517588e0fefa3709938da586788c899a9 (patch)
tree2c734089bf0f9b8b6569f6c923494560795a4b85 /driver/tcpm
parent757a836270f3b3b8890f3c68470b657a63ff7b5a (diff)
downloadchrome-ec-f05303b517588e0fefa3709938da586788c899a9.tar.gz
TCPM driver: Add prototype for tcpm frs enable
Add a prototype for tcpm_set_frs_enable so that we can compile if CONFIG_USB_PD_FRS is defined but not CONFIG_USB_PD_FRS_TCPC. BUG=b:148144711 TEST="make --board volteer" with CONFIG_USB_PD_FRS_PPC defined but not CONFIG_USB_PD_TCPC defined BRANCH=none Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: Icb1adea5ef8a90fd7b427a517dd05426a8f1957d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2289037 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'driver/tcpm')
-rw-r--r--driver/tcpm/tcpm.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/driver/tcpm/tcpm.h b/driver/tcpm/tcpm.h
index de229d73b6..4dd9af993d 100644
--- a/driver/tcpm/tcpm.h
+++ b/driver/tcpm/tcpm.h
@@ -310,6 +310,23 @@ static inline int tcpm_get_chip_info(int port, int live,
return EC_ERROR_UNIMPLEMENTED;
}
+#ifdef CONFIG_USB_PD_FRS_TCPC
+static inline int tcpm_set_frs_enable(int port, int enable)
+{
+ const struct tcpm_drv *tcpc;
+ int rv = EC_SUCCESS;
+
+ /*
+ * set_frs_enable will be set to tcpci_tcp_fast_role_swap_enable
+ * if it is handled by the tcpci for the tcpc chipset
+ */
+ tcpc = tcpc_config[port].drv;
+ if (tcpc->set_frs_enable)
+ rv = tcpc->set_frs_enable(port, enable);
+ return rv;
+}
+#endif /* defined(CONFIG_USB_PD_FRS_TCPC) */
+
#else
/**
@@ -458,7 +475,6 @@ int tcpm_has_pending_message(int port);
*/
void tcpm_clear_pending_messages(int port);
-#ifdef CONFIG_USB_PD_FRS_TCPC
/**
* Enable/Disable TCPC Fast Role Swap detection
*
@@ -466,21 +482,7 @@ void tcpm_clear_pending_messages(int port);
* @param enable FRS enable (true) disable (false)
* @return EC_SUCCESS on success, or an error
*/
-static inline int tcpm_set_frs_enable(int port, int enable)
-{
- const struct tcpm_drv *tcpc;
- int rv = EC_SUCCESS;
-
- /*
- * set_frs_enable will be set to tcpci_tcp_fast_role_swap_enable
- * if it is handled by the tcpci for the tcpc chipset
- */
- tcpc = tcpc_config[port].drv;
- if (tcpc->set_frs_enable)
- rv = tcpc->set_frs_enable(port, enable);
- return rv;
-}
-#endif /* defined(CONFIG_USB_PD_FRS_TCPC) */
+int tcpm_set_frs_enable(int port, int enable);
#ifdef CONFIG_CMD_TCPC_DUMP
static inline void tcpm_dump_registers(int port)