summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxiong.huang <xiong.huang@bitland.com.cn>2018-11-20 16:35:21 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-26 20:31:23 -0800
commitcc5eff10d44e5c29fe98c5845dc1a57ce9d635eb (patch)
tree3ba91706bc08171698bebb7fdf22075ec24d6923
parent30d83c473e545ca4495ef4118f81a23735a5d4d5 (diff)
downloadchrome-ec-cc5eff10d44e5c29fe98c5845dc1a57ce9d635eb.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>
-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.