summaryrefslogtreecommitdiff
path: root/board/drawcia
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-07-30 15:56:29 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-15 04:57:45 +0000
commit98a2c453dd86985ddbc33ee5fd250d8f25f31f33 (patch)
treebcc26f940cc519fe7a34fb75b1796fcc9c6f59dd /board/drawcia
parenta3a8522a47beb7accb7ec97968f67ae48d2af405 (diff)
downloadchrome-ec-98a2c453dd86985ddbc33ee5fd250d8f25f31f33.tar.gz
drawcia: Enable OCPC
This commit enables OCPC for the Draw* boards. Default constants and resistances are the same as waddledee. BUG=b:161863872 BRANCH=None TEST=Build and flash on drawlat. Verify that DUT can charge from the sub board. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I6b95fc0e9fdb6c758fda5509c29da9059d75642e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2330818 Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/drawcia')
-rw-r--r--board/drawcia/board.c20
-rw-r--r--board/drawcia/board.h2
2 files changed, 22 insertions, 0 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c
index 4e38c18d37..b08ff35016 100644
--- a/board/drawcia/board.c
+++ b/board/drawcia/board.c
@@ -408,6 +408,12 @@ void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
+__override void board_ocpc_init(struct ocpc_data *ocpc)
+{
+ /* There's no provision to measure Isys */
+ ocpc->chg_flags[CHARGER_SECONDARY] |= OCPC_NO_ISYS_MEAS_CAP;
+}
+
void board_reset_pd_mcu(void)
{
/*
@@ -606,3 +612,17 @@ void lid_angle_peripheral_enable(int enable)
}
}
#endif
+
+__override void ocpc_get_pid_constants(int *kp, int *kp_div,
+ int *ki, int *ki_div,
+ int *kd, int *kd_div)
+{
+ *kp = 1;
+ *kp_div = 6;
+
+ *ki = 0;
+ *ki_div = 1;
+
+ *kd = 0;
+ *kd_div = 1;
+}
diff --git a/board/drawcia/board.h b/board/drawcia/board.h
index 3142927b6d..94eb81c6ab 100644
--- a/board/drawcia/board.h
+++ b/board/drawcia/board.h
@@ -30,6 +30,8 @@
#define CONFIG_USB_PD_5V_CHARGER_CTRL
#define CONFIG_CHARGER_OTG
#undef CONFIG_CHARGER_SINGLE_CHIP
+#define CONFIG_OCPC
+#define CONFIG_OCPC_DEF_RBATT_MOHMS 5 /* R_DS(on) 5.3mOhm */
/* Sensors */
#define CONFIG_ACCEL_BMA255 /* Lid accel */