summaryrefslogtreecommitdiff
path: root/common/charge_ramp.c
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-02-12 17:50:36 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-14 01:06:51 +0000
commit32867ad56618d1664e02140632c267e5b08c7651 (patch)
tree0d0e20a55892a516327179d556190c6953196c8b /common/charge_ramp.c
parente8b5147f37bdb347ba25780bc4b969b37fd6b239 (diff)
downloadchrome-ec-32867ad56618d1664e02140632c267e5b08c7651.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 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>
Diffstat (limited to 'common/charge_ramp.c')
-rw-r--r--common/charge_ramp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/common/charge_ramp.c b/common/charge_ramp.c
index 68a9c8ef96..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,17 +35,16 @@ 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:
- return sup_curr;
#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 */
}