diff options
author | Aseda Aboagye <aaboagye@google.com> | 2017-05-31 16:38:00 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-06-01 00:51:38 -0700 |
commit | 01b811f56d384062256bb7d940e7b84c02b984f9 (patch) | |
tree | bd99793802857e99e776393eb693eb14d7891bf4 | |
parent | 440146ca1170ef4fa11d7dbab28bd81d0d833310 (diff) | |
download | chrome-ec-01b811f56d384062256bb7d940e7b84c02b984f9.tar.gz |
cr50: Have CCD_MODE_L respect "ccd keepalive".
If CCD was set to the "keepalive" mode, removing the debug accessory
would cause the CCD_MODE_L pin to be pulled high, ignoring the keepalive
state. CCD was still kept alive, but the state reflected on the pin
didn't indicate so.
This commit changes the behaviour such that the CCD_MODE_L pin is set up
as an input only when CCD keepalive is not enabled.
BUG=None
BRANCH=cr50
TEST=Plug in debug accessory and remove debug accessory. Verify that
CCD_MODE_L is high after removal.
TEST=Enable ccd keepalive. Remove debug accessory. Verify that
CCD_MODE_L is still low.
Change-Id: I407994d5c394a717d6e1a87f283f6441bd26bf55
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/520603
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r-- | board/cr50/rdd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/board/cr50/rdd.c b/board/cr50/rdd.c index f0071fefb5..106c559103 100644 --- a/board/cr50/rdd.c +++ b/board/cr50/rdd.c @@ -152,15 +152,16 @@ void rdd_attached(void) void rdd_detached(void) { /* - * Done with case-closed debug mode, therfore re-setup the CCD_MODE_L - * pin as an input. + * Done with case-closed debug mode, therefore re-setup the CCD_MODE_L + * pin as an input only if CCD mode isn't being forced enabled. * * NOTE: A pull up is required on this pin, however it was already * configured during the set up of the pinmux in gpio_pre_init(). The * chip-specific GPIO module will ignore any pull up/down configuration * anyways. */ - gpio_set_flags(GPIO_CCD_MODE_L, GPIO_INPUT); + if (!keep_ccd_enabled) + gpio_set_flags(GPIO_CCD_MODE_L, GPIO_INPUT); /* The device state module will handle the disabling of CCD. */ } |