diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-10-05 09:50:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-06 13:47:12 -0700 |
commit | b87fe062eca43fc00909098e716581bf2aeea7eb (patch) | |
tree | 890225b40bf562456984424adc1f243fb06ae7eb /include/usb_charge.h | |
parent | 02045eb040227250689caec9b9401c2cd3861363 (diff) | |
download | chrome-ec-b87fe062eca43fc00909098e716581bf2aeea7eb.tar.gz |
charge_ramp: Move ramp allowed / ilim callbacks to common code
The decision on whether to ramp (and how high) depends on the quirks of
charger identification, so move the decision out of board, into the
drivers that implement usb_charger.
Also, rename CONFIG_CHARGE_RAMP to CONFIG_CHARGE_RAMP_SW, to better
contrast with the existing CONFIG_CHARGE_RAMP_HW.
BUG=None
TEST=Manual on kevin, verify ramp occurs when port plugged into Z840
workstation.
BRANCH=None
Change-Id: I5b395274133837a18a4f4ac34b59b623287be175
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/702681
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/usb_charge.h')
-rw-r--r-- | include/usb_charge.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/usb_charge.h b/include/usb_charge.h index ad682c7e68..1de3372434 100644 --- a/include/usb_charge.h +++ b/include/usb_charge.h @@ -88,4 +88,22 @@ void usb_charger_set_switches(int port, enum usb_switch setting); */ void usb_charger_vbus_change(int port, int vbus_level); +/** + * Check if ramping is allowed for given supplier + * + * @supplier Supplier to check + * + * @return Ramping is allowed for given supplier + */ +int usb_charger_ramp_allowed(int supplier); + +/** + * Get the maximum current limit that we are allowed to ramp to + * + * @supplier Active supplier type + * @sup_curr Input current limit based on supplier + * + * @return Maximum current in mA + */ +int usb_charger_ramp_max(int supplier, int sup_curr); #endif /* __CROS_EC_USB_CHARGE_H */ |