summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2016-08-05 12:50:14 -0700
committerMary Ruthven <mruthven@chromium.org>2016-08-08 15:21:49 +0000
commit1e6cbc725f90784bbe80361e9c1dd07da1ab6a79 (patch)
tree09a3615655aed9d7c9bbe122d35c848f1fa53943 /chip
parent320275939ebc602550f202e48b1d1ca977e7815e (diff)
downloadchrome-ec-1e6cbc725f90784bbe80361e9c1dd07da1ab6a79.tar.gz
g: fix rdd sleep
This change disables sleep only when a cable is actually detected. Before it would disable sleep no matter what and if a debug cable was not plugged in and then deteached then it would never enable it. BUG=none BRANCH=none TEST=manual update cr50 unplug suzyq boot to kernel verify cr50 is asleep run 'powerd_dbus_suspend' cr50 will wake up for like a second then go back to sleep run 'apreset' on EC console boot to kernel verify cr50 is asleep run 'powerd_dbus_suspend' cr50 will wake up for like a second then go back to sleep Change-Id: I8337f694853b7840ef932b38bd0fa6453d31cb3d Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/366861 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/g/rdd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/chip/g/rdd.c b/chip/g/rdd.c
index eedf27d9db..7bcd172827 100644
--- a/chip/g/rdd.c
+++ b/chip/g/rdd.c
@@ -10,6 +10,7 @@
#include "registers.h"
#include "system.h"
#include "task.h"
+#include "timer.h"
#include "usb_api.h"
#define CPRINTS(format, args...) cprints(CC_USB, format, ## args)
@@ -34,12 +35,14 @@ void rdd_interrupt(void)
{
int is_debug, current_map;
- disable_sleep(SLEEP_MASK_RDD);
+ delay_sleep_by(1 * SECOND);
current_map = 0xffff & GREAD(RDD, PROG_DEBUG_STATE_MAP);
is_debug = debug_cable_is_attached();
if (is_debug && (current_map == DETECT_DEBUG)) {
+ disable_sleep(SLEEP_MASK_RDD);
+
CPRINTS("Debug Accessory connected");
/* Detect when debug cable is disconnected */