diff options
author | Zhuohao Lee <zhuohao@chromium.org> | 2019-01-19 17:03:10 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-30 01:26:10 -0800 |
commit | 9670696203029efa87b0871073e149b7ba8619c2 (patch) | |
tree | f43006c56429474192f199415914c72b6a2b9742 /common/acpi.c | |
parent | 0a9e45cdb4544c7a9da21e256dc87f8bcbd3f477 (diff) | |
download | chrome-ec-9670696203029efa87b0871073e149b7ba8619c2.tar.gz |
usb_port_power_smart: turn on/off charging mode during system suspend
This patch adds a feature to allow the userspace program turns on/off
the usb type-a charging mode during system suspend.
BUG=b:121438672
BRANCH=firmware-rammus-11275
TEST=make -j buildall
ectool usbchargemode 0 0x2 0, CDP works in S0 and S0ix
ectool usbchargemode 0 0x2 1, CDP works in S0 but not in S0ix
Change-Id: Icb8ab1b3f1beb671fbd02f441bf40284ba74e097
Signed-off-by: Zhuohao Lee <zhuohao@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1424040
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/acpi.c')
-rw-r--r-- | common/acpi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/acpi.c b/common/acpi.c index 924a180cb8..e33ac17bb0 100644 --- a/common/acpi.c +++ b/common/acpi.c @@ -362,7 +362,8 @@ int acpi_ap_to_ec(int is_cmd, uint8_t value, uint8_t *resultptr) if (mode_field & 1) mode = USB_CHARGE_MODE_ENABLED; - if (usb_charge_set_mode(i, mode)) { + if (usb_charge_set_mode(i, mode, + USB_ALLOW_SUSPEND_CHARGE)) { CPRINTS("ERROR: could not set charge " "mode of USB port p%d to %d", i, mode); |