summaryrefslogtreecommitdiff
path: root/board/drawcia
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2020-07-29 11:54:45 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-31 04:01:13 +0000
commita806f260be783c888d582b91f3b02a01ce03bdee (patch)
treed544a7144f21dfae757a7f040711695248097202 /board/drawcia
parent864d4159b54fc62a2612f718d02f53918873b8fe (diff)
downloadchrome-ec-a806f260be783c888d582b91f3b02a01ce03bdee.tar.gz
drawcia: Add more batteries support
This patch adds battery parameter as following: 1. DynaPack HIGHPOWER 2. DynaPack BYD 3. COSMX BUG=b:159504964 BRANCH=none TEST=make sure battery charging, battery cutoff works. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I5c60ace336eead9506ae420418535746b5df8d20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2325451 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/drawcia')
-rw-r--r--board/drawcia/battery.c87
-rw-r--r--board/drawcia/board.h3
2 files changed, 90 insertions, 0 deletions
diff --git a/board/drawcia/battery.c b/board/drawcia/battery.c
index cbfe019853..3052f93dcc 100644
--- a/board/drawcia/battery.c
+++ b/board/drawcia/battery.c
@@ -90,6 +90,64 @@ const struct board_batt_params board_battery_info[] = {
},
},
+ /* DynaPack HIGHPOWER Battery Information */
+ [BATTERY_DANAPACK_HIGHPOWER] = {
+ .fuel_gauge = {
+ .manuf_name = "333-2D-0D-A",
+ .ship_mode = {
+ .reg_addr = 0x00,
+ .reg_data = { 0x0010, 0x0010 },
+ },
+ .fet = {
+ .mfgacc_support = 1,
+ .reg_addr = 0x0,
+ .reg_mask = 0x0006,
+ .disconnect_val = 0x0,
+ },
+ },
+ .batt_info = {
+ .voltage_max = 8800, /* mV */
+ .voltage_normal = 7700,
+ .voltage_min = 6000,
+ .precharge_current = 256, /* mA */
+ .start_charging_min_c = 0,
+ .start_charging_max_c = 45,
+ .charging_min_c = 0,
+ .charging_max_c = 45,
+ .discharging_min_c = -10,
+ .discharging_max_c = 60,
+ },
+ },
+
+ /* DynaPack BYD Battery Information */
+ [BATTERY_DANAPACK_BYD] = {
+ .fuel_gauge = {
+ .manuf_name = "333-2E-0D-A",
+ .ship_mode = {
+ .reg_addr = 0x00,
+ .reg_data = { 0x0010, 0x0010 },
+ },
+ .fet = {
+ .mfgacc_support = 1,
+ .reg_addr = 0x0,
+ .reg_mask = 0x0006,
+ .disconnect_val = 0x0,
+ },
+ },
+ .batt_info = {
+ .voltage_max = 8800, /* mV */
+ .voltage_normal = 7700,
+ .voltage_min = 6000,
+ .precharge_current = 256, /* mA */
+ .start_charging_min_c = 0,
+ .start_charging_max_c = 45,
+ .charging_min_c = 0,
+ .charging_max_c = 45,
+ .discharging_min_c = -10,
+ .discharging_max_c = 60,
+ },
+ },
+
/* Samsung SDI Battery Information */
[BATTERY_SAMSUNG_SDI] = {
.fuel_gauge = {
@@ -176,6 +234,35 @@ const struct board_batt_params board_battery_info[] = {
.discharging_max_c = 60,
},
},
+
+ /* CosMX Battery Information */
+ [BATTERY_COS] = {
+ .fuel_gauge = {
+ .manuf_name = "333-AC-0D-A",
+ .ship_mode = {
+ .reg_addr = 0x00,
+ .reg_data = { 0x0010, 0x0010 },
+ },
+ .fet = {
+ .mfgacc_support = 1,
+ .reg_addr = 0x0,
+ .reg_mask = 0x0006,
+ .disconnect_val = 0x0,
+ },
+ },
+ .batt_info = {
+ .voltage_max = 8800, /* mV */
+ .voltage_normal = 7700,
+ .voltage_min = 6000,
+ .precharge_current = 256, /* mA */
+ .start_charging_min_c = 0,
+ .start_charging_max_c = 45,
+ .charging_min_c = 0,
+ .charging_max_c = 45,
+ .discharging_min_c = -10,
+ .discharging_max_c = 60,
+ },
+ },
};
BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT);
diff --git a/board/drawcia/board.h b/board/drawcia/board.h
index 5352fc6cb8..76e6cb6c8e 100644
--- a/board/drawcia/board.h
+++ b/board/drawcia/board.h
@@ -125,9 +125,12 @@ enum temp_sensor_id {
enum battery_type {
BATTERY_DANAPACK_COS,
BATTERY_DANAPACK_ATL,
+ BATTERY_DANAPACK_HIGHPOWER,
+ BATTERY_DANAPACK_BYD,
BATTERY_SAMSUNG_SDI,
BATTERY_SIMPLO_COS,
BATTERY_SIMPLO_HIGHPOWER,
+ BATTERY_COS,
BATTERY_TYPE_COUNT,
};