summaryrefslogtreecommitdiff
path: root/chip/npcx
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-06-12 12:47:14 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-13 02:14:49 +0000
commit4508ef09d187de4f2cb0c7a15a9708b09d892af1 (patch)
treee62394dcf82a46e18d5a8b79113d12d760af3460 /chip/npcx
parentb6a6fc50137bc012079f78b5e627689ea0199cdf (diff)
downloadchrome-ec-4508ef09d187de4f2cb0c7a15a9708b09d892af1.tar.gz
PB: Make CONFIG_POWER_BUTTON_INIT_IDLE common
Currently CONFIG_POWER_BUTTON_INIT_IDLE is available only for NPCX chips. This patch moves the code to common/power_button.c. There is no functionality change. BUG=b:37536389 BRANCH=none TEST=Verify no functionality change on Puff. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ib4b1182900acea21e5210a2f9a699da18fe55611 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2242661 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'chip/npcx')
-rw-r--r--chip/npcx/system.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index 64ba4d8e23..14e5b4ced6 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -318,38 +318,6 @@ uint32_t chip_read_reset_flags(void)
return bbram_data_read(BBRM_DATA_INDEX_SAVED_RESET_FLAGS);
}
-#ifdef CONFIG_POWER_BUTTON_INIT_IDLE
-/*
- * Set/clear AP_OFF flag. It's set when the system gracefully shuts down and
- * it's cleared when the system boots up. The result is the system tries to
- * go back to the previous state upon AC plug-in. If the system uncleanly
- * shuts down, it boots immediately. If the system shuts down gracefully,
- * it'll stay at S5 and wait for power button press.
- */
-static void board_chipset_startup(void)
-{
- uint32_t flags = chip_read_reset_flags();
- flags &= ~EC_RESET_FLAG_AP_IDLE;
- chip_save_reset_flags(flags);
- system_clear_reset_flags(EC_RESET_FLAG_AP_IDLE);
- CPRINTS("Cleared AP_IDLE flag");
-}
-DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT);
-
-static void board_chipset_shutdown(void)
-{
- uint32_t flags = chip_read_reset_flags();
- flags |= EC_RESET_FLAG_AP_IDLE;
- chip_save_reset_flags(flags);
- system_set_reset_flags(EC_RESET_FLAG_AP_IDLE);
- CPRINTS("Saved AP_IDLE flag");
-}
-DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown,
- /* Slightly higher than handle_pending_reboot because
- * it may clear AP_OFF flag. */
- HOOK_PRIO_DEFAULT - 1);
-#endif
-
static void check_reset_cause(void)
{
uint32_t hib_wake_flags = bbram_data_read(BBRM_DATA_INDEX_WAKE);