summaryrefslogtreecommitdiff
path: root/common/system.c
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-11-09 13:39:42 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-18 04:46:39 +0000
commit6a6594031f47d462c6c319283752e715a358c6b5 (patch)
tree2574a10f45c1f68f8e176fc0486c926814519d84 /common/system.c
parent886a1815625b5539c32efc0d601541d44a0b2410 (diff)
downloadchrome-ec-6a6594031f47d462c6c319283752e715a358c6b5.tar.gz
Revert "cleanup: use STATIC_IF for hibernate variables"
This reverts commit 7470bbfae198c0efd07ece8dceac714d8ad0a6ff. Merge conflict RESET_FLAG_AP_OFF renamed to EC_RESET_FLAG_AP_OFF BUG=b:200823466 TEST=make buildall -j Change-Id: I0230d964ea85ef8aba1de60a577cf811a11ade49 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273363 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r--common/system.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/common/system.c b/common/system.c
index 67185aa512..c665498b0d 100644
--- a/common/system.c
+++ b/common/system.c
@@ -90,8 +90,10 @@ static int disable_jump; /* Disable ALL jumps if system is locked */
static int force_locked; /* Force system locked even if WP isn't enabled */
static enum ec_reboot_cmd reboot_at_shutdown;
-STATIC_IF(CONFIG_HIBERNATE) uint32_t hibernate_seconds;
-STATIC_IF(CONFIG_HIBERNATE) uint32_t hibernate_microseconds;
+#ifdef CONFIG_HIBERNATE
+static uint32_t hibernate_seconds;
+static uint32_t hibernate_microseconds;
+#endif
/* On-going actions preventing going into deep-sleep mode */
uint32_t sleep_mask;
@@ -881,24 +883,21 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd)
case EC_REBOOT_DISABLE_JUMP:
system_disable_jump();
return EC_SUCCESS;
+#ifdef CONFIG_HIBERNATE
case EC_REBOOT_HIBERNATE_CLEAR_AP_OFF:
- if (!IS_ENABLED(CONFIG_HIBERNATE))
- return EC_ERROR_INVAL;
-
- if (IS_ENABLED(CONFIG_POWER_BUTTON_INIT_IDLE)) {
- CPRINTS("Clearing AP_OFF");
- chip_save_reset_flags(chip_read_reset_flags() &
- ~EC_RESET_FLAG_AP_OFF);
- }
+#ifdef CONFIG_POWER_BUTTON_INIT_IDLE
+ CPRINTS("Clearing AP_OFF");
+ chip_save_reset_flags(
+ chip_read_reset_flags() &
+ ~EC_RESET_FLAG_AP_OFF);
+#endif
/* Intentional fall-through */
case EC_REBOOT_HIBERNATE:
- if (!IS_ENABLED(CONFIG_HIBERNATE))
- return EC_ERROR_INVAL;
-
CPRINTS("system hibernating");
system_hibernate(hibernate_seconds, hibernate_microseconds);
/* That shouldn't return... */
return EC_ERROR_UNKNOWN;
+#endif
default:
return EC_ERROR_INVAL;
}
@@ -969,7 +968,8 @@ DECLARE_CONSOLE_COMMAND(scratchpad, command_scratchpad,
"Get or set scratchpad value");
#endif /* CONFIG_CMD_SCRATCHPAD */
-__maybe_unused static int command_hibernate(int argc, char **argv)
+#ifdef CONFIG_HIBERNATE
+static int command_hibernate(int argc, char **argv)
{
int seconds = 0;
int microseconds = 0;
@@ -1001,7 +1001,6 @@ __maybe_unused static int command_hibernate(int argc, char **argv)
return EC_SUCCESS;
}
-#ifdef CONFIG_HIBERNATE
DECLARE_CONSOLE_COMMAND(hibernate, command_hibernate,
"[sec] [usec]",
"Hibernate the EC");