summaryrefslogtreecommitdiff
path: root/board/ezkinil/board.c
diff options
context:
space:
mode:
authorSue <sue.chen@quanta.corp-partner.google.com>2020-04-28 15:10:47 +0800
committerCommit Bot <commit-bot@chromium.org>2020-05-20 05:32:28 +0000
commit3927b746bc29f693a8c9335c734e50ea45a7c3e3 (patch)
tree58f2371e5d6ae27aeb50e5e1b03f895fb7081748 /board/ezkinil/board.c
parent8d7bd376c17fbbaaa1fc528ad607546295b04838 (diff)
downloadchrome-ec-3927b746bc29f693a8c9335c734e50ea45a7c3e3.tar.gz
Ezkinil: Setting input current limit to 95%
Setting lower input current limit to make sure safety confirm test pass. BUG=b:156962946 BRANCH=none TEST=make buildall Change-Id: I3afa3c70076fcff319e47c08901616916c0a467b Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2172276 Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'board/ezkinil/board.c')
-rw-r--r--board/ezkinil/board.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/ezkinil/board.c b/board/ezkinil/board.c
index b62e512df4..842419f523 100644
--- a/board/ezkinil/board.c
+++ b/board/ezkinil/board.c
@@ -4,6 +4,7 @@
*/
#include "button.h"
+#include "charge_state_v2.h"
#include "driver/accelgyro_bmi_common.h"
#include "driver/accel_kionix.h"
#include "driver/accel_kx022.h"
@@ -457,3 +458,17 @@ int fan_percent_to_rpm(int fan, int pct)
return fan_table[current_level].rpm;
}
+
+__override void board_set_charge_limit(int port, int supplier, int charge_ma,
+ int max_ma, int charge_mv)
+{
+ /*
+ * Limit the input current to 95% negotiated limit,
+ * to account for the charger chip margin.
+ */
+ charge_ma = charge_ma * 95 / 100;
+
+ charge_set_input_current_limit(MAX(charge_ma,
+ CONFIG_CHARGER_INPUT_CURRENT),
+ charge_mv);
+}