summaryrefslogtreecommitdiff
path: root/include/chipset.h
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-04-18 18:44:25 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-19 19:28:41 -0700
commite54c3e1728cc4648e2c489770bcad678e985b129 (patch)
tree90172db586990b01355de20805796eedf109e802 /include/chipset.h
parentff9248fbaabef72761728140c2e65d0aa02dc17c (diff)
downloadchrome-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 'include/chipset.h')
-rw-r--r--include/chipset.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/chipset.h b/include/chipset.h
index 775428ed9f..ba78c45397 100644
--- a/include/chipset.h
+++ b/include/chipset.h
@@ -87,6 +87,11 @@ void power_interrupt(enum gpio_signal signal);
*/
void chipset_handle_espi_reset_assert(void);
+/**
+ * Perform chipset pre-initialization work within the context of chipset task.
+ */
+void chipset_pre_init_callback(void);
+
#else /* !HAS_TASK_CHIPSET */
/* When no chipset is present, assume it is always off. */