diff options
author | Furquan Shaikh <furquan@google.com> | 2018-04-18 18:44:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-04-19 19:28:41 -0700 |
commit | e54c3e1728cc4648e2c489770bcad678e985b129 (patch) | |
tree | 90172db586990b01355de20805796eedf109e802 /power | |
parent | ff9248fbaabef72761728140c2e65d0aa02dc17c (diff) | |
download | chrome-ec-e54c3e1728cc4648e2c489770bcad678e985b129.tar.gz |
chipset: Add callback for chipset pre-initialization
This change adds a callback for chipset_pre_init_callback which is
made by x86 common power state machine when in G3S5 state. Until now,
there was a hook CHIPSET_PRE_INIT_CALLBACK that was notified by
chipset task when in G3S5 state. However, there are at least following
reasons why this should be a callback and not a hook notification:
1. The initialization that is done as part of pre-init could be
essential for the power state machine to make progress. Though the
chipset task goes to sleep waiting for power signals after the hook
notification, pre-initialization can all be done as part of a callback
since it is mostly board-specific code that is doing work to
initialize PMIC.
2. Typically, boards use I2C transactions to setup PMIC on getting
chipset pre-init notification. However, since i2c transfers are not
encouraged in hook task, they have to be deferred anyways.
3. Since the initialization is being done as part of hook task, use of
any constructs e.g. pwr_5v_en_req which allows multiple consumers to
enable/disable power rails will use task id for hook task. Instead it
is better to provide correct information about the task by letting
chipset task perform this request.
Thus, this change adds a callback chipset_pre_init_callback in G3S5
state for x86 power state machine. This callback is guarded by
CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK.
The hook notification is left as is for now until all x86 boards are
moved over to using the newly added callback.
BUG=b:78259506
BRANCH=None
TEST=None
Change-Id: I2e1d73e5308759fef41680ae715ef71268b61780
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1018733
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'power')
-rw-r--r-- | power/intel_x86.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/power/intel_x86.c b/power/intel_x86.c index bc58d26711..df76dac8f8 100644 --- a/power/intel_x86.c +++ b/power/intel_x86.c @@ -308,6 +308,14 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state) msleep(200); #endif +#ifdef CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK + /* + * Callback to do pre-initialization within the context of + * chipset task. + */ + chipset_pre_init_callback(); +#endif + /* Call hooks to initialize PMIC */ hook_notify(HOOK_CHIPSET_PRE_INIT); |