summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorYilun Lin <yllin@chromium.org>2019-08-20 13:46:44 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-22 08:48:58 +0000
commitbe490b7261308362c6831ba2804c1504ba6aac15 (patch)
treedf7beea4424b322f718ce9016d89eb4314188ae6 /power
parent60c1f84d024395fac90f144ad5a027f56b5ff3d0 (diff)
downloadchrome-ec-be490b7261308362c6831ba2804c1504ba6aac15.tar.gz
power: Replace weak attr with __overridable
This CL annotates __overridable to the following functions: board_system_is_idle power_chipset_handle_host_sleep_event power_board_handle_host_sleep_event TEST=make buildall BUG=none BRANCH=none Change-Id: I0168b69c49fab5672238711d4f3a6a5517cdd8b3 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1761759 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/common.c12
-rw-r--r--power/intel_x86.c10
2 files changed, 10 insertions, 12 deletions
diff --git a/power/common.c b/power/common.c
index 7dddd00682..f0fc3117d3 100644
--- a/power/common.c
+++ b/power/common.c
@@ -290,9 +290,8 @@ static void power_set_active_wake_mask(void)
static void power_set_active_wake_mask(void) { }
#endif
-__attribute__((weak))
-enum critical_shutdown board_system_is_idle(uint64_t last_shutdown_time,
- uint64_t *target, uint64_t now)
+__overridable enum critical_shutdown board_system_is_idle(
+ uint64_t last_shutdown_time, uint64_t *target, uint64_t now)
{
return now > *target ?
CRITICAL_SHUTDOWN_HIBERNATE : CRITICAL_SHUTDOWN_IGNORE;
@@ -882,9 +881,8 @@ DECLARE_CONSOLE_COMMAND(pause_in_s5, command_pause_in_s5,
/* Track last reported sleep event */
static enum host_sleep_event host_sleep_state;
-void __attribute__((weak))
-power_chipset_handle_host_sleep_event(enum host_sleep_event state,
- struct host_sleep_event_context *ctx)
+__overridable void power_chipset_handle_host_sleep_event(
+ enum host_sleep_event state, struct host_sleep_event_context *ctx)
{
/* Default weak implementation -- no action required. */
}
@@ -955,7 +953,7 @@ void power_set_host_sleep_state(enum host_sleep_event state)
static uint32_t pwr_5v_en_req;
static struct mutex pwr_5v_ctl_mtx;
-void __attribute__((weak)) power_5v_enable(task_id_t tid, int enable)
+void power_5v_enable(task_id_t tid, int enable)
{
mutex_lock(&pwr_5v_ctl_mtx);
diff --git a/power/intel_x86.c b/power/intel_x86.c
index 1574041ae4..093e9cbc1a 100644
--- a/power/intel_x86.c
+++ b/power/intel_x86.c
@@ -641,15 +641,15 @@ void common_intel_x86_handle_rsmrst(enum power_state state)
#ifdef CONFIG_POWER_TRACK_HOST_SLEEP_STATE
-void __attribute__((weak))
-power_board_handle_host_sleep_event(enum host_sleep_event state)
+__overridable void power_board_handle_host_sleep_event(
+ enum host_sleep_event state)
{
/* Default weak implementation -- no action required. */
}
-void
-power_chipset_handle_host_sleep_event(enum host_sleep_event state,
- struct host_sleep_event_context *ctx)
+__override void power_chipset_handle_host_sleep_event(
+ enum host_sleep_event state,
+ struct host_sleep_event_context *ctx)
{
power_board_handle_host_sleep_event(state);