From 0de92e26167a858d7350d6bd2af75f2f0b73f960 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Tue, 7 Mar 2017 18:02:31 -0800 Subject: [PATCH] g: enable usb wakeup interrupts To make sure cr50 usb works, we need to disable sleep immediately after the usb controller detects that usb has resumed. The usb WKUPINT is asserted on usb resume, but cr50 doesn't currently respond to that. This change umasks the usb wakeup interrupt, so that USB ISR will disable sleep on resume. BUG=b:35774906 BRANCH=none TEST=Run 100 'usb_updater -f' 100 times sleeping 20 seconds in between each run. Verify there are no failures and cr50 still goes to sleep between each run. Change-Id: I1819deaa3988bcf2a85686d1b9d57092ba264c4d Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/450900 Reviewed-by: Vadim Bendebury --- chip/g/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chip/g/usb.c b/chip/g/usb.c index 1f9ee07ca1..05e58cd210 100644 --- a/chip/g/usb.c +++ b/chip/g/usb.c @@ -1347,8 +1347,8 @@ void usb_init(void) GINTMSK(RESETDET) | /* TODO: Do we need this? */ /* Idle, Suspend detected. Should go to sleep. */ GINTMSK(ERLYSUSP) | GINTMSK(USBSUSP) | - /* Watch for first SOF */ - GINTMSK(SOF); + /* Watch for first SOF and usb wakeup */ + GINTMSK(SOF) | GINTMSK(WKUPINT); /* Device registers have been setup */ GR_USB_DCTL |= DCTL_PWRONPRGDONE;