summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-08-18 16:25:12 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-09-23 00:04:49 +0000
commitccb45ff8a2285fbee6d87c02789dc7b00250dc82 (patch)
tree492e5caa2fdbae3f81e0908264f07e5e9107224e
parentcf4abddca8ee6aa5936b0fb34343146704ddf273 (diff)
downloadchrome-ec-ccb45ff8a2285fbee6d87c02789dc7b00250dc82.tar.gz
samus: enabled fast charging for EVT ATL cells
Enable fast charging with profile designed for ATL cells that will be used in EVT. BUG=chrome-os-partner:23776 BRANCH=none TEST=Took detailed charging/discharging data and verified that the actual profile matches the desired profile and that the fast charging profile is actually faster than the standard. See bug report for more info and data collected. Change-Id: Ic11ab89e48afb73987b8013abf8b0564e1138156 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/212980 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--driver/battery/samus.c70
1 files changed, 51 insertions, 19 deletions
diff --git a/driver/battery/samus.c b/driver/battery/samus.c
index 951130867e..6458af0199 100644
--- a/driver/battery/samus.c
+++ b/driver/battery/samus.c
@@ -46,7 +46,7 @@ const struct battery_info *battery_get_info(void)
#ifdef CONFIG_CHARGER_PROFILE_OVERRIDE
-static int fast_charging_allowed;
+static int fast_charging_allowed = 1;
/*
* This can override the smart battery's charging profile. To make a change,
@@ -58,6 +58,15 @@ static int fast_charging_allowed;
*/
int charger_profile_override(struct charge_state_data *curr)
{
+ /* temp in 0.1 deg C */
+ int temp_c = curr->batt.temperature - 2731;
+ /* keep track of last temperature range for hysteresis */
+ static enum {
+ TEMP_LOW,
+ TEMP_NORMAL,
+ TEMP_HIGH
+ } temp_range = TEMP_NORMAL;
+
/* We only want to override how we charge, nothing else. */
if (curr->state != ST_CHARGE)
return 0;
@@ -66,25 +75,48 @@ int charger_profile_override(struct charge_state_data *curr)
if (!fast_charging_allowed)
return 0;
- /* Okay, impose our custom will */
- curr->requested_current = 9000;
- curr->requested_voltage = 8300;
- if (curr->batt.current <= 6300) {
- curr->requested_current = 6300;
- curr->requested_voltage = 8400;
- } else if (curr->batt.current <= 4500) {
- curr->requested_current = 4500;
- curr->requested_voltage = 8500;
- } else if (curr->batt.current <= 2700) {
- curr->requested_current = 2700;
+ /*
+ * Okay, impose our custom will:
+ * When battery is 15-45C:
+ * CC at 9515mA @ 8.3V
+ * CV at 8.3V until current drops to 4759mA
+ * CC at 4759mA @ 8.7V
+ * CV at 8.7V
+ *
+ * When battery is <15C:
+ * CC at 2854mA @ 8.7V
+ * CV at 8.7V
+ *
+ * When battery is >45C:
+ * CC at 6660mA @ 8.3V
+ * CV at 8.3V (when battery is hot we don't go to fully charged)
+ *
+ * Add 0.2 degrees of hysteresis.
+ */
+ if (temp_c < 149)
+ temp_range = TEMP_LOW;
+ else if (temp_c > 151 && temp_c < 449)
+ temp_range = TEMP_NORMAL;
+ else if (temp_c > 451)
+ temp_range = TEMP_HIGH;
+
+ switch (temp_range) {
+ case TEMP_LOW:
+ curr->requested_current = 2854;
curr->requested_voltage = 8700;
- } else if (curr->batt.current <= 475) {
- /*
- * Should we stop? If so, how do we start again?
- * For now, just use the battery's profile.
- */
- curr->requested_current = curr->batt.desired_current;
- curr->requested_voltage = curr->batt.desired_voltage;
+ break;
+ case TEMP_NORMAL:
+ curr->requested_current = 9515;
+ curr->requested_voltage = 8300;
+ if (curr->batt.current <= 4759 && curr->batt.voltage >= 8250) {
+ curr->requested_current = 4759;
+ curr->requested_voltage = 8700;
+ }
+ break;
+ case TEMP_HIGH:
+ curr->requested_current = 6660;
+ curr->requested_voltage = 8300;
+ break;
}
return 0;