diff options
author | Mary Ruthven <mruthven@chromium.org> | 2016-07-14 18:43:12 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-19 16:32:10 -0700 |
commit | c0f6ac5e02cdb7a25f593af6dce7b0eea71d996d (patch) | |
tree | 9c6b8025c62cbaeb81f1da9168b159611340c40a /board | |
parent | 4cedfaab42ff020616a0445a96d13295f798d6ad (diff) | |
download | chrome-ec-c0f6ac5e02cdb7a25f593af6dce7b0eea71d996d.tar.gz |
g: disable usb wakeup when debug accessory is disconnected
USB is only used for CCD. USB should not be enabled as a wakeup source
unless a debug accessory is detected, because that is the only USB
traffic we care about. The rest may be from other sources like the HID
interface or something else using those signals. This change disables
the utmi wake source when the debug accessory is attached and enables it
when it is connected.
BUG=chrome-os-partner:54796
BRANCH=none
TEST=manual
The SPI_CS_L pin still gets triggered and will wake up cr50
before usb so disable wake up pins as a wakeup source.
Verify Cr50 goes to sleep and plugging in a SuzyQ will wake it
up and after removing it Cr50 will go back to sleep.
Change-Id: Ib97244016b0af244c340259915def9f4d8f97569
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/360693
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/cr50/rdd.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/board/cr50/rdd.c b/board/cr50/rdd.c index 2aab5be6a3..40a3cb08b7 100644 --- a/board/cr50/rdd.c +++ b/board/cr50/rdd.c @@ -14,7 +14,7 @@ #define CPRINTS(format, args...) cprints(CC_USB, format, ## args) -static int uart_enabled; +static int uart_enabled, enable_usb_wakeup; struct uart_config { const char *name; @@ -32,6 +32,12 @@ static int ccd_is_enabled(void) return !gpio_get_level(GPIO_CCD_MODE_L); } +int is_utmi_wakeup_allowed(void) +{ + return enable_usb_wakeup; +} + + /* If the UART TX is enabled the pinmux select will have a non-zero value */ int uartn_enabled(int uart) { @@ -89,6 +95,8 @@ void rdd_attached(void) /* Enable CCD */ ccd_set_mode(CCD_MODE_ENABLED); + enable_usb_wakeup = 1; + /* Enable device state monitoring */ device_detect_state_enable(1); } @@ -109,6 +117,8 @@ void rdd_detached(void) /* Done with case-closed debug mode */ gpio_set_level(GPIO_CCD_MODE_L, 1); + enable_usb_wakeup = 0; + /* Disable CCD */ ccd_set_mode(CCD_MODE_DISABLED); } |