diff options
author | Diana Z <dzigterman@chromium.org> | 2020-08-06 10:03:39 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-15 04:57:48 +0000 |
commit | 36023d58037324c93625ff1adaffa1f8d624cde4 (patch) | |
tree | aba6788ffc78f1b3ca70a0531638b8050b53af02 /board/drawcia | |
parent | 98a2c453dd86985ddbc33ee5fd250d8f25f31f33 (diff) | |
download | chrome-ec-36023d58037324c93625ff1adaffa1f8d624cde4.tar.gz |
Drawcia: Limit C1 current on board version 0
Due to thermal concerns, current on C1 will be limited to 2.0 A on board
version 0.
BRANCH=None
BUG=b:161942987
TEST=on drawcia, plug charger into C1 and verify that the input current
limit is set to 2.0 A
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I66ca0cb095f62c05a7e649b018e4b7b72aa36726
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2341650
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/drawcia')
-rw-r--r-- | board/drawcia/board.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c index b08ff35016..b1d13db9f5 100644 --- a/board/drawcia/board.c +++ b/board/drawcia/board.c @@ -11,6 +11,7 @@ #include "charge_manager.h" #include "charge_state_v2.h" #include "charger.h" +#include "cros_board_info.h" #include "driver/accel_bma2x2.h" #include "driver/accelgyro_lsm6dsm.h" #include "driver/bc12/pi3usb9201.h" @@ -45,6 +46,8 @@ #define INT_RECHECK_US 5000 +uint32_t board_version; + /* GPIO to enable/disable the USB Type-A port. */ const int usb_port_enable[USB_PORT_COUNT] = { GPIO_EN_USB_A_5V, @@ -371,6 +374,8 @@ void board_init(void) gpio_enable_interrupt(GPIO_USB_C0_INT_ODL); gpio_enable_interrupt(GPIO_USB_C1_INT_ODL); + /* Store board version for use in determining charge limits */ + cbi_get_board_version(&board_version); /* * If interrupt lines are already low, schedule them to be processed @@ -467,6 +472,9 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma, { int icl = MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT); + /* Limit C1 on board version 0 to 2.0 A */ + if ((board_version == 0) && (port == 1)) + icl = MIN(icl, 2000); /* * TODO(b/151955431): Characterize the input current limit in case a * scaling needs to be applied here |