summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-01-28 10:01:57 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-29 18:04:13 +0000
commit863d8d8344ce306668fc0e88c78a928e4e2716af (patch)
treeada71cadc80c45c32ebd0413dd3fe6d2da1684cb
parent47becbcb7397f4c70ecf0dbac60b5f6e5bdd9ea3 (diff)
downloadchrome-ec-863d8d8344ce306668fc0e88c78a928e4e2716af.tar.gz
hooks: add HOOK_PRIO_POST_LID
Add the HOOK_PRIO_POST_LID alias for (HOOK_PRIO_INIT_LID+1). This more clearly identifies the intent of this priority level. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I7042b7f4244b5ed48dac67dc9eb4deaca81000b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553672 Reviewed-by: Tristan Honscheid <honscheid@google.com>
-rw-r--r--common/keyboard_scan.c2
-rw-r--r--common/mkbp_input_devices.c6
-rw-r--r--include/hooks.h1
3 files changed, 5 insertions, 4 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index f56d5985d3..26ffde96dc 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -963,7 +963,7 @@ static void keyboard_lid_change(void)
keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_CLOSED);
}
DECLARE_HOOK(HOOK_LID_CHANGE, keyboard_lid_change, HOOK_PRIO_DEFAULT);
-DECLARE_HOOK(HOOK_INIT, keyboard_lid_change, HOOK_PRIO_INIT_LID + 1);
+DECLARE_HOOK(HOOK_INIT, keyboard_lid_change, HOOK_PRIO_POST_LID);
#endif
diff --git a/common/mkbp_input_devices.c b/common/mkbp_input_devices.c
index 43dc1b1612..7cba670eb1 100644
--- a/common/mkbp_input_devices.c
+++ b/common/mkbp_input_devices.c
@@ -115,7 +115,7 @@ static void mkbp_lid_change(void)
mkbp_update_switches(EC_MKBP_LID_OPEN, lid_is_open());
}
DECLARE_HOOK(HOOK_LID_CHANGE, mkbp_lid_change, HOOK_PRIO_LAST);
-DECLARE_HOOK(HOOK_INIT, mkbp_lid_change, HOOK_PRIO_INIT_LID+1);
+DECLARE_HOOK(HOOK_INIT, mkbp_lid_change, HOOK_PRIO_POST_LID);
#endif
#ifdef CONFIG_TABLET_MODE_SWITCH
@@ -124,7 +124,7 @@ static void mkbp_tablet_mode_change(void)
mkbp_update_switches(EC_MKBP_TABLET_MODE, tablet_get_mode());
}
DECLARE_HOOK(HOOK_TABLET_MODE_CHANGE, mkbp_tablet_mode_change, HOOK_PRIO_LAST);
-DECLARE_HOOK(HOOK_INIT, mkbp_tablet_mode_change, HOOK_PRIO_INIT_LID+1);
+DECLARE_HOOK(HOOK_INIT, mkbp_tablet_mode_change, HOOK_PRIO_POST_LID);
#endif
#ifdef CONFIG_BASE_ATTACHED_SWITCH
@@ -134,7 +134,7 @@ static void mkbp_base_attached_change(void)
}
DECLARE_HOOK(HOOK_BASE_ATTACHED_CHANGE, mkbp_base_attached_change,
HOOK_PRIO_LAST);
-DECLARE_HOOK(HOOK_INIT, mkbp_base_attached_change, HOOK_PRIO_INIT_LID+1);
+DECLARE_HOOK(HOOK_INIT, mkbp_base_attached_change, HOOK_PRIO_POST_LID);
#endif
static void mkbp_report_switch_on_init(void)
diff --git a/include/hooks.h b/include/hooks.h
index 429b09c3d3..8f64e6d241 100644
--- a/include/hooks.h
+++ b/include/hooks.h
@@ -34,6 +34,7 @@ enum hook_priority {
HOOK_PRIO_INIT_CHIPSET = HOOK_PRIO_FIRST + 3,
/* Lid switch inits before power button */
HOOK_PRIO_INIT_LID = HOOK_PRIO_FIRST + 4,
+ HOOK_PRIO_POST_LID = HOOK_PRIO_INIT_LID + 1,
/* Power button inits before chipset and switch */
HOOK_PRIO_INIT_POWER_BUTTON = HOOK_PRIO_FIRST + 5,
/* Init switch states after power button / lid */