diff options
author | Jett Rink <jettrink@chromium.org> | 2018-08-28 08:03:41 -0600 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2019-04-15 17:15:15 +0000 |
commit | 0bd3b0a66387896faa256f80a4f06fdeb1bb9f93 (patch) | |
tree | 9c448b6442104ea3ea24411ba51d64a932d319dc | |
parent | 200d1f64cd88e8c178b85e745c8327bfa83cf8b6 (diff) | |
download | chrome-ec-0bd3b0a66387896faa256f80a4f06fdeb1bb9f93.tar.gz |
cleanup: remove tcpc* extern function declarations
We do not want to use extern when possible, so move the function
declaration section in the tcpm stub c files to an appropriate header file.
BRANCH=none
BUG=none
TEST=zinger compiler (along with everything else)
Change-Id: If867661840d138e0c912669e401469a152fa3d9b
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1194083
Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1565456
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | driver/tcpm/stub.c | 17 | ||||
-rw-r--r-- | include/usb_pd_tcpc.h | 19 |
2 files changed, 20 insertions, 16 deletions
diff --git a/driver/tcpm/stub.c b/driver/tcpm/stub.c index bb61c83024..5df10dddc6 100644 --- a/driver/tcpm/stub.c +++ b/driver/tcpm/stub.c @@ -9,24 +9,9 @@ #include "tcpci.h" #include "tcpm.h" #include "usb_pd.h" +#include "usb_pd_tcpc.h" #include "usb_pd_tcpm.h" -extern int tcpc_alert_status(int port, int *alert); -extern int tcpc_alert_status_clear(int port, uint16_t mask); -extern int tcpc_alert_mask_set(int port, uint16_t mask); -extern int tcpc_get_cc(int port, int *cc1, int *cc2); -extern int tcpc_select_rp_value(int port, int rp); -extern int tcpc_set_cc(int port, int pull); -extern int tcpc_set_polarity(int port, int polarity); -extern int tcpc_set_power_status_mask(int port, uint8_t mask); -extern int tcpc_set_vconn(int port, int enable); -extern int tcpc_set_msg_header(int port, int power_role, int data_role); -extern int tcpc_set_rx_enable(int port, int enable); - -extern int tcpc_get_message(int port, uint32_t *payload, int *head); -extern int tcpc_transmit(int port, enum tcpm_transmit_type type, - uint16_t header, const uint32_t *data); - static int init_alert_mask(int port) { uint16_t mask; diff --git a/include/usb_pd_tcpc.h b/include/usb_pd_tcpc.h index 371e6666a4..1b93cd822c 100644 --- a/include/usb_pd_tcpc.h +++ b/include/usb_pd_tcpc.h @@ -8,6 +8,9 @@ #ifndef __CROS_EC_USB_PD_TCPC_H #define __CROS_EC_USB_PD_TCPC_H +#include <stdint.h> +#include "usb_pd_tcpm.h" + /* If we are a TCPC but do not a TCPM, then we implement the slave TCPCI */ #if defined(CONFIG_USB_PD_TCPC) && !defined(CONFIG_USB_PD_TCPM_STUB) #define TCPCI_I2C_SLAVE @@ -39,4 +42,20 @@ void tcpc_i2c_process(int read, int port, int len, uint8_t *payload, void pd_vbus_evt_p0(enum gpio_signal signal); void pd_vbus_evt_p1(enum gpio_signal signal); +/* Methods for TCPCI slaves (e.g. zinger) to get/set their internal state */ +int tcpc_alert_status(int port, int *alert); +int tcpc_alert_status_clear(int port, uint16_t mask); +int tcpc_alert_mask_set(int port, uint16_t mask); +int tcpc_get_cc(int port, int *cc1, int *cc2); +int tcpc_select_rp_value(int port, int rp); +int tcpc_set_cc(int port, int pull); +int tcpc_set_polarity(int port, int polarity); +int tcpc_set_power_status_mask(int port, uint8_t mask); +int tcpc_set_vconn(int port, int enable); +int tcpc_set_msg_header(int port, int power_role, int data_role); +int tcpc_set_rx_enable(int port, int enable); +int tcpc_get_message(int port, uint32_t *payload, int *head); +int tcpc_transmit(int port, enum tcpm_transmit_type type, uint16_t header, + const uint32_t *data); + #endif /* __CROS_EC_USB_PD_TCPC_H */ |