summaryrefslogtreecommitdiff
path: root/include/clock.h
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-06-15 19:37:54 +0000
committerGerrit <chrome-bot@google.com>2012-08-09 11:55:03 -0700
commitb081af1284c2e63747451bc8984d27e8430a9bb4 (patch)
tree733988cac0c88af67832712b6ddeeb8d02cacfce /include/clock.h
parent3a6a369d39512d8cc394936ec2ccea81c651816b (diff)
downloadchrome-ec-b081af1284c2e63747451bc8984d27e8430a9bb4.tar.gz
stm32f100: implement low power mode
When the AP is not running and we have enough time go to STOP mode instead of simple idle. The EC consumption should drop from 12mW to a few mW. This is currently not activated by default, you need to type "sleepmask 0" in the EC console to activate it. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8866 TEST=on Snow, check the software is still working properly when STOP mode is activated and measure power consumption on 3v_alw rail. Change-Id: I231d76fe6494c07b198c41694755b82d87c00e75 Reviewed-on: https://gerrit.chromium.org/gerrit/29315 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/clock.h')
-rw-r--r--include/clock.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/clock.h b/include/clock.h
index 209f42c0f0..c28dbb1bf2 100644
--- a/include/clock.h
+++ b/include/clock.h
@@ -23,4 +23,17 @@ int clock_enable_pll(int enable);
* clocks/timers are initialized. */
void clock_wait_cycles(uint32_t cycles);
+/* Low power modes for idle API */
+
+enum {
+ SLEEP_MASK_AP_RUN = (1 << 0), /* the main CPU is running */
+ SLEEP_MASK_UART = (1 << 1), /* UART communication on-going */
+ SLEEP_MASK_I2C = (1 << 2), /* I2C master communication on-going */
+
+ SLEEP_MASK_FORCE = (1 << 31), /* Force disabling low power modes */
+};
+
+void enable_sleep(uint32_t mask);
+void disable_sleep(uint32_t mask);
+
#endif /* __CROS_EC_CLOCK_H */