mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
charge_manager: Pass uncapped / max current to current limit callback
charge_manager may request a charge current limit less than the capability of the supply in certain cases (eg. during PD voltage transition, to make an effort to comply with reduced load spec). Depending on the battery / system state, setting a reduced charge current limit may result in brownout. Pass the uncapped / max negotiated current to board_set_charge_limit() so that boards may use it instead of the requested limit in such circumstances. BUG=chrome-os-partner:56139 BRANCH=gru TEST=Manual on kevin with subsequent commit, boot system with zinger + low-charge battery, verify devices powers up to OS without brownout. Change-Id: I2b8e0d44edcf57ffe4ee0fdec1a1ed35c6becbbd Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/383732 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
d8166a8d65
commit
94f2bc0740
@@ -110,7 +110,14 @@ int charge_manager_get_source_pdo(const uint32_t **src_pdo);
|
||||
*/
|
||||
int board_set_active_charge_port(int charge_port);
|
||||
|
||||
/* Set the charge current limit. */
|
||||
void board_set_charge_limit(int port, int supplier, int charge_ma);
|
||||
/*
|
||||
* Set the charge current limit.
|
||||
*
|
||||
* @param port PD port.
|
||||
* @param supplier Identified CHARGE_SUPPLIER_*.
|
||||
* @param charge_ma Desired charge current limit, <= max_ma.
|
||||
* @param max_ma Maximum charge current limit, >= charge_ma.
|
||||
*/
|
||||
void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma);
|
||||
|
||||
#endif /* __CROS_EC_CHARGE_MANAGER_H */
|
||||
|
||||
@@ -89,9 +89,6 @@ void chg_ramp_charge_supplier_change(int port, int supplier, int current,
|
||||
#else
|
||||
static inline void chg_ramp_charge_supplier_change(
|
||||
int port, int supplier, timestamp_t registration_time) { }
|
||||
|
||||
/* Point directly to board function to set charge limit */
|
||||
#define chg_ramp_set_min_current board_set_charge_limit
|
||||
#endif
|
||||
|
||||
#endif /* __CROS_EC_CHARGE_RAMP_H */
|
||||
|
||||
Reference in New Issue
Block a user