summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2013-03-15 11:15:13 -0700
committerChromeBot <chrome-bot@google.com>2013-04-01 13:52:57 -0700
commitf9ed88d612297b40c6c7b072496c216a47d5eb6a (patch)
tree3aace67c24b0ab53c9ff40e519de8640b5ac1028
parent5838bd56096903eb3dec420fb0c3399fea52a870 (diff)
downloadchrome-ec-f9ed88d612297b40c6c7b072496c216a47d5eb6a.tar.gz
spring: Enable low power mode.
This mode was disabled initially to make sure it didn't side-effect things during early development. Now that branch is cut lets re-enable and backport when stability is proven. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=spring BUG=chrome-os-partner:17587 TEST=manual, install & run on Spring ... system functions. When device is plugged stays awake regardless of battery state. When device is unplugged sleeps and power is saved. When device is re-plugged awakes. Change-Id: I9a85fa7376d1a94c9864beed3d053e8b49480959 Reviewed-on: https://gerrit.chromium.org/gerrit/45594 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/46635
-rw-r--r--board/spring/board.h4
-rw-r--r--board/spring/usb_charging.c5
-rw-r--r--include/clock.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/board/spring/board.h b/board/spring/board.h
index 8c2a3932c4..d48cfee283 100644
--- a/board/spring/board.h
+++ b/board/spring/board.h
@@ -27,8 +27,8 @@
#undef CONFIG_TASK_PROFILING
#define CONFIG_WATCHDOG_HELP
-/* DE-ACTIVATED: use STOP mode when we have nothing to do */
-#undef CONFIG_LOW_POWER_IDLE
+/* use STOP mode when we have nothing to do */
+#define CONFIG_LOW_POWER_IDLE
/* Smart battery and TPSchrome are on a private I2C bus behind the EC */
#define CONFIG_I2C_PASSTHROUGH
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index a0bc3b1734..75b57826da 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -8,6 +8,7 @@
#include "adc.h"
#include "board.h"
#include "chipset.h"
+#include "clock.h"
#include "console.h"
#include "hooks.h"
#include "gpio.h"
@@ -495,6 +496,10 @@ static void usb_device_change(int dev_type)
keyboard_send_battery_key();
current_dev_type = dev_type;
+ if (dev_type)
+ disable_sleep(SLEEP_MASK_USB_PWR);
+ else
+ enable_sleep(SLEEP_MASK_USB_PWR);
}
/*
diff --git a/include/clock.h b/include/clock.h
index b2e3b81ac1..e70df962b1 100644
--- a/include/clock.h
+++ b/include/clock.h
@@ -46,6 +46,7 @@ enum {
SLEEP_MASK_UART = (1 << 1), /* UART communication on-going */
SLEEP_MASK_I2C = (1 << 2), /* I2C master communication on-going */
SLEEP_MASK_CHARGING = (1 << 3), /* Charging loop on-going */
+ SLEEP_MASK_USB_PWR = (1 << 4), /* USB power loop on-going */
SLEEP_MASK_FORCE = (1 << 31), /* Force disabling low power modes */
};