summaryrefslogtreecommitdiff
path: root/include/charger_profile_override.h
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2017-02-06 11:55:21 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-10 19:02:55 -0800
commitf30a8cf6863e6f2a491e8baff73632e6faf371d0 (patch)
tree44705231bd7ec9651636adb28f5035a067ee64ca /include/charger_profile_override.h
parent16ce25ce44d2d74c08d33f6277b8528793d7389d (diff)
downloadchrome-ec-f30a8cf6863e6f2a491e8baff73632e6faf371d0.tar.gz
charger_profile: support multiple battery voltage range thresholds
Current fast charge assumes only one battery voltage threshold range for charger profile override. However we have multiple battery voltage threshold ranges for few batteries hence added a code which can consider multiple battery threshold ranges and choose respective charge profile. BUG=chrome-os-partner:62653 BRANCH=none TEST=Manually tested on Electro. Manipulate smp_cos4870 & sonycorp battery voltage & temperature ranges and observed correct charge profile is selected. Change-Id: Icddc047e608cc8f63cd0c19be716e0f7908ca715 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/438804 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'include/charger_profile_override.h')
-rw-r--r--include/charger_profile_override.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/include/charger_profile_override.h b/include/charger_profile_override.h
index ba2ef09a4e..091eb11946 100644
--- a/include/charger_profile_override.h
+++ b/include/charger_profile_override.h
@@ -14,18 +14,14 @@
#define CHARGER_PROF_TEMP_C_LAST_RANGE 0xFFFF
-enum fast_chg_voltage_ranges {
- VOLTAGE_RANGE_LOW,
- VOLTAGE_RANGE_HIGH,
- VOLTAGE_RANGE_NUM,
-};
+#define CHARGER_PROF_VOLTAGE_MV_LAST_RANGE 0xFFFF
/* Charge profile override info */
struct fast_charge_profile {
/* temperature in 10ths of a degree C */
- int temp_c;
- /* charge current at lower & higher battery voltage limit in mA */
- int current_mA[VOLTAGE_RANGE_NUM];
+ const int temp_c;
+ /* charge current for respective battery voltage ranges in mA. */
+ const int current_mA[CONFIG_CHARGER_PROFILE_VOLTAGE_RANGES];
};
/* Charge profile override parameters */
@@ -35,13 +31,11 @@ struct fast_charge_params {
/* Default temperature range of the charge profile */
const int default_temp_range_profile;
/*
- * Lower limit of battery voltage in mV
- * If the battery voltage reading is bad or the battery voltage is
- * greater than or equal to the lower limit or the battery voltage is
- * not in the charger profile voltage range, consider battery has high
- * voltage range so that we charge at lower current limit.
+ * Battery voltage ranges in mV.
+ * It is assumed that these values are added in ascending order in the
+ * board battery file.
*/
- const int vtg_low_limit_mV;
+ const int voltage_mV[CONFIG_CHARGER_PROFILE_VOLTAGE_RANGES];
const struct fast_charge_profile *chg_profile_info;
};