summaryrefslogtreecommitdiff
path: root/chip/it83xx/registers.h
diff options
context:
space:
mode:
Diffstat (limited to 'chip/it83xx/registers.h')
-rw-r--r--chip/it83xx/registers.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/chip/it83xx/registers.h b/chip/it83xx/registers.h
index a62753c9b1..b91c18817e 100644
--- a/chip/it83xx/registers.h
+++ b/chip/it83xx/registers.h
@@ -1174,6 +1174,20 @@ enum i2c_channels {
#define IT83XX_USBPD_CCGCR(p) REG8(IT83XX_USBPD_BASE(p)+0x04)
#define USBPD_REG_MASK_DISABLE_CC (1 << 4)
#define IT83XX_USBPD_CCCSR(p) REG8(IT83XX_USBPD_BASE(p)+0x05)
+#ifdef IT83XX_USBPD_CC_VOLTAGE_DETECTOR_INDEPENDENT
+#define IT83XX_USBPD_REG_MASK_CC1_DISCONNECT ((1 << 3) | (1 << 1))
+#define IT83XX_USBPD_REG_MASK_CC2_DISCONNECT ((1 << 7) | (1 << 5))
+#else
+#define IT83XX_USBPD_REG_MASK_CC1_DISCONNECT (1 << 3)
+#define IT83XX_USBPD_REG_MASK_CC2_DISCONNECT (1 << 7)
+#endif
+#define USBPD_CC1_DISCONNECTED(p) \
+ ((IT83XX_USBPD_CCCSR(p) | IT83XX_USBPD_REG_MASK_CC1_DISCONNECT) & \
+ ~IT83XX_USBPD_REG_MASK_CC2_DISCONNECT)
+#define USBPD_CC2_DISCONNECTED(p) \
+ ((IT83XX_USBPD_CCCSR(p) | IT83XX_USBPD_REG_MASK_CC2_DISCONNECT) & \
+ ~IT83XX_USBPD_REG_MASK_CC1_DISCONNECT)
+
#define IT83XX_USBPD_CCPSR(p) REG8(IT83XX_USBPD_BASE(p)+0x06)
#define USBPD_REG_MASK_DISCONNECT_POWER_CC2 (1 << 5)
#define USBPD_REG_MASK_DISCONNECT_POWER_CC1 (1 << 1)