summaryrefslogtreecommitdiff
path: root/board/lazor/board.c
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-09-03 11:49:38 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-04 02:07:51 +0000
commita0695f17ca648883717bebfd1afeaaaf29d78e9d (patch)
tree90b4a3a94ca0b8654543437ee9aa803c7f2751a0 /board/lazor/board.c
parentf067a2682cb87cdacc890f82579120208913d2a6 (diff)
downloadchrome-ec-a0695f17ca648883717bebfd1afeaaaf29d78e9d.tar.gz
ln9310: Move battery cell type to board customization
Checking the input voltage to make the decision of 2S battery or 3S battery is not reliable. The 3S battery with very low charge might be under 10V that we initialized the switchcap to 2:1 mode. When the battery was then charged up to 12V, VOUT would go to 6 V which would be a problem. This change moves the decision to board customization. It checks the SKU ID. It can be extended to other ways, like checking the battery manufacturer and device names. To prevent any damage when attaching a 3S battery to a 2S-SKU board, add a check before configuring the switchcap to 2:1 mode. BRANCH=None BUG=b:163867792, b:151393598 TEST=Built successfully. Change-Id: I3f69132bc00b13ec39b229e98a34a5f7f75008f1 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2391210 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'board/lazor/board.c')
-rw-r--r--board/lazor/board.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c
index c14b3d5f71..8c5496e2a2 100644
--- a/board/lazor/board.c
+++ b/board/lazor/board.c
@@ -349,6 +349,15 @@ static int board_is_clamshell(void)
return sku_id == 4 || sku_id == 5;
}
+enum battery_cell_type board_get_battery_cell_type(void)
+{
+ /* SKU ID of Limozeen: 4, 5 -> 3S battery */
+ if (sku_id == 4 || sku_id == 5)
+ return BATTERY_CELL_TYPE_3S;
+
+ return BATTERY_CELL_TYPE_UNKNOWN;
+}
+
static void board_update_sensor_config_from_sku(void)
{
if (board_is_clamshell()) {