summaryrefslogtreecommitdiff
path: root/driver/ppc/rt1739.h
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2022-04-15 14:22:06 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-28 04:35:00 +0000
commitfa68a7b18dc88304a49f922554c0adbb6a994190 (patch)
treed363c5e6b8d842fbf724b37a53f664c972a9867c /driver/ppc/rt1739.h
parentf421dae42d893c97fb41f8a2fb4731d2ba2c89c9 (diff)
downloadchrome-ec-fa68a7b18dc88304a49f922554c0adbb6a994190.tar.gz
rt1739: more workaround at init
Fix the VBUS to VIN_LV leakage and Sink OCP as described in b:228941287 comment#4 BUG=b:228941287 TEST=manually BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ic90b297df7f797b0c43a7b91163cbf5033168351 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3588077 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'driver/ppc/rt1739.h')
-rw-r--r--driver/ppc/rt1739.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/driver/ppc/rt1739.h b/driver/ppc/rt1739.h
index ed16942ec1..2f9b196011 100644
--- a/driver/ppc/rt1739.h
+++ b/driver/ppc/rt1739.h
@@ -47,6 +47,10 @@
#define RT1739_HV_SRC_EN BIT(1)
#define RT1739_HV_SNK_EN BIT(0)
+#define RT1739_REG_VBUS_CTRL1 0x23
+#define RT1739_HVLV_SCP_EN BIT(1)
+#define RT1739_HVLV_OCRC_EN BIT(0)
+
#define RT1739_REG_VBUS_OV_SETTING 0x24
#define RT1739_VBUS_OVP_SEL_SHIFT 0
@@ -61,16 +65,17 @@
#define RT1739_REG_VBUS_OC_SETTING 0x25
-#define RT1739_LV_SRC_OCP_SEL_SHIFT 4
-#define RT1739_LV_SRC_OCP_SEL_1_25A 0
-#define RT1739_LV_SRC_OCP_SEL_1_75A 1
-#define RT1739_LV_SRC_OCP_SEL_2_25A 2
-#define RT1739_LV_SRC_OCP_SEL_3_3A 3
-
-#define RT1739_HV_SINK_OCP_SEL_SHIFT 0
-#define RT1739_HV_SINK_OCP_SEL_1_25A 0
-#define RT1739_HV_SINK_OCP_SEL_1_75A 1
-#define RT1739_HV_SINK_OCP_SEL_3_3A 2
+#define RT1739_LV_SRC_OCP_SHIFT 4
+#define RT1739_LV_SRC_OCP_SEL_1_25A (0 << RT1739_LV_SRC_OCP_SHIFT)
+#define RT1739_LV_SRC_OCP_SEL_1_75A (1 << RT1739_LV_SRC_OCP_SHIFT)
+#define RT1739_LV_SRC_OCP_SEL_2_25A (2 << RT1739_LV_SRC_OCP_SHIFT)
+#define RT1739_LV_SRC_OCP_SEL_3_3A (3 << RT1739_LV_SRC_OCP_SHIFT)
+
+#define RT1739_HV_SINK_OCP_SHIFT 0
+#define RT1739_HV_SINK_OCP_SEL_1_25A (0 << RT1739_HV_SINK_OCP_SHIFT)
+#define RT1739_HV_SINK_OCP_SEL_1_75A (1 << RT1739_HV_SINK_OCP_SHIFT)
+#define RT1739_HV_SINK_OCP_SEL_3_3A (2 << RT1739_HV_SINK_OCP_SHIFT)
+#define RT1739_HV_SINK_OCP_SEL_5_5A (3 << RT1739_HV_SINK_OCP_SHIFT)
#define RT1739_VBUS_FAULT_DIS 0x26
#define RT1739_OVP_DISVBUS_EN BIT(6)