summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/tcpm/anx7447.c10
-rw-r--r--driver/tcpm/anx7447.h11
2 files changed, 20 insertions, 1 deletions
diff --git a/driver/tcpm/anx7447.c b/driver/tcpm/anx7447.c
index 37e1342afa..de19f008eb 100644
--- a/driver/tcpm/anx7447.c
+++ b/driver/tcpm/anx7447.c
@@ -340,9 +340,17 @@ static int anx7447_init(int port)
if (rv)
return rv;
reg &= ~ANX7447_REG_VCONN_OCP_MASK;
- reg |= ANX7447_REG_VCONN_OCP_370mA;
+ reg |= ANX7447_REG_VCONN_OCP_440mA;
rv = tcpc_write(port, ANX7447_REG_ANALOG_CTRL_8, reg);
+ /* Vconn SW protection time of inrush current */
+ rv = tcpc_read(port, ANX7447_REG_ANALOG_CTRL_10, &reg);
+ if (rv)
+ return rv;
+ reg &= ~ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_MASK;
+ reg |= ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_2430US;
+ rv = tcpc_write(port, ANX7447_REG_ANALOG_CTRL_10, reg);
+
/* init hpd status */
anx7447_hpd_mode_en(port);
anx7447_set_hpd_level(port, 0);
diff --git a/driver/tcpm/anx7447.h b/driver/tcpm/anx7447.h
index 3f4947a556..093d74238a 100644
--- a/driver/tcpm/anx7447.h
+++ b/driver/tcpm/anx7447.h
@@ -38,6 +38,17 @@
#define ANX7447_REG_VCONN_OCP_370mA 0x08
#define ANX7447_REG_VCONN_OCP_440mA 0x0C
+#define ANX7447_REG_ANALOG_CTRL_10 0xAA
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_MASK 0x38
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_19US 0x00
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_38US 0x08
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_76US 0x10
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_152US 0x18
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_303US 0x20
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_607US 0x28
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_1210US 0x30
+#define ANX7447_REG_R_VCONN_PWR_PRT_INRUSH_TIME_2430US 0x38
+
/*
* This section of defines are only required to support the config option
* CONFIG_USB_PD_TCPM_ANX7447_OCM_ERASE_COMMAND.