diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-08-17 13:55:47 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-22 01:37:38 +0000 |
commit | ad8ce3f806961e2c4548c2f552b7f94adf0fd4b5 (patch) | |
tree | 915272ec6452a872ca0bfc2a85aede6f7db65a64 /include/usb_pd.h | |
parent | 6f8637a6dfc3588367df7d211f26ea5b67ebbea1 (diff) | |
download | chrome-ec-ad8ce3f806961e2c4548c2f552b7f94adf0fd4b5.tar.gz |
usb_pd: Add host command to limit external charger voltage / current
PD charger voltage + current can now be limited with
EC_CMD_EXTERNAL_POWER_LIMIT. The limit is automatically cleared when the
AP transitions out of S0 into S3 / suspend.
BUG=chrome-os-partner:43285
TEST=Manual on Samus w/ zinger.
- Plug zinger, verify charging at 20V/3A.
- `ectool extpwrlimit 3000 12000 --dev=1`, verify charging at 12V/3A
- `ectool extpwrlimit 1000 5000 --dev=1`, verify charging at 5V/1A
- Plug zinger into other port, verify still charging at 5V/1A
- `powerd_dbus_suspend`, verify charging at 20V/3A
- `chglim 2000 12000`, verify charging at 12V/2A
- `ectool extpwrlimit 0xffff 0xffff --dev=1`, verify charging at 20V/3A
- `chglim 1000 20000`, verify charging at 20V/1A
- `chglim`, verify charging at 20V/3A
BRANCH=ryu
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I6cd5377be91b3df75f99cb414fd3fa5a463b56cb
Reviewed-on: https://chromium-review.googlesource.com/293954
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r-- | include/usb_pd.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index 5b42b687e0..6ca88bb55a 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -947,6 +947,15 @@ int pd_set_power_supply_ready(int port); void pd_request_source_voltage(int port, int mv); /** + * Set a voltage limit from the PD source. + * + * If the source is currently active, it triggers a new negotiation. + * @param port USB-C port number + * @param mv limit voltage in millivolts. + */ +void pd_set_external_voltage_limit(int port, int mv); + +/** * Set the PD input current limit. * * @param port USB-C port number |