summaryrefslogtreecommitdiff
path: root/board/rammus
diff options
context:
space:
mode:
authorZhuohao Lee <zhuohao@chromium.org>2019-01-20 21:59:48 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-04 12:42:10 -0800
commitc2ebb5e88be7493a07a78533a28a2f1d51be719c (patch)
tree0de20405dec3fec1a3cbbcb6849f55d8531ac058 /board/rammus
parente1ce8ba84e9cc105f8394b3bdf41543fb72533df (diff)
downloadchrome-ec-c2ebb5e88be7493a07a78533a28a2f1d51be719c.tar.gz
rammus: turn the USB type-a charging off by default in suspend mode
This patch turns the USB type-a charging off by default in suspend mode. If the DUT power on with connecting a USB device, the OS must send an event to clear inhibit_charging_in_suspend. Otherwise, the USB device will lost the power in suspend mode, and the wakeup event won't be generated if the device is a wakeup source (eg. USB keyboard or mouse). BUG=b:121438672 BRANCH=firmware-rammus-11275 CQ-DEPEND=CL:1423758 TEST=Power on DUT without connecting USB, then suspend the DUT. Verfied the USB type-a charging off. Change-Id: I39a0f85d7033b798a80e80cc302a2c72cebae8d6 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1424042 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/rammus')
-rw-r--r--board/rammus/board.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/board/rammus/board.c b/board/rammus/board.c
index 46afccbb2f..d4ec8ea13a 100644
--- a/board/rammus/board.c
+++ b/board/rammus/board.c
@@ -465,6 +465,19 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
+static void usb_charge_mode_init(void)
+{
+ /*
+ * By default, turn the charging off when system suspends.
+ * If system power on with connecting a USB device,
+ * the OS must send an event to EC to clear the
+ * inhibit_charging_in_suspend.
+ */
+ usb_charge_set_mode(0, USB_CHARGE_MODE_CDP,
+ USB_DISALLOW_SUSPEND_CHARGE);
+}
+DECLARE_HOOK(HOOK_INIT, usb_charge_mode_init, HOOK_PRIO_DEFAULT + 1);
+
/**
* Buffer the AC present GPIO to the PCH.
*/