summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/it83xx/clock.c2
-rw-r--r--driver/tcpm/it83xx.c32
-rw-r--r--driver/tcpm/it83xx_pd.h4
-rw-r--r--driver/tcpm/it8xxx2.c2
4 files changed, 25 insertions, 15 deletions
diff --git a/chip/it83xx/clock.c b/chip/it83xx/clock.c
index 25486c1e3b..d38197379a 100644
--- a/chip/it83xx/clock.c
+++ b/chip/it83xx/clock.c
@@ -515,7 +515,7 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
* Rd_DB) alive in hibernate for better power consumption.
*/
for (i = 0; i < CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT; i++)
- it83xx_disable_pd_module(i);
+ it83xx_Rd_5_1K_only_for_hibernate(i);
}
if (IS_ENABLED(CONFIG_ADC_VOLTAGE_COMPARATOR)) {
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c
index 8e6abbc15b..3327cfdfed 100644
--- a/driver/tcpm/it83xx.c
+++ b/driver/tcpm/it83xx.c
@@ -47,22 +47,34 @@ const struct usbpd_ctrl_t usbpd_ctrl_regs[] = {
BUILD_ASSERT(ARRAY_SIZE(usbpd_ctrl_regs) == IT83XX_USBPD_PHY_PORT_COUNT);
/*
- * This function disables integrated pd module and enables 5.1K resistor for
- * dead battery. A EC reset or calling _init() is able to re-active pd module.
+ * Disable cc analog and pd digital module, but only left Rd_5.1K (Not
+ * Dead Battery) analog module alive to assert Rd on CCs. EC reset or
+ * calling _init() are able to re-active cc and pd.
*/
-void it83xx_disable_pd_module(int port)
+void it83xx_Rd_5_1K_only_for_hibernate(int port)
{
- /* This only apply to PD port. */
+ /* This only apply to active PD port */
if (*usbpd_ctrl_regs[port].cc1 == IT83XX_USBPD_CC_PIN_CONFIG &&
*usbpd_ctrl_regs[port].cc2 == IT83XX_USBPD_CC_PIN_CONFIG) {
/* Disable PD PHY */
IT83XX_USBPD_GCR(port) &= ~(BIT(0) | BIT(4));
- /* Power down CC1/CC2 */
- IT83XX_USBPD_CCGCR(port) |= 0x1f;
- /* Disable CC1/CC2 voltage detector */
- IT83XX_USBPD_CCCSR(port) = 0xff;
- /* Connect 5.1K resistor to CC1/CC2 for dead battery. */
- IT83XX_USBPD_CCPSR(port) = 0x33;
+ /*
+ * Disable CCs voltage detector, and
+ * connect CCs analog module (ex.UP/RD/DET/TX/RX), and
+ * connect CCs 5.1K to GND
+ */
+ IT83XX_USBPD_CCCSR(port) = 0x22;
+ /* Disconnect CCs 5V tolerant */
+ IT83XX_USBPD_CCPSR(port) |=
+ (USBPD_REG_MASK_DISCONNECT_POWER_CC2 |
+ USBPD_REG_MASK_DISCONNECT_POWER_CC1);
+ /*
+ * Select Rp reserved value for not current leakage, and
+ * CCs assert Rd, and
+ * enable CCs analog module
+ */
+ IT83XX_USBPD_BMCSR(port) &= ~0x08;
+ IT83XX_USBPD_CCGCR(port) &= ~0x1f;
}
}
diff --git a/driver/tcpm/it83xx_pd.h b/driver/tcpm/it83xx_pd.h
index aac418f791..b04570a65d 100644
--- a/driver/tcpm/it83xx_pd.h
+++ b/driver/tcpm/it83xx_pd.h
@@ -398,9 +398,7 @@ struct usbpd_ctrl_t {
extern const struct usbpd_ctrl_t usbpd_ctrl_regs[];
extern const struct tcpm_drv it83xx_tcpm_drv;
-/* Disable cc module */
-void it83xx_disable_cc_module(int port);
-void it83xx_disable_pd_module(int port);
+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);
diff --git a/driver/tcpm/it8xxx2.c b/driver/tcpm/it8xxx2.c
index 321f9c0633..50339393f6 100644
--- a/driver/tcpm/it8xxx2.c
+++ b/driver/tcpm/it8xxx2.c
@@ -55,7 +55,7 @@ BUILD_ASSERT(ARRAY_SIZE(usbpd_ctrl_regs) >= IT83XX_USBPD_PHY_PORT_COUNT);
* Rd_DB) analog module alive to assert Rd on CCs. EC reset or calling
* _init() are able to re-active cc and pd.
*/
-void it83xx_disable_pd_module(int port)
+void it83xx_Rd_5_1K_only_for_hibernate(int port)
{
uint8_t cc_config = (port == USBPD_PORT_C ?
IT83XX_USBPD_CC_PIN_CONFIG2 :