summaryrefslogtreecommitdiff
path: root/driver/tcpm/anx74xx.h
diff options
context:
space:
mode:
Diffstat (limited to 'driver/tcpm/anx74xx.h')
-rw-r--r--driver/tcpm/anx74xx.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/driver/tcpm/anx74xx.h b/driver/tcpm/anx74xx.h
index fcbd38fe41..127af4e0b5 100644
--- a/driver/tcpm/anx74xx.h
+++ b/driver/tcpm/anx74xx.h
@@ -63,10 +63,22 @@
#define ANX74XX_REG_CC_PULL_RP 0x02
-#define ANX74XX_REG_TX_AUTO_GOODCRC_1 0x9c
#define ANX74XX_REG_TX_AUTO_GOODCRC_2 0x94
-#define ANX74XX_REG_AUTO_GOODCRC_EN 0x01
-#define ANX74XX_REG_ENABLE_GOODCRC 0x38
+#define ANX74XX_REG_REPLY_SOP_EN (1 << 3)
+#define ANX74XX_REG_REPLY_SOP_1_EN (1 << 4)
+#define ANX74XX_REG_REPLY_SOP_2_EN (1 << 5)
+
+#define ANX74XX_REG_TX_AUTO_GOODCRC_1 0x9c
+#define ANX74XX_REG_SPEC_REV_BIT_POS (3)
+#define ANX74XX_REG_DATA_ROLE_BIT_POS (2)
+#define ANX74XX_REG_PWR_ROLE_BIT_POS (1)
+#define ANX74XX_REG_AUTO_GOODCRC_EN (1 << 0)
+#define ANX74XX_REG_AUTO_GOODCRC_SET(drole, prole) \
+ ((PD_REV20 << ANX74XX_REG_SPEC_REV_BIT_POS) | \
+ ((drole) << ANX74XX_REG_DATA_ROLE_BIT_POS) | \
+ ((prole) << ANX74XX_REG_PWR_ROLE_BIT_POS) | \
+ ANX74XX_REG_AUTO_GOODCRC_EN)
+
#define ANX74XX_REG_ANALOG_CTRL_0 0x41
#define ANX74XX_REG_R_PIN_CABLE_DET (1 << 7)
@@ -150,11 +162,6 @@
#define ANX74XX_REG_HPD_DEFAULT 0x00
#define ANX74XX_REG_HPD_OUT_DATA 0x10
-#define ANX74XX_REG_TX_MSG_HEADER 0x9c
-#define ANX74XX_REG_SPEC_REV_BIT_POS (3)
-#define ANX74XX_REG_PWR_ROLE_BIT_POS (2)
-#define ANX74XX_REG_DATA_ROLE_BIT_POS (1)
-
#define ANX74XX_REG_RECVD_MSG_INT 0x98
#define ANX74XX_REG_CC_STATUS 0x99
#define ANX74XX_REG_CTRL_FW 0x2E