diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-06-20 09:07:52 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-07-04 06:51:01 -0700 |
commit | e3336f4c8d4fb59137d35f87f4a42d22848aabcd (patch) | |
tree | bd4f65f658a76c2e80c3c868880cae24ecaa6dda /include/system.h | |
parent | d68b1ca803a200bc30c1baa0552f6e4a4fcf72fd (diff) | |
download | chrome-ec-e3336f4c8d4fb59137d35f87f4a42d22848aabcd.tar.gz |
chip/stm32/pwm: Prevent sleeping while PWM output is active
STM32F0 cannot keep PWM output active when chip is in deep sleep.
The only other board that uses both CONFIG_LOW_POWER_IDLE
and CONFIG_PWM on stm32 is jerry, and this logic should also apply
to it.
Also, switch using_pwm from array to bitmask to simplify handling.
BRANCH=none
BUG=b:36173380
TEST=On AP, tell it to autosuspend hammer:
echo auto > /sys/bus/usb/devices/1-2/power/control
Then see, using idlestats, that hammer does to deep sleep.
In hammer console: pwm 0 50, see that PWM output is stable,
idlestats shows EC does not sleep.
In hammer console: pwm 0 -1, idlestats shows EC sleeps again.
Change-Id: Ic74c1905364fe4335239da95a99193d0e3e979f7
Reviewed-on: https://chromium-review.googlesource.com/541115
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/system.h')
-rw-r--r-- | include/system.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h index 8bc63332c2..cd7f42817e 100644 --- a/include/system.h +++ b/include/system.h @@ -388,6 +388,7 @@ enum { SLEEP_MASK_I2C_SLAVE = (1 << 7), /* I2C slave communication ongoing */ SLEEP_MASK_FAN = (1 << 8), /* Fan control loop ongoing */ SLEEP_MASK_USB_DEVICE = (1 << 9), /* Generic USB device in use */ + SLEEP_MASK_PWM = (1 << 10), /* PWM output is enabled */ SLEEP_MASK_FORCE_NO_DSLEEP = (1 << 15), /* Force disable. */ |