summaryrefslogtreecommitdiff
path: root/common/hooks.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-04-19 12:42:35 -0700
committerRandall Spangler <rspangler@chromium.org>2012-04-19 13:08:58 -0700
commitf4e772708bde3e4e1d184190a7f0be2417d2029a (patch)
tree4b668c02a9a6dca2704e6d0a8b3cb8e5c9e95b76 /common/hooks.c
parentd5d2159c6d215b3a0feca42d961985cd37603ca8 (diff)
downloadchrome-ec-f4e772708bde3e4e1d184190a7f0be2417d2029a.tar.gz
Added HOOK_INIT for driver module inits
This covers modules which need to initialize before task_start(), but don't particularly care in what order they're initialized. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=if it boots, it works Change-Id: I69829aac8d1c3c14ee04916a794b84bbf03a09eb
Diffstat (limited to 'common/hooks.c')
-rw-r--r--common/hooks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/hooks.c b/common/hooks.c
index 94bf2627fb..58ff10546a 100644
--- a/common/hooks.c
+++ b/common/hooks.c
@@ -10,6 +10,8 @@
#include "util.h"
/* Hooks are described in special sections */
+extern const struct hook_data __hooks_init[];
+extern const struct hook_data __hooks_init_end[];
extern const struct hook_data __hooks_freq_change[];
extern const struct hook_data __hooks_freq_change_end[];
@@ -23,6 +25,10 @@ int hook_notify(enum hook_type type, int stop_on_error)
/* Get the start and end pointers for the hook type */
switch (type) {
+ case HOOK_INIT:
+ start = __hooks_init;
+ end = __hooks_init_end;
+ break;
case HOOK_FREQ_CHANGE:
start = __hooks_freq_change;
end = __hooks_freq_change_end;