From cd530f929bf88b711f34d7b6b4807ebdbe467210 Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Wed, 8 May 2019 16:47:57 -0700 Subject: kohaku: Add support for Dyna battery This CL adds support for the battery that's currently being used with Kohaku systems. Without this support the AP won't be powered on automatically when only on battery power. BUG=b:132272081 BRANCH=none TEST=Verifed that 'battery found' message is in EC console log and that AP boots automatically when AC power is not connected. Change-Id: I2f9e0f09cf3d2caad33ed62e2b8f42a609b34fc3 Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/1603470 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Tim Wawrzynczak Reviewed-by: Furquan Shaikh --- board/kohaku/battery.c | 46 +++++++++------------------------------------- board/kohaku/board.h | 3 +-- 2 files changed, 10 insertions(+), 39 deletions(-) (limited to 'board') diff --git a/board/kohaku/battery.c b/board/kohaku/battery.c index b81fa795b9..1014d7825d 100644 --- a/board/kohaku/battery.c +++ b/board/kohaku/battery.c @@ -32,10 +32,10 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* SMP LIS Dell FMXMT Battery Information */ - [BATTERY_SMP_LIS] = { + /* Dyna Battery Information */ + [BATTERY_DYNA] = { .fuel_gauge = { - .manuf_name = "SMP-LIS3.78", + .manuf_name = "Dyna", .ship_mode = { .reg_addr = 0x0, .reg_data = { 0x10, 0x10 }, @@ -47,47 +47,19 @@ const struct board_batt_params board_battery_info[] = { } }, .batt_info = { - .voltage_max = 8800, - .voltage_normal = 7660, /* mV */ + .voltage_max = 8700, + .voltage_normal = 7600, /* mV */ .voltage_min = 6000, /* mV */ - .precharge_current = 256, /* mA */ + .precharge_current = 150, /* mA */ .start_charging_min_c = 0, - .start_charging_max_c = 60, + .start_charging_max_c = 45, .charging_min_c = 0, .charging_max_c = 60, - .discharging_min_c = 0, - .discharging_max_c = 60, - }, - }, - - /* SMP SDI Dell FMXMT Battery Information */ - [BATTERY_SMP_SDI] = { - .fuel_gauge = { - .manuf_name = "SMP-SDI-3727", - .ship_mode = { - .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, - }, - .fet = { - .reg_addr = 0x0, - .reg_mask = 0x2000, - .disconnect_val = 0x2000, - } - }, - .batt_info = { - .voltage_max = 8800, - .voltage_normal = 7660, /* mV */ - .voltage_min = 6000, /* mV */ - .precharge_current = 256, /* mA */ - .start_charging_min_c = 0, - .start_charging_max_c = 60, - .charging_min_c = 0, - .charging_max_c = 60, - .discharging_min_c = 0, + .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_SMP_SDI; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_DYNA; diff --git a/board/kohaku/board.h b/board/kohaku/board.h index 558293f7a3..81bca3c57c 100644 --- a/board/kohaku/board.h +++ b/board/kohaku/board.h @@ -147,8 +147,7 @@ enum temp_sensor_id { /* List of possible batteries */ enum battery_type { - BATTERY_SMP_LIS, - BATTERY_SMP_SDI, + BATTERY_DYNA, BATTERY_TYPE_COUNT, }; -- cgit v1.2.1