summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-12-17 14:38:37 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-18 04:29:42 +0000
commitad11790a92b5b8b537771f2abe1bf509bacd4d92 (patch)
tree02a8f648113df11eb9ad578ea6f0d64be1dde58d
parenta4445b15c9aba20f9078779adb1a0cb2e307c36a (diff)
downloadchrome-ec-ad11790a92b5b8b537771f2abe1bf509bacd4d92.tar.gz
Limozeen: Return a 3S battery type as default
Lazor and Limozeen share a single EC firmware. * Lazor uses a 2S battery and a 2-to-1 switching capacitor. * Limozeen uses a 3S battery and a 3-to-1 switching capacitor. Return a correct default battery type in case the battery is not attached, such that the charger can still output a correct voltage. BRANCH=Trogdor BUG=b:175625362 TEST=Build the Lazor image and use it on the board with 3S battery but the battery is not attached. Change-Id: Ied80727d10d7684e26c01b97f68aceac6a43ae9a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597802 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
-rw-r--r--board/lazor/board.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c
index ad0d19e24b..66701af613 100644
--- a/board/lazor/board.c
+++ b/board/lazor/board.c
@@ -6,6 +6,7 @@
/* Lazor board-specific configuration */
#include "adc_chip.h"
+#include "battery_fuel_gauge.h"
#include "button.h"
#include "charge_manager.h"
#include "charge_state.h"
@@ -414,6 +415,20 @@ enum battery_cell_type board_get_battery_cell_type(void)
return BATTERY_CELL_TYPE_UNKNOWN;
}
+__override int board_get_default_battery_type(void)
+{
+ /*
+ * A 2S battery is set as default. If the board is configured to use
+ * a 3S battery, according to its SKU_ID, return a 3S battery as
+ * default. It helps to configure the charger to output a correct
+ * voltage in case the battery is not attached.
+ */
+ if (board_get_battery_cell_type() == BATTERY_CELL_TYPE_3S)
+ return BATTERY_LGC_AP18C8K;
+
+ return DEFAULT_BATTERY_TYPE;
+}
+
static void board_update_sensor_config_from_sku(void)
{
if (board_is_clamshell()) {