summaryrefslogtreecommitdiff
path: root/board/sasuke
diff options
context:
space:
mode:
authorYongBeum.Ha <ybha@samsung.corp-partner.google.com>2021-01-28 11:00:34 +0900
committerCommit Bot <commit-bot@chromium.org>2021-02-03 19:35:58 +0000
commit3b7c9893afc5291d36d778921dcb7c8f5154c583 (patch)
tree19456f623c7befd56ccd276e0b2108298bceed6c /board/sasuke
parent724e0077fa83e17a152f7170f1ea66091839e638 (diff)
downloadchrome-ec-3b7c9893afc5291d36d778921dcb7c8f5154c583.tar.gz
sasuke : set charging current/voltage
Charging Voltage (Battery → Charger IC) Need 100mV margin between battery allowable voltage and Charger IC set voltage. 8860mV → 8760mV 8400mV → 8300mV Charger Current Need 10% marging between battery allowable current and Charging current. - Normal temperature (Battery → Charger IC) ~8.24V : 6916mA → 6224mA ~8.44V : 5320mA → 4788mA ~8.86V : 4256mA → 3830mA BUG=b:178565802 BRANCH=None TEST=make -j BOARD=sasuke Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I41dca90d7ff830a392093163d7d2141cbbd17f09 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2654666 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/sasuke')
-rw-r--r--board/sasuke/battery.c37
-rw-r--r--board/sasuke/board.h1
2 files changed, 37 insertions, 1 deletions
diff --git a/board/sasuke/battery.c b/board/sasuke/battery.c
index 255381d6c9..f6862ca555 100644
--- a/board/sasuke/battery.c
+++ b/board/sasuke/battery.c
@@ -8,7 +8,9 @@
#include "battery_fuel_gauge.h"
#include "charge_state.h"
#include "common.h"
+#include "util.h"
+#define CHARGING_CURRENT_REDUCE 4000
/*
* Battery info for all sasuke battery types. Note that the fields
* start_charging_min/max and charging_min/max are not used for the charger.
@@ -58,7 +60,7 @@ const struct board_batt_params board_battery_info[] = {
}
},
.batt_info = {
- .voltage_max = 8860,
+ .voltage_max = 8760,
.voltage_normal = 7720, /* mV */
.voltage_min = 6000, /* mV */
.precharge_current = 200, /* mA */
@@ -74,3 +76,36 @@ const struct board_batt_params board_battery_info[] = {
BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT);
const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SDI;
+
+int charger_profile_override(struct charge_state_data *curr)
+{
+ int current;
+ int voltage;
+
+ current = curr->requested_current;
+ voltage = curr->requested_voltage;
+
+ voltage -= 100;
+ if (current > CHARGING_CURRENT_REDUCE)
+ current -= (current / 10);
+
+ curr->requested_voltage = MIN(curr->requested_voltage, voltage);
+ curr->requested_current = MIN(curr->requested_current, current);
+
+ return 0;
+}
+
+/* Customs options controllable by host command. */
+#define PARAM_FASTCHARGE (CS_PARAM_CUSTOM_PROFILE_MIN + 0)
+
+enum ec_status charger_profile_override_get_param(uint32_t param,
+ uint32_t *value)
+{
+ return EC_RES_INVALID_PARAM;
+}
+
+enum ec_status charger_profile_override_set_param(uint32_t param,
+ uint32_t value)
+{
+ return EC_RES_INVALID_PARAM;
+}
diff --git a/board/sasuke/board.h b/board/sasuke/board.h
index 54fc3292b0..5a77857c0e 100644
--- a/board/sasuke/board.h
+++ b/board/sasuke/board.h
@@ -33,6 +33,7 @@
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_OCPC_DEF_RBATT_MOHMS 22 /* R_DS(on) 11.6mOhm + 10mOhm sns rstr */
#define CONFIG_OCPC
+#define CONFIG_CHARGER_PROFILE_OVERRIDE
#undef CONFIG_CHARGER_SINGLE_CHIP
/*