From cb190ca868a31e92b3130a36bc02e0da337a2dac Mon Sep 17 00:00:00 2001 From: Vijay Hiremath Date: Wed, 3 Feb 2016 00:15:04 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/325522 Commit-Ready: Vijay P Hiremath Tested-by: Vijay P Hiremath Tested-by: Li1 Feng Reviewed-by: Shawn N --- common/charge_state_v2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'common') 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 */ -- cgit v1.2.1