summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuibin Chang <ruibin.chang@ite.com.tw>2020-12-17 17:57:21 +0800
committerCommit Bot <commit-bot@chromium.org>2020-12-21 03:08:28 +0000
commit493b7a883cce209c0da5e84f6fc67ca3ec29e5fd (patch)
tree53493a3120f6f55d40675e56f5dcd0a8884b6aa2
parent734be01c61e10e7c2e0410cae01245df1772ad93 (diff)
downloadchrome-ec-493b7a883cce209c0da5e84f6fc67ca3ec29e5fd.tar.gz
Cleanup: rename function name
Rename function name from it83xx_* to it8xxx2_* for it8xxx2 driver. Rename function name from *_tcpm_sw_reset to *_tcpm_hook_disconnect. BUG=none BRANCH=none TEST=make BOARD=drawcia -j make BOARD=asurada -j Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I8111ec5b9972d1badae625e87248c62e99eabbf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2598298 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw>
-rw-r--r--chip/it83xx/intc.c4
-rw-r--r--driver/tcpm/it83xx.c5
-rw-r--r--driver/tcpm/it83xx_pd.h4
-rw-r--r--driver/tcpm/it8xxx2.c197
4 files changed, 106 insertions, 104 deletions
diff --git a/chip/it83xx/intc.c b/chip/it83xx/intc.c
index cc7ffc6c02..08fcdbcf53 100644
--- a/chip/it83xx/intc.c
+++ b/chip/it83xx/intc.c
@@ -51,10 +51,10 @@ static void chip_pd_irq(enum usbpd_port port)
if (USBPD_IS_TX_DONE(port)) {
#ifdef CONFIG_USB_PD_TCPM_DRIVER_IT8XXX2
- it83xx_clear_tx_error_status(port);
+ it8xxx2_clear_tx_error_status(port);
/* check TX status, clear by TX_DONE status too */
if (USBPD_IS_TX_ERR(port))
- it83xx_get_tx_error_status(port);
+ it8xxx2_get_tx_error_status(port);
#endif
/* clear TX done interrupt */
IT83XX_USBPD_ISR(port) = USBPD_REG_MASK_MSG_TX_DONE;
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c
index a498959201..bfa42dec09 100644
--- a/driver/tcpm/it83xx.c
+++ b/driver/tcpm/it83xx.c
@@ -831,7 +831,7 @@ static void it83xx_tcpm_hook_connect(void)
DECLARE_HOOK(HOOK_USB_PD_CONNECT, it83xx_tcpm_hook_connect, HOOK_PRIO_DEFAULT);
#endif
-static void it83xx_tcpm_sw_reset(void)
+static void it83xx_tcpm_hook_disconnect(void)
{
int port = TASK_ID_TO_PD_PORT(task_get_current());
@@ -857,7 +857,8 @@ static void it83xx_tcpm_sw_reset(void)
set_pd_sleep_mask(port);
}
-DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, it83xx_tcpm_sw_reset, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, it83xx_tcpm_hook_disconnect,
+ HOOK_PRIO_DEFAULT);
const struct tcpm_drv it83xx_tcpm_drv = {
.init = &it83xx_tcpm_init,
diff --git a/driver/tcpm/it83xx_pd.h b/driver/tcpm/it83xx_pd.h
index 401a74887d..323e344a46 100644
--- a/driver/tcpm/it83xx_pd.h
+++ b/driver/tcpm/it83xx_pd.h
@@ -419,8 +419,8 @@ extern const struct usbpd_ctrl_t usbpd_ctrl_regs[];
extern const struct tcpm_drv it83xx_tcpm_drv;
void it83xx_Rd_5_1K_only_for_hibernate(int port);
#ifdef CONFIG_USB_PD_TCPM_DRIVER_IT8XXX2
-void it83xx_clear_tx_error_status(enum usbpd_port port);
-void it83xx_get_tx_error_status(enum usbpd_port port);
+void it8xxx2_clear_tx_error_status(enum usbpd_port port);
+void it8xxx2_get_tx_error_status(enum usbpd_port port);
#endif
void switch_plug_out_type(enum usbpd_port port);
/*
diff --git a/driver/tcpm/it8xxx2.c b/driver/tcpm/it8xxx2.c
index d06c0a11cd..88dadc4285 100644
--- a/driver/tcpm/it8xxx2.c
+++ b/driver/tcpm/it8xxx2.c
@@ -23,14 +23,14 @@
defined(CONFIG_USB_PD_VBUS_DETECT_TCPC) || \
defined(CONFIG_USB_PD_TCPC_LOW_POWER) || \
defined(CONFIG_USB_PD_DISCHARGE_TCPC)
-#error "Unsupported config options of IT83xx PD driver"
+#error "Unsupported config options of IT8xxx2 PD driver"
#endif
#endif
#ifdef CONFIG_USB_PD_TCPMV2
#if defined(CONFIG_USB_PD_VBUS_DETECT_TCPC) || \
defined(CONFIG_USB_PD_DISCHARGE_TCPC)
-#error "Unsupported config options of IT83xx PD driver"
+#error "Unsupported config options of IT8xxx2 PD driver"
#endif
#endif
@@ -97,9 +97,8 @@ void it83xx_Rd_5_1K_only_for_hibernate(int port)
}
}
-static enum tcpc_cc_voltage_status it83xx_get_cc(
- enum usbpd_port port,
- enum usbpd_cc_pin cc_pin)
+static enum tcpc_cc_voltage_status it8xxx2_get_cc(enum usbpd_port port,
+ enum usbpd_cc_pin cc_pin)
{
enum usbpd_ufp_volt_status ufp_volt;
enum usbpd_dfp_volt_status dfp_volt;
@@ -162,7 +161,7 @@ static enum tcpc_cc_voltage_status it83xx_get_cc(
return cc_state;
}
-static int it83xx_tcpm_get_message_raw(int port, uint32_t *buf, int *head)
+static int it8xxx2_tcpm_get_message_raw(int port, uint32_t *buf, int *head)
{
int cnt = PD_HEADER_CNT(IT83XX_USBPD_RMH(port));
@@ -189,12 +188,12 @@ static int it83xx_tcpm_get_message_raw(int port, uint32_t *buf, int *head)
return EC_SUCCESS;
}
-void it83xx_clear_tx_error_status(enum usbpd_port port)
+void it8xxx2_clear_tx_error_status(enum usbpd_port port)
{
tx_error_status[port] = 0;
}
-void it83xx_get_tx_error_status(enum usbpd_port port)
+void it8xxx2_get_tx_error_status(enum usbpd_port port)
{
tx_error_status[port] = IT83XX_USBPD_MTCR(port) &
(USBPD_REG_MASK_TX_NOT_EN_STAT |
@@ -202,11 +201,10 @@ void it83xx_get_tx_error_status(enum usbpd_port port)
USBPD_REG_MASK_TX_NO_RESPONSE_STAT);
}
-static enum tcpc_transmit_complete it83xx_tx_data(
- enum usbpd_port port,
- enum tcpm_transmit_type type,
- uint16_t header,
- const uint32_t *buf)
+static enum tcpc_transmit_complete it8xxx2_tx_data(enum usbpd_port port,
+ enum tcpm_transmit_type type,
+ uint16_t header,
+ const uint32_t *buf)
{
int r;
uint32_t evt;
@@ -279,7 +277,7 @@ static enum tcpc_transmit_complete it83xx_tx_data(
return TCPC_TX_COMPLETE_SUCCESS;
}
-static enum tcpc_transmit_complete it83xx_send_hw_reset(enum usbpd_port port)
+static enum tcpc_transmit_complete it8xxx2_send_hw_reset(enum usbpd_port port)
{
/* Send hard reset */
USBPD_SEND_HARD_RESET(port);
@@ -292,7 +290,8 @@ static enum tcpc_transmit_complete it83xx_send_hw_reset(enum usbpd_port port)
return TCPC_TX_COMPLETE_SUCCESS;
}
-static enum tcpc_transmit_complete it83xx_send_cable_reset(enum usbpd_port port)
+static enum tcpc_transmit_complete it8xxx2_send_cable_reset(
+ enum usbpd_port port)
{
/* Send cable reset */
USBPD_SEND_CABLE_RESET(port);
@@ -305,14 +304,14 @@ static enum tcpc_transmit_complete it83xx_send_cable_reset(enum usbpd_port port)
return TCPC_TX_COMPLETE_SUCCESS;
}
-static void it83xx_send_bist_mode2_pattern(enum usbpd_port port)
+static void it8xxx2_send_bist_mode2_pattern(enum usbpd_port port)
{
USBPD_ENABLE_SEND_BIST_MODE_2(port);
usleep(PD_T_BIST_TRANSMIT);
USBPD_DISABLE_SEND_BIST_MODE_2(port);
}
-static void it83xx_enable_vconn(enum usbpd_port port, int enabled)
+static void it8xxx2_enable_vconn(enum usbpd_port port, int enabled)
{
enum usbpd_cc_pin cc_pin;
@@ -345,7 +344,7 @@ static void it83xx_enable_vconn(enum usbpd_port port, int enabled)
}
}
-static void it83xx_enable_cc(enum usbpd_port port, int enable)
+static void it8xxx2_enable_cc(enum usbpd_port port, int enable)
{
if (enable)
IT83XX_USBPD_CCGCR(port) &= ~USBPD_REG_MASK_DISABLE_CC;
@@ -353,7 +352,7 @@ static void it83xx_enable_cc(enum usbpd_port port, int enable)
IT83XX_USBPD_CCGCR(port) |= USBPD_REG_MASK_DISABLE_CC;
}
-static void it83xx_set_power_role(enum usbpd_port port, int power_role)
+static void it8xxx2_set_power_role(enum usbpd_port port, int power_role)
{
/* 0: PD_ROLE_SINK, 1: PD_ROLE_SOURCE */
if (power_role == PD_ROLE_SOURCE) {
@@ -392,7 +391,7 @@ static void it83xx_set_power_role(enum usbpd_port port, int power_role)
}
}
-static void it83xx_set_data_role(enum usbpd_port port, int data_role)
+static void it8xxx2_set_data_role(enum usbpd_port port, int data_role)
{
/* 0: PD_ROLE_UFP 1: PD_ROLE_DFP */
if (data_role == PD_ROLE_DFP)
@@ -403,8 +402,8 @@ static void it83xx_set_data_role(enum usbpd_port port, int data_role)
IT83XX_USBPD_MHSR0(port) &= ~USBPD_REG_MASK_SOP_PORT_DATA_ROLE;
}
-static void it83xx_select_polarity(enum usbpd_port port,
- enum usbpd_cc_pin cc_pin)
+static void it8xxx2_select_polarity(enum usbpd_port port,
+ enum usbpd_cc_pin cc_pin)
{
/* CC1/CC2 selection */
if (cc_pin == USBPD_CC_PIN_1)
@@ -413,16 +412,16 @@ static void it83xx_select_polarity(enum usbpd_port port,
IT83XX_USBPD_CCGCR(port) &= ~USBPD_REG_MASK_CC1_CC2_SELECTION;
}
-static int it83xx_set_cc(enum usbpd_port port, int pull)
+static int it8xxx2_set_cc(enum usbpd_port port, int pull)
{
int enable_cc = 1;
switch (pull) {
case TYPEC_CC_RD:
- it83xx_set_power_role(port, PD_ROLE_SINK);
+ it8xxx2_set_power_role(port, PD_ROLE_SINK);
break;
case TYPEC_CC_RP:
- it83xx_set_power_role(port, PD_ROLE_SOURCE);
+ it8xxx2_set_power_role(port, PD_ROLE_SOURCE);
break;
case TYPEC_CC_OPEN:
/* Power-down CC1 & CC2 to remove Rp/Rd */
@@ -432,25 +431,26 @@ static int it83xx_set_cc(enum usbpd_port port, int pull)
return EC_ERROR_UNIMPLEMENTED;
}
- it83xx_enable_cc(port, enable_cc);
+ it8xxx2_enable_cc(port, enable_cc);
return EC_SUCCESS;
}
-static int it83xx_tcpm_release(int port)
+static int it8xxx2_tcpm_release(int port)
{
return EC_ERROR_UNIMPLEMENTED;
}
-static int it83xx_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1,
- enum tcpc_cc_voltage_status *cc2)
+static int it8xxx2_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);
+ *cc2 = it8xxx2_get_cc(port, USBPD_CC_PIN_2);
+ *cc1 = it8xxx2_get_cc(port, USBPD_CC_PIN_1);
return EC_SUCCESS;
}
-static int it83xx_tcpm_select_rp_value(int port, int rp_sel)
+static int it8xxx2_tcpm_select_rp_value(int port, int rp_sel)
{
uint8_t rp;
@@ -478,24 +478,24 @@ static int it83xx_tcpm_select_rp_value(int port, int rp_sel)
return EC_SUCCESS;
}
-static int it83xx_tcpm_set_cc(int port, int pull)
+static int it8xxx2_tcpm_set_cc(int port, int pull)
{
- return it83xx_set_cc(port, pull);
+ return it8xxx2_set_cc(port, pull);
}
-static int it83xx_tcpm_set_polarity(int port, enum tcpc_cc_polarity polarity)
+static int it8xxx2_tcpm_set_polarity(int port, enum tcpc_cc_polarity polarity)
{
enum usbpd_cc_pin cc_pin =
(polarity == POLARITY_CC1 || polarity == POLARITY_CC1_DTS) ?
USBPD_CC_PIN_1 : USBPD_CC_PIN_2;
- it83xx_select_polarity(port, cc_pin);
+ it8xxx2_select_polarity(port, cc_pin);
return EC_SUCCESS;
}
-__maybe_unused static int it83xx_tcpm_decode_sop_prime_enable(int port,
- bool enable)
+__maybe_unused static int it8xxx2_tcpm_decode_sop_prime_enable(int port,
+ bool enable)
{
/* Save SOP'/SOP'' enable state */
sop_prime_en[port] = enable;
@@ -515,10 +515,10 @@ __maybe_unused static int it83xx_tcpm_decode_sop_prime_enable(int port,
return EC_SUCCESS;
}
-static int it83xx_tcpm_set_vconn(int port, int enable)
+static int it8xxx2_tcpm_set_vconn(int port, int enable)
{
/*
- * IT83XX doesn't have integrated circuit to source CC lines for VCONN.
+ * IT8xxx2 doesn't have integrated circuit to source CC lines for VCONN.
* An external device like PPC or Power Switch has to source the VCONN.
*/
if (IS_ENABLED(CONFIG_USBC_VCONN)) {
@@ -527,11 +527,11 @@ static int it83xx_tcpm_set_vconn(int port, int enable)
* Unused cc will become Vconn SRC, disable cc analog
* module (ex.UP/RD/DET/Tx/Rx) and enable 5v tolerant.
*/
- it83xx_enable_vconn(port, enable);
+ it8xxx2_enable_vconn(port, enable);
if (IS_ENABLED(CONFIG_USB_PD_DECODE_SOP))
/* Enable tcpc receive SOP' and SOP'' packet */
- it83xx_tcpm_decode_sop_prime_enable(port,
- true);
+ it8xxx2_tcpm_decode_sop_prime_enable(port,
+ true);
}
/* Turn on/off vconn power switch. */
board_pd_vconn_ctrl(port,
@@ -540,8 +540,8 @@ static int it83xx_tcpm_set_vconn(int port, int enable)
if (!enable) {
if (IS_ENABLED(CONFIG_USB_PD_DECODE_SOP))
/* Disable tcpc receive SOP' and SOP'' packet */
- it83xx_tcpm_decode_sop_prime_enable(port,
- false);
+ it8xxx2_tcpm_decode_sop_prime_enable(port,
+ false);
/*
* We need to make sure cc voltage detector is enabled
* after vconn is turned off to avoid the potential risk
@@ -552,14 +552,14 @@ static int it83xx_tcpm_set_vconn(int port, int enable)
* Since our cc are not Vconn SRC, enable cc analog
* module (ex.UP/RD/DET/Tx/Rx) and disable 5v tolerant.
*/
- it83xx_enable_vconn(port, enable);
+ it8xxx2_enable_vconn(port, enable);
}
}
return EC_SUCCESS;
}
-static int it83xx_tcpm_set_msg_header(int port, int power_role, int data_role)
+static int it8xxx2_tcpm_set_msg_header(int port, int power_role, int data_role)
{
/* 0: PD_ROLE_SINK, 1: PD_ROLE_SOURCE */
if (power_role == PD_ROLE_SOURCE)
@@ -569,12 +569,12 @@ static int it83xx_tcpm_set_msg_header(int port, int power_role, int data_role)
/* Bit0: sink */
IT83XX_USBPD_MHSR1(port) &= ~USBPD_REG_MASK_SOP_PORT_POWER_ROLE;
- it83xx_set_data_role(port, data_role);
+ it8xxx2_set_data_role(port, data_role);
return EC_SUCCESS;
}
-static int it83xx_tcpm_set_rx_enable(int port, int enable)
+static int it8xxx2_tcpm_set_rx_enable(int port, int enable)
{
/* Save rx_on */
rx_en[port] = !!enable;
@@ -585,8 +585,8 @@ static int it83xx_tcpm_set_rx_enable(int port, int enable)
(USBPD_REG_MASK_SOP_RX_ENABLE |
USBPD_REG_MASK_HARD_RESET_RX_ENABLE);
if (IS_ENABLED(CONFIG_USB_PD_DECODE_SOP))
- it83xx_tcpm_decode_sop_prime_enable(port,
- sop_prime_en[port]);
+ it8xxx2_tcpm_decode_sop_prime_enable(port,
+ sop_prime_en[port]);
} else {
IT83XX_USBPD_IMR(port) |= USBPD_REG_MASK_MSG_RX_DONE;
IT83XX_USBPD_PDCSR1(port) &= ~(USBPD_REG_MASK_SOP_RX_ENABLE |
@@ -598,10 +598,10 @@ static int it83xx_tcpm_set_rx_enable(int port, int enable)
return EC_SUCCESS;
}
-static int it83xx_tcpm_transmit(int port,
- enum tcpm_transmit_type type,
- uint16_t header,
- const uint32_t *data)
+static int it8xxx2_tcpm_transmit(int port,
+ enum tcpm_transmit_type type,
+ uint16_t header,
+ const uint32_t *data)
{
int status = TCPC_TX_COMPLETE_FAILED;
@@ -611,20 +611,20 @@ static int it83xx_tcpm_transmit(int port,
case TCPC_TX_SOP_PRIME_PRIME:
case TCPC_TX_SOP_DEBUG_PRIME:
case TCPC_TX_SOP_DEBUG_PRIME_PRIME:
- status = it83xx_tx_data(port,
- type,
- header,
- data);
+ status = it8xxx2_tx_data(port,
+ type,
+ header,
+ data);
break;
case TCPC_TX_BIST_MODE_2:
- it83xx_send_bist_mode2_pattern(port);
+ it8xxx2_send_bist_mode2_pattern(port);
status = TCPC_TX_COMPLETE_SUCCESS;
break;
case TCPC_TX_HARD_RESET:
- status = it83xx_send_hw_reset(port);
+ status = it8xxx2_send_hw_reset(port);
break;
case TCPC_TX_CABLE_RESET:
- status = it83xx_send_cable_reset(port);
+ status = it8xxx2_send_cable_reset(port);
break;
default:
status = TCPC_TX_COMPLETE_FAILED;
@@ -635,7 +635,7 @@ static int it83xx_tcpm_transmit(int port,
return EC_SUCCESS;
}
-static int it83xx_tcpm_get_chip_info(int port, int live,
+static int it8xxx2_tcpm_get_chip_info(int port, int live,
struct ec_response_pd_chip_info_v1 *chip_info)
{
chip_info->vendor_id = USB_VID_ITE;
@@ -648,11 +648,11 @@ static int it83xx_tcpm_get_chip_info(int port, int live,
}
#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
-static int it83xx_tcpm_enter_low_power_mode(int port)
+static int it8xxx2_tcpm_enter_low_power_mode(int port)
{
/*
* ITE embedded TCPC SLEEP_MASK_USB_PD flag is only controlled by
- * it83xx driver in it8xxx2_set_pd_sleep_mask(), and do low power
+ * it8xxx2 driver in it8xxx2_set_pd_sleep_mask(), and do low power
* mode in idle_task().
* In deep sleep mode, ITE TCPC clock is turned off, and the
* timer every 5ms to exit the mode and wakeup PD task to run
@@ -663,7 +663,7 @@ static int it83xx_tcpm_enter_low_power_mode(int port)
#endif
#ifdef CONFIG_USB_PD_FRS_TCPC
-static int it83xx_tcpm_set_frs_enable(int port, int enable)
+static int it8xxx2_tcpm_set_frs_enable(int port, int enable)
{
uint8_t mask = (USBPD_REG_FAST_SWAP_REQUEST_ENABLE |
USBPD_REG_FAST_SWAP_DETECT_ENABLE);
@@ -704,12 +704,12 @@ static int it83xx_tcpm_set_frs_enable(int port, int enable)
}
#endif
-static void it83xx_tcpm_switch_plug_out_type(int port)
+static void it8xxx2_tcpm_switch_plug_out_type(int port)
{
enum tcpc_cc_voltage_status cc1, cc2;
/* Check what do we and partner cc assert */
- it83xx_tcpm_get_cc(port, &cc1, &cc2);
+ it8xxx2_tcpm_get_cc(port, &cc1, &cc2);
if ((cc1 == TYPEC_CC_VOLT_RD && cc2 == TYPEC_CC_VOLT_RD) ||
(cc1 == TYPEC_CC_VOLT_RA && cc2 == TYPEC_CC_VOLT_RA))
@@ -740,10 +740,10 @@ static void it83xx_tcpm_switch_plug_out_type(int port)
void switch_plug_out_type(enum usbpd_port port)
{
- it83xx_tcpm_switch_plug_out_type(port);
+ it8xxx2_tcpm_switch_plug_out_type(port);
}
-static void it83xx_init(enum usbpd_port port, int role)
+static void it8xxx2_init(enum usbpd_port port, int role)
{
uint8_t cc_config = (port == USBPD_PORT_C ?
IT83XX_USBPD_CC_PIN_CONFIG2 :
@@ -764,7 +764,7 @@ static void it83xx_init(enum usbpd_port port, int role)
IT83XX_USBPD_PDCSR0(port) = (IT83XX_USBPD_PDCSR0(port) & ~0xC0) |
(CONFIG_PD_RETRY_COUNT << 6);
/* Disable Rx decode */
- it83xx_tcpm_set_rx_enable(port, 0);
+ it8xxx2_tcpm_set_rx_enable(port, 0);
/* Disable all interrupts */
IT83XX_USBPD_IMR(port) = 0xff;
/* W/C status */
@@ -772,15 +772,15 @@ static void it83xx_init(enum usbpd_port port, int role)
/* Enable cc voltage detector */
IT83XX_USBPD_CCGCR(port) &= ~USBPD_REG_MASK_DISABLE_CC_VOL_DETECTOR;
/* Select Rp value USB-DEFAULT (Rd value default connect with 5.1k) */
- it83xx_tcpm_select_rp_value(port, TYPEC_RP_USB);
+ it8xxx2_tcpm_select_rp_value(port, TYPEC_RP_USB);
/* Which cc pin connect in attached state. Default to cc1 */
- it83xx_select_polarity(port, USBPD_CC_PIN_1);
+ it8xxx2_select_polarity(port, USBPD_CC_PIN_1);
/* Change data role as the same power role */
- it83xx_set_data_role(port, role);
+ it8xxx2_set_data_role(port, role);
/* Set default power role and assert Rp/Rd */
- it83xx_set_power_role(port, role);
+ it8xxx2_set_power_role(port, role);
/* Disable vconn: connect cc analog module, disable cc 5v tolerant */
- it83xx_enable_vconn(port, 0);
+ it8xxx2_enable_vconn(port, 0);
/* Enable tx done and hard reset detect interrupt */
IT83XX_USBPD_IMR(port) &= ~(USBPD_REG_MASK_MSG_TX_DONE |
USBPD_REG_MASK_HARD_RESET_DETECT);
@@ -811,10 +811,10 @@ static void it83xx_init(enum usbpd_port port, int role)
USBPD_REG_MASK_DISCONNECT_5_1K_CC1_DB);
}
-static int it83xx_tcpm_init(int port)
+static int it8xxx2_tcpm_init(int port)
{
/* Initialize physical layer */
- it83xx_init(port, PD_ROLE_DEFAULT(port));
+ it8xxx2_init(port, PD_ROLE_DEFAULT(port));
return EC_SUCCESS;
}
@@ -856,7 +856,7 @@ static void it8xxx2_set_pd_sleep_mask(int port)
}
#ifdef CONFIG_USB_PD_TCPMV2
-static void it83xx_tcpm_hook_connect(void)
+static void it8xxx2_tcpm_hook_connect(void)
{
int port = TASK_ID_TO_PD_PORT(task_get_current());
@@ -877,17 +877,17 @@ static void it83xx_tcpm_hook_connect(void)
* fire for 3), 4), 5) cases, then set correctly for the SRC detect plug
* out or the SNK disable detect, so TCPMv1 needn't hook connection.
*/
- it83xx_tcpm_switch_plug_out_type(port);
+ it8xxx2_tcpm_switch_plug_out_type(port);
/* Enable PD PHY Tx and Rx module since type-c has connected. */
USBPD_ENABLE_BMC_PHY(port);
it8xxx2_set_pd_sleep_mask(port);
}
-DECLARE_HOOK(HOOK_USB_PD_CONNECT, it83xx_tcpm_hook_connect, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_USB_PD_CONNECT, it8xxx2_tcpm_hook_connect, HOOK_PRIO_DEFAULT);
#endif
-static void it83xx_tcpm_sw_reset(void)
+static void it8xxx2_tcpm_hook_disconnect(void)
{
int port = TASK_ID_TO_PD_PORT(task_get_current());
@@ -913,31 +913,32 @@ static void it83xx_tcpm_sw_reset(void)
it8xxx2_set_pd_sleep_mask(port);
}
-DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, it83xx_tcpm_sw_reset, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, it8xxx2_tcpm_hook_disconnect,
+ HOOK_PRIO_DEFAULT);
const struct tcpm_drv it83xx_tcpm_drv = {
- .init = &it83xx_tcpm_init,
- .release = &it83xx_tcpm_release,
- .get_cc = &it83xx_tcpm_get_cc,
- .select_rp_value = &it83xx_tcpm_select_rp_value,
- .set_cc = &it83xx_tcpm_set_cc,
- .set_polarity = &it83xx_tcpm_set_polarity,
+ .init = &it8xxx2_tcpm_init,
+ .release = &it8xxx2_tcpm_release,
+ .get_cc = &it8xxx2_tcpm_get_cc,
+ .select_rp_value = &it8xxx2_tcpm_select_rp_value,
+ .set_cc = &it8xxx2_tcpm_set_cc,
+ .set_polarity = &it8xxx2_tcpm_set_polarity,
#ifdef CONFIG_USB_PD_DECODE_SOP
- .sop_prime_enable = &it83xx_tcpm_decode_sop_prime_enable,
+ .sop_prime_enable = &it8xxx2_tcpm_decode_sop_prime_enable,
#endif
- .set_vconn = &it83xx_tcpm_set_vconn,
- .set_msg_header = &it83xx_tcpm_set_msg_header,
- .set_rx_enable = &it83xx_tcpm_set_rx_enable,
- .get_message_raw = &it83xx_tcpm_get_message_raw,
- .transmit = &it83xx_tcpm_transmit,
+ .set_vconn = &it8xxx2_tcpm_set_vconn,
+ .set_msg_header = &it8xxx2_tcpm_set_msg_header,
+ .set_rx_enable = &it8xxx2_tcpm_set_rx_enable,
+ .get_message_raw = &it8xxx2_tcpm_get_message_raw,
+ .transmit = &it8xxx2_tcpm_transmit,
#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
.drp_toggle = NULL,
#endif
- .get_chip_info = &it83xx_tcpm_get_chip_info,
+ .get_chip_info = &it8xxx2_tcpm_get_chip_info,
#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
- .enter_low_power_mode = &it83xx_tcpm_enter_low_power_mode,
+ .enter_low_power_mode = &it8xxx2_tcpm_enter_low_power_mode,
#endif
#ifdef CONFIG_USB_PD_FRS_TCPC
- .set_frs_enable = &it83xx_tcpm_set_frs_enable,
+ .set_frs_enable = &it8xxx2_tcpm_set_frs_enable,
#endif
};