diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-04-03 10:47:48 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-01 03:44:19 +0000 |
commit | 6dce2424d99de40763a039eb099efcd5b0a52cb2 (patch) | |
tree | d54d49f41cb50889c7c00886c3bdfb45877d56d9 /include/charge_ramp.h | |
parent | 62080646fe4312de930e4c4d766106438eae5efc (diff) | |
download | chrome-ec-6dce2424d99de40763a039eb099efcd5b0a52cb2.tar.gz |
charge_manager: modify PD power HC to give more info on current
Change the EC_CMD_USB_PD_POWER_INFO host command to report the input
current limit and the max current theoretically possible given the
charger. The input current limit field is useful for logging purposes
and the max current field is useful to give to powerd to determine
if we have a low power charger connected.
The max current is determined by checking if the charge supplier is
allowed to ramp. If the charge supplier is allowed to ramp and has
not completed ramping yet, then max current is the max current that
we are allowed to ramp up to. Once the ramp has completed, then max
current is the stable charging current. If the charge supplier is not
allowed to ramp, then max current is simply the max current as
registered with charge_manager. The point here is to keep the max as
high as possible until we know for sure it is lower to avoid showing
the user the low power notification until we know for sure.
This CL also adds a new charger type, USB_CHG_TYPE_UNKNOWN. For a short
period after a charger is plugged in, the supplier type may change and
PD negotiation is still in process, and therefore we tell the host we
have an unknown charger type. This allows powerd to show the charging
icon, but delay determining if this is a low power charger until we
know for sure.
BUG=chrome-os-partner:38548
BRANCH=samus
TEST=tested with zinger, a DCP, an SDP, and a proprietary charger.
tested that low power notification never pops up with zinger, even
if you purposely wedge charge circuit with "charger voltage 7000" on
EC console. tested that the other chargers all pop up low power
notification once the supplier changes from UNKNOWN to the real
supplier. used "ectool --name=cros_pd usbpdpower" to check current
values.
Change-Id: If8a9a1799504cc2a13238f4e6ec917d25d972b22
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/265066
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Diffstat (limited to 'include/charge_ramp.h')
-rw-r--r-- | include/charge_ramp.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/charge_ramp.h b/include/charge_ramp.h index c6e0531496..5779200026 100644 --- a/include/charge_ramp.h +++ b/include/charge_ramp.h @@ -58,6 +58,20 @@ int board_is_vbus_too_low(enum chg_ramp_vbus_state ramp_state); */ int chg_ramp_get_current_limit(void); +/** + * Return if charge ramping has reached stable state + * + * @return 1 if stable, 0 otherwise + */ +int chg_ramp_is_stable(void); + +/** + * Return if charge ramping has reached detected state + * + * @return 1 if detected, 0 otherwise + */ +int chg_ramp_is_detected(void); + #ifdef HAS_TASK_CHG_RAMP /** * Notify charge ramp module of supplier type change on a port. If port |