summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-02-12 17:50:36 -0800
committerCommit Bot <commit-bot@chromium.org>2021-03-19 16:52:14 +0000
commit6dbd105290341839ad66b5376a54eddbc8ccd36f (patch)
tree0eca650e7ee1c323280887c99b9796e70ed1f019
parent93326936269fd20ebdf4deb861436484c433b0bf (diff)
downloadchrome-ec-6dbd105290341839ad66b5376a54eddbc8ccd36f.tar.gz
chgramp: Don't ramp DTS suppliers above advertisement
We shouldn't ramp above the current limit that the DTS specifies; the USB Type-C spec clearly shows what the limit is. The existing code was allowing us to ramp up to 2.4A when a SuzyQable was connected to a chromebook. This was causing issues on various devices/workstations. If a board needs more power than SuzyQable can provide, they ought to use a ServoV4 with a charger connected instead. BUG=chromium:770296,b:142033952,b:144198315,b:152000267 BRANCH=hatch,nami,octopus TEST=Build and flash kohaku, plug in SuzyQable, verify that DUT draws no more than 1500mA. TEST=Repeat above test with a ServoV4 with 60W adapter plugged in, verify DUT can pull ~60W. Change-Id: Ife9f8d99862d61cf7d18722fdd6e19331a47e301 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2053608 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Eric Herrmann <eherrmann@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2760684 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org> Tested-by: Zhuohao Lee <zhuohao@chromium.org>
-rw-r--r--common/charge_ramp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/common/charge_ramp.c b/common/charge_ramp.c
index 415e36a816..3ca5bd89bb 100644
--- a/common/charge_ramp.c
+++ b/common/charge_ramp.c
@@ -11,8 +11,6 @@
#include "usb_charge.h"
#include "util.h"
-#define TYPEC_DTS_RAMP_MAX 2400
-
test_mockable int chg_ramp_allowed(int supplier)
{
/* Don't allow ramping in RO when write protected. */
@@ -37,16 +35,15 @@ test_mockable int chg_ramp_allowed(int supplier)
test_mockable int chg_ramp_max(int supplier, int sup_curr)
{
switch (supplier) {
- case CHARGE_SUPPLIER_TYPEC_DTS:
- /*
- * Ramp DTS suppliers to advertised current or predetermined
- * limit, whichever is greater.
- */
- return MAX(TYPEC_DTS_RAMP_MAX, sup_curr);
#ifdef CONFIG_CHARGE_RAMP_HW
case CHARGE_SUPPLIER_PD:
case CHARGE_SUPPLIER_TYPEC:
#endif
+ case CHARGE_SUPPLIER_TYPEC_DTS:
+ /*
+ * We should not ramp DTS beyond what they advertise, otherwise
+ * we may brownout the systems they are connected to.
+ */
return sup_curr;
/* default: fall through */
}