summaryrefslogtreecommitdiff
path: root/driver/ppc/rt1739.h
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2023-03-09 15:15:46 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-13 08:59:58 +0000
commite0bd01f81c927758aa43d469338e19c4c9c47952 (patch)
tree8b3eecf88dd9ea35e24385eff4be6e63d88382a0 /driver/ppc/rt1739.h
parent142a8521b5c335a7ae75ec8405ba00cc7269252f (diff)
downloadchrome-ec-e0bd01f81c927758aa43d469338e19c4c9c47952.tar.gz
rt1739: implement set_vbus_source_current_limit
Implements set_vbus_source_current_limit and initialize source ocp level to a proper limit based on RP config. BUG=b:271942294 TEST=On geralt, `i2c read_byte i2c@f01cc0 0x70 0x25` returns 0x12 BRANCH=none LOW_COVERAGE_REASON=early bringup Change-Id: I583ec6101939410e29bf0a537637263ac5780dd6 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4323579 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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/driver/ppc/rt1739.h b/driver/ppc/rt1739.h
index 620045ef40..9fab34229e 100644
--- a/driver/ppc/rt1739.h
+++ b/driver/ppc/rt1739.h
@@ -67,6 +67,7 @@
#define RT1739_REG_VBUS_OC_SETTING 0x25
#define RT1739_LV_SRC_OCP_SHIFT 4
+#define RT1739_LV_SRC_OCP_MASK (3 << RT1739_LV_SRC_OCP_SHIFT)
#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)