summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <devin.lu@quantatw.com>2019-07-19 10:47:48 +0800
committerCommit Bot <commit-bot@chromium.org>2019-07-24 09:21:24 +0000
commitdb49bc03b9b816e8c902a48478a18b9abe52b9a7 (patch)
tree2a3b599431b5a7896d09e46a00361fecd4c9154f
parent29f91d7dd10ec2ffd08e60abd0618ddb3c99d57d (diff)
downloadchrome-ec-db49bc03b9b816e8c902a48478a18b9abe52b9a7.tar.gz
garg: add simplo BYD 916Q2294H battery
BUG=b:135986521,b:136786005 BRANCH=octopus TEST=Test on charging/discharging/battery cut off pass. Change-Id: Idda1c4bc027b44980e047dc89ccae3c26e23cfbe Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1710208 Reviewed-by: Marco Chen <marcochen@chromium.org>
-rw-r--r--board/garg/battery.c35
-rw-r--r--board/garg/board.h3
2 files changed, 34 insertions, 4 deletions
diff --git a/board/garg/battery.c b/board/garg/battery.c
index 70d6891d4f..119023877e 100644
--- a/board/garg/battery.c
+++ b/board/garg/battery.c
@@ -32,8 +32,8 @@
* address, mask, and disconnect value need to be provided.
*/
const struct board_batt_params board_battery_info[] = {
- /* Simplo 916Q2286H battery information */
- [BATTERY_SIMPLO] = {
+ /* Simplo SDI 916Q2286H battery information */
+ [BATTERY_SIMPLO_SDI] = {
.fuel_gauge = {
.manuf_name = "SMP-SDI3320",
.ship_mode = {
@@ -60,7 +60,36 @@ const struct board_batt_params board_battery_info[] = {
.discharging_max_c = 60,
},
},
+
+ /* Simplo BYD 916Q2294H battery information */
+ [BATTERY_SIMPLO_BYD] = {
+ .fuel_gauge = {
+ .manuf_name = "SMP-LP485780",
+ .ship_mode = {
+ .reg_addr = 0x00,
+ .reg_data = { 0x0010, 0x0010 },
+ },
+ .fet = {
+ .mfgacc_support = 1,
+ .reg_addr = 0x0,
+ .reg_mask = 0x0002,
+ .disconnect_val = 0x0,
+ },
+ },
+ .batt_info = {
+ .voltage_max = TARGET_WITH_MARGIN(13200, 5), /* mV */
+ .voltage_normal = 11550,
+ .voltage_min = 9000,
+ .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 = -20,
+ .discharging_max_c = 60,
+ },
+ },
};
BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT);
-const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SIMPLO;
+const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SIMPLO_SDI;
diff --git a/board/garg/board.h b/board/garg/board.h
index 0e614067a0..218f794b0d 100644
--- a/board/garg/board.h
+++ b/board/garg/board.h
@@ -99,7 +99,8 @@ enum sensor_id {
/* List of possible batteries */
enum battery_type {
- BATTERY_SIMPLO,
+ BATTERY_SIMPLO_SDI,
+ BATTERY_SIMPLO_BYD,
BATTERY_TYPE_COUNT,
};