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>
This commit is contained in:
Vijay Hiremath
2016-02-03 00:15:04 -08:00
committed by chrome-bot
parent 97c341cce5
commit cb190ca868

View File

@@ -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 */