summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortony.tang <tony.tang@lcfc.corp-partner.google.com>2023-01-11 18:04:06 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-30 02:53:34 +0000
commit4527f51ccb9c23247f7725fa5f181756850eb7d1 (patch)
tree3f41bad74280437419b915fbe44fbf1b3abf7979
parent0f6aa56d2852e927ba94fbd2f91e5499c1479dad (diff)
downloadchrome-ec-4527f51ccb9c23247f7725fa5f181756850eb7d1.tar.gz
RAA489000: support modify OCP level margin
support modify OCP level margin BUG=b:263996465 BRANCH=none TEST=zmake build pujjo Change-Id: I53a88053b0d1fee80b0e53c0e6bd7ece671b3c67 Signed-off-by: tony.tang <tony.tang@lcfc.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4154456 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
-rw-r--r--driver/tcpm/raa489000.h5
-rw-r--r--zephyr/Kconfig.tcpm14
2 files changed, 19 insertions, 0 deletions
diff --git a/driver/tcpm/raa489000.h b/driver/tcpm/raa489000.h
index 41a37f94e7..b0bb202f98 100644
--- a/driver/tcpm/raa489000.h
+++ b/driver/tcpm/raa489000.h
@@ -39,7 +39,12 @@
/* VBUS_OCP_UV_THRESHOLD */
/* Detect voltage level of overcurrent protection during Sourcing VBUS */
+#ifdef CONFIG_PLATFORM_EC_RAA489000_OCP_UV_THRESHOLD_MV
+#define RAA489000_OCP_THRESHOLD_VALUE \
+ (CONFIG_PLATFORM_EC_RAA489000_OCP_UV_THRESHOLD_MV / 25)
+#else
#define RAA489000_OCP_THRESHOLD_VALUE 0x00BE /* 4.75V */
+#endif
/* TYPEC_SETTING1 - only older silicon */
/* Enables for reverse current protection */
diff --git a/zephyr/Kconfig.tcpm b/zephyr/Kconfig.tcpm
index d2783e9f0a..6651336954 100644
--- a/zephyr/Kconfig.tcpm
+++ b/zephyr/Kconfig.tcpm
@@ -236,6 +236,20 @@ config PLATFORM_EC_USB_PD_TCPM_RAA489000
Build drivers for the RAA489000, a combined battery charger and USB-C
TCPCI.
+if PLATFORM_EC_USB_PD_TCPM_RAA489000
+
+config PLATFORM_EC_RAA489000_OCP_UV_THRESHOLD_MV
+ int "Undervoltage threshold while sourcing VBUS (mV)"
+ default 4750
+ help
+ Sets the RAA489000 undervoltage theshold when sourcing VBUS, in mV.
+
+ If VBUS drops below this level while sourcing, the chip disables sourcing
+ under the assumption that too much current was being drawn. Rated accuracy
+ of this measurement is 5%, with 25 mV resolution.
+
+endif
+
config PLATFORM_EC_USB_PD_TCPM_RT1715
bool "Richtek RT1715 Type-C Port Controller"
help