diff options
Diffstat (limited to 'driver/tcpm')
-rw-r--r-- | driver/tcpm/anx74xx.c | 3 | ||||
-rw-r--r-- | driver/tcpm/fusb302.c | 10 | ||||
-rw-r--r-- | driver/tcpm/it83xx.c | 3 | ||||
-rw-r--r-- | driver/tcpm/mt6370.c | 3 | ||||
-rw-r--r-- | driver/tcpm/nct38xx.c | 3 | ||||
-rw-r--r-- | driver/tcpm/stub.c | 3 | ||||
-rw-r--r-- | driver/tcpm/tcpci.c | 3 | ||||
-rw-r--r-- | driver/tcpm/tcpci.h | 4 | ||||
-rw-r--r-- | driver/tcpm/tcpm.h | 6 |
9 files changed, 26 insertions, 12 deletions
diff --git a/driver/tcpm/anx74xx.c b/driver/tcpm/anx74xx.c index 47a7349f6a..36c29f0701 100644 --- a/driver/tcpm/anx74xx.c +++ b/driver/tcpm/anx74xx.c @@ -640,7 +640,8 @@ static int anx74xx_check_cc_type(int cc_reg) return cc; } -static int anx74xx_tcpm_get_cc(int port, int *cc1, int *cc2) +static int anx74xx_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { int rv = EC_SUCCESS; int reg = 0; diff --git a/driver/tcpm/fusb302.c b/driver/tcpm/fusb302.c index f8196a586f..ee16a206b3 100644 --- a/driver/tcpm/fusb302.c +++ b/driver/tcpm/fusb302.c @@ -164,7 +164,9 @@ static int measure_cc_pin_source(int port, int cc_measure) } /* Determine cc pin state for source when in manual detect mode */ -static void detect_cc_pin_source_manual(int port, int *cc1_lvl, int *cc2_lvl) +static void detect_cc_pin_source_manual(int port, + enum tcpc_cc_voltage_status *cc1_lvl, + enum tcpc_cc_voltage_status *cc2_lvl) { int cc1_measure = TCPC_REG_SWITCHES0_MEAS_CC1; int cc2_measure = TCPC_REG_SWITCHES0_MEAS_CC2; @@ -184,7 +186,8 @@ static void detect_cc_pin_source_manual(int port, int *cc1_lvl, int *cc2_lvl) } /* Determine cc pin state for sink */ -static void detect_cc_pin_sink(int port, int *cc1, int *cc2) +static void detect_cc_pin_sink(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { int reg; int orig_meas_cc1; @@ -456,7 +459,8 @@ static int fusb302_tcpm_release(int port) return EC_ERROR_UNIMPLEMENTED; } -static int fusb302_tcpm_get_cc(int port, int *cc1, int *cc2) +static int fusb302_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { if (state[port].pulling_up) { /* Source mode? */ diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c index b0ea91f89e..4d65e71a34 100644 --- a/driver/tcpm/it83xx.c +++ b/driver/tcpm/it83xx.c @@ -438,7 +438,8 @@ static int it83xx_tcpm_release(int port) return EC_ERROR_UNIMPLEMENTED; } -static int it83xx_tcpm_get_cc(int port, int *cc1, int *cc2) +static int it83xx_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { *cc2 = it83xx_get_cc(port, USBPD_CC_PIN_2); *cc1 = it83xx_get_cc(port, USBPD_CC_PIN_1); diff --git a/driver/tcpm/mt6370.c b/driver/tcpm/mt6370.c index 1d729f28e1..cad8a7fbbc 100644 --- a/driver/tcpm/mt6370.c +++ b/driver/tcpm/mt6370.c @@ -71,7 +71,8 @@ static int mt6370_init(int port) return rv; } -static int mt6370_get_cc(int port, int *cc1, int *cc2) +static int mt6370_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { int status; int rv; diff --git a/driver/tcpm/nct38xx.c b/driver/tcpm/nct38xx.c index 472af584ae..42925910de 100644 --- a/driver/tcpm/nct38xx.c +++ b/driver/tcpm/nct38xx.c @@ -167,7 +167,8 @@ static int tcpci_nct38xx_set_cc(int port, int pull) return rv; } -static int tcpci_nct38xx_get_cc(int port, int *cc1, int *cc2) +static int tcpci_nct38xx_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { int rv; int rc; diff --git a/driver/tcpm/stub.c b/driver/tcpm/stub.c index 23529b5185..0ebe8af999 100644 --- a/driver/tcpm/stub.c +++ b/driver/tcpm/stub.c @@ -47,7 +47,8 @@ int tcpm_init(int port) return init_power_status_mask(port); } -int tcpm_get_cc(int port, int *cc1, int *cc2) +int tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { return tcpc_get_cc(port, cc1, cc2); } diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c index ab0b4f777c..829f636cff 100644 --- a/driver/tcpm/tcpci.c +++ b/driver/tcpm/tcpci.c @@ -190,7 +190,8 @@ static int clear_power_status_mask(int port) return tcpc_write(port, TCPC_REG_POWER_STATUS_MASK, 0); } -int tcpci_tcpm_get_cc(int port, int *cc1, int *cc2) +int tcpci_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { int status; int rv; diff --git a/driver/tcpm/tcpci.h b/driver/tcpm/tcpci.h index 285cba1f57..9bec93e325 100644 --- a/driver/tcpm/tcpci.h +++ b/driver/tcpm/tcpci.h @@ -10,6 +10,7 @@ #include "tcpm.h" #include "usb_mux.h" +#include "usb_pd_tcpm.h" #define TCPC_REG_VENDOR_ID 0x0 #define TCPC_REG_PRODUCT_ID 0x2 @@ -135,7 +136,8 @@ extern const struct usb_mux_driver tcpci_tcpm_usb_mux_driver; void tcpci_tcpc_alert(int port); int tcpci_tcpm_init(int port); -int tcpci_tcpm_get_cc(int port, int *cc1, int *cc2); +int tcpci_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2); int tcpci_tcpm_get_vbus_level(int port); int tcpci_tcpm_select_rp_value(int port, int rp); int tcpci_tcpm_set_cc(int port, int pull); diff --git a/driver/tcpm/tcpm.h b/driver/tcpm/tcpm.h index ca7d3cf7bd..1ef4073211 100644 --- a/driver/tcpm/tcpm.h +++ b/driver/tcpm/tcpm.h @@ -124,7 +124,8 @@ static inline int tcpm_release(int port) return tcpc_config[port].drv->release(port); } -static inline int tcpm_get_cc(int port, int *cc1, int *cc2) +static inline int tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2) { return tcpc_config[port].drv->get_cc(port, cc1, cc2); } @@ -266,7 +267,8 @@ int tcpm_init(int port); * * @return EC_SUCCESS or error */ -int tcpm_get_cc(int port, int *cc1, int *cc2); +int tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, + enum tcpc_cc_voltage_status *cc2); /** * Read VBUS |