summaryrefslogtreecommitdiff
path: root/zephyr/include/ap_power/ap_power.h
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/include/ap_power/ap_power.h')
-rw-r--r--zephyr/include/ap_power/ap_power.h56
1 files changed, 48 insertions, 8 deletions
diff --git a/zephyr/include/ap_power/ap_power.h b/zephyr/include/ap_power/ap_power.h
index 182e81ca4d..05387d8431 100644
--- a/zephyr/include/ap_power/ap_power.h
+++ b/zephyr/include/ap_power/ap_power.h
@@ -1,4 +1,4 @@
-/* Copyright 2022 The Chromium OS Authors. All rights reserved.
+/* Copyright 2022 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -9,7 +9,16 @@
*
* Defines the API for AP event notification,
* the API to register and receive notification callbacks when
- * application processor (AP) events happen
+ * application processor (AP) events happen.
+ *
+ * When the Zephyr based AP power sequence config is enabled,
+ * the callbacks are almost all invoked within the context
+ * of the power sequence task, so the state is stable
+ * during the callback. The only exception to this is AP_POWER_RESET, which is
+ * invoked as a result of receiving a PLTRST# virtual wire signal (if enabled).
+ *
+ * When the legacy power sequence config is enabled, the callbacks are invoked
+ * from the HOOK_CHIPSET notifications.
*/
#ifndef __AP_POWER_AP_POWER_H__
@@ -87,6 +96,36 @@ enum ap_power_events {
AP_POWER_HARD_OFF = BIT(8),
/** Software reset occurred */
AP_POWER_RESET = BIT(9),
+ /**
+ * AP power state is now known.
+ *
+ * Prior to this event, the state of the AP is unknown
+ * and invalid. When this event is sent, the state is known
+ * and can be queried. Used by clients when their
+ * initialization depends upon the initial state of the AP.
+ */
+ AP_POWER_INITIALIZED = BIT(10),
+
+ /**
+ * S0ix suspend starts.
+ */
+ AP_POWER_S0IX_SUSPEND_START = BIT(11),
+ /**
+ * Transitioning from s0 to s0ix.
+ */
+ AP_POWER_S0IX_SUSPEND = BIT(12),
+ /**
+ * Transitioning from s0ix to s0.
+ */
+ AP_POWER_S0IX_RESUME = BIT(13),
+ /**
+ * si0x resume complete.
+ */
+ AP_POWER_S0IX_RESUME_COMPLETE = BIT(14),
+ /**
+ * Reset s0ix tracking.
+ */
+ AP_POWER_S0IX_RESET_TRACKING = BIT(15),
};
/**
@@ -113,12 +152,12 @@ typedef void (*ap_power_ev_callback_handler_t)(struct ap_power_ev_callback *cb,
* are unique pointers of struct ap_power_ev_callback.
* The storage must be static.
*
- * ap_power_ev_init_callback can be used to initialise this structure.
+ * ap_power_ev_init_callback can be used to initialize this structure.
*/
struct ap_power_ev_callback {
- sys_snode_t node; /* Only usable by AP power event code */
+ sys_snode_t node; /* Only usable by AP power event code */
ap_power_ev_callback_handler_t handler;
- enum ap_power_events events; /* Events to listen for */
+ enum ap_power_events events; /* Events to listen for */
};
/** @endcond */
@@ -129,9 +168,10 @@ struct ap_power_ev_callback {
* @param handler The function pointer to call.
* @param events The bitmask of events to be called for.
*/
-static inline void ap_power_ev_init_callback(struct ap_power_ev_callback *cb,
- ap_power_ev_callback_handler_t handler,
- enum ap_power_events events)
+static inline void
+ap_power_ev_init_callback(struct ap_power_ev_callback *cb,
+ ap_power_ev_callback_handler_t handler,
+ enum ap_power_events events)
{
__ASSERT(cb, "Callback pointer should not be NULL");
__ASSERT(handler, "Callback handler pointer should not be NULL");