summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2016-02-03 00:15:04 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-02-08 20:25:19 -0800
commitcb190ca868a31e92b3130a36bc02e0da337a2dac (patch)
treed8b1bd06cac9610292c3850f89164b37445bc1ea /common
parent97c341cce5afb9615b5d6122956081dc4829e19e (diff)
downloadchrome-ec-cb190ca868a31e92b3130a36bc02e0da337a2dac.tar.gz
charger: Settings for charger current in no battery condition
In case of no battery condition, current code sets the charger input current to the charger maximum input current. To avoid damage to the board, set the charger input current to the maximum current that the board can support. BUG=none BRANCH=none TEST=Manually tested on kunimitsu, removed the battery & then using EC console command 'charger', verified that the current value is set to 3000mA. Change-Id: I94c40228a6362822c841a6e0c226bea0d3398b73 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/325522 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Li1 Feng <li1.feng@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/charge_state_v2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 93e817d359..0159a54207 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -571,8 +571,13 @@ int get_desired_input_current(enum battery_present batt_present,
#else
return CONFIG_CHARGER_INPUT_CURRENT;
#endif
- } else
+ } else {
+#ifdef CONFIG_USB_POWER_DELIVERY
+ return MIN(PD_MAX_CURRENT_MA, info->input_current_max);
+#else
return info->input_current_max;
+#endif
+ }
}
/* Main loop */