diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-04-23 17:02:07 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-25 17:03:18 -0700 |
commit | 45bc5c1a2135eaae05978d371cff17fb810b9951 (patch) | |
tree | 38d71db1f356c86e37bbadedd384d000a329dfaf /core | |
parent | b4b2c6ae7026569b21749dab563114f95d4c7396 (diff) | |
download | chrome-ec-45bc5c1a2135eaae05978d371cff17fb810b9951.tar.gz |
Split out power button code from switch.c
The power button code is platform-independent. This change splits the
code out of the LM4 switch.c module so that a subseqent change to
STM32 platforms can start using it.
BUG=chrome-os-partner:18945
BRANCH=none
TEST=manual
1. Power+refresh+esc goes to recovery mode,
2. Press power button at recovery screen turns off.
3. With system off, power button turns system on.
4. Press power button for a second; screen locks.
5. Press power button while typing; blocks keystrokes while it's pressed.
6. Hold power button down for 8 sec; system forced to shutdown.
7. From EC console, with system on:
hostevent clear
hostevent -> event 0x04 is clear
press power button
hostevent -> event 0x04 is set
8. From EC console, with system off:
powerbtn -> system turns on
powerbtn 5000 -> system turns off, just like power button was held for 5 sec
Change-Id: If2a9b02514a201e1d03c857d128e2ccab51a16ef
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49217
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/cortex-m/ec.lds.S | 4 | ||||
-rw-r--r-- | core/cortex-m/link_defs.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 339ee4f435..9a8f09c9ba 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -96,6 +96,10 @@ SECTIONS *(.rodata.HOOK_LID_CHANGE) __hooks_lid_change_end = .; + __hooks_pwrbtn_change = .; + *(.rodata.HOOK_POWER_BUTTON_CHANGE) + __hooks_pwrbtn_change_end = .; + __hooks_tick = .; *(.rodata.HOOK_TICK) __hooks_tick_end = .; diff --git a/core/cortex-m/link_defs.h b/core/cortex-m/link_defs.h index f78a7c46c4..6681d6b371 100644 --- a/core/cortex-m/link_defs.h +++ b/core/cortex-m/link_defs.h @@ -38,6 +38,8 @@ extern const struct hook_data __hooks_ac_change[]; extern const struct hook_data __hooks_ac_change_end[]; extern const struct hook_data __hooks_lid_change[]; extern const struct hook_data __hooks_lid_change_end[]; +extern const struct hook_data __hooks_pwrbtn_change[]; +extern const struct hook_data __hooks_pwrbtn_change_end[]; extern const struct hook_data __hooks_tick[]; extern const struct hook_data __hooks_tick_end[]; extern const struct hook_data __hooks_second[]; |