summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorxiong.huang <xiong.huang@bitland.com.cn>2018-11-20 16:35:21 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-23 00:12:14 +0000
commitccb1f9f9f1c569f4f4d562809915daea2b5bdd2e (patch)
tree8f50b8be826e2676899cf5d86dbb3235e6c485dd /driver
parent74b9b89fc378cf1453696d42f8b66a82efdb6fca (diff)
downloadchrome-ec-ccb1f9f9f1c569f4f4d562809915daea2b5bdd2e.tar.gz
driver/anx7447: Modify Vconn SW protection time of inrush current and power SW short protect current.
The default values of Vconn SW protection time of inrush current is 19us and power SW short protect current is 370mA, it finds that the current of Vconn will up to 656mA during press F3+power button with Huawei dongle plugged in MB, then Vconn will drop when the large current happen. Vendor suggest to adjust Vconn SW protection time of inrush current(modify register 0xAA from 19us to 2.43ms) and power SW short protect current(modify register 0xA8 from 370mA to 440mA). BUG=b:119540455 BRANCH=none TEST=The HDMI display well with Huawei dongle at MB side when pressing F3+ power button to reboot OS. Change-Id: Ibb7e602fc4a4aa9cb69231a7f199f4ea31265148 Reviewed-on: https://chromium-review.googlesource.com/1343643 Commit-Ready: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Tested-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1767503 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'driver')
-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.