aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/cros_ec_commands.h72
1 files changed, 70 insertions, 2 deletions
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index cc054a0a4c4c..7f98c6e63ad1 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -4045,6 +4045,40 @@ struct ec_params_dedicated_charger_limit {
4045 uint16_t voltage_lim; /* in mV */ 4045 uint16_t voltage_lim; /* in mV */
4046} __ec_align2; 4046} __ec_align2;
4047 4047
4048/*****************************************************************************/
4049/* Hibernate/Deep Sleep Commands */
4050
4051/* Set the delay before going into hibernation. */
4052#define EC_CMD_HIBERNATION_DELAY 0x00A8
4053
4054struct ec_params_hibernation_delay {
4055 /*
4056 * Seconds to wait in G3 before hibernate. Pass in 0 to read the
4057 * current settings without changing them.
4058 */
4059 uint32_t seconds;
4060} __ec_align4;
4061
4062struct ec_response_hibernation_delay {
4063 /*
4064 * The current time in seconds in which the system has been in the G3
4065 * state. This value is reset if the EC transitions out of G3.
4066 */
4067 uint32_t time_g3;
4068
4069 /*
4070 * The current time remaining in seconds until the EC should hibernate.
4071 * This value is also reset if the EC transitions out of G3.
4072 */
4073 uint32_t time_remaining;
4074
4075 /*
4076 * The current time in seconds that the EC should wait in G3 before
4077 * hibernating.
4078 */
4079 uint32_t hibernate_delay;
4080} __ec_align4;
4081
4048/* Inform the EC when entering a sleep state */ 4082/* Inform the EC when entering a sleep state */
4049#define EC_CMD_HOST_SLEEP_EVENT 0x00A9 4083#define EC_CMD_HOST_SLEEP_EVENT 0x00A9
4050 4084
@@ -4052,7 +4086,9 @@ enum host_sleep_event {
4052 HOST_SLEEP_EVENT_S3_SUSPEND = 1, 4086 HOST_SLEEP_EVENT_S3_SUSPEND = 1,
4053 HOST_SLEEP_EVENT_S3_RESUME = 2, 4087 HOST_SLEEP_EVENT_S3_RESUME = 2,
4054 HOST_SLEEP_EVENT_S0IX_SUSPEND = 3, 4088 HOST_SLEEP_EVENT_S0IX_SUSPEND = 3,
4055 HOST_SLEEP_EVENT_S0IX_RESUME = 4 4089 HOST_SLEEP_EVENT_S0IX_RESUME = 4,
4090 /* S3 suspend with additional enabled wake sources */
4091 HOST_SLEEP_EVENT_S3_WAKEABLE_SUSPEND = 5,
4056}; 4092};
4057 4093
4058struct ec_params_host_sleep_event { 4094struct ec_params_host_sleep_event {
@@ -4117,6 +4153,36 @@ struct ec_response_host_sleep_event_v1 {
4117} __ec_align4; 4153} __ec_align4;
4118 4154
4119/*****************************************************************************/ 4155/*****************************************************************************/
4156/* Device events */
4157#define EC_CMD_DEVICE_EVENT 0x00AA
4158
4159enum ec_device_event {
4160 EC_DEVICE_EVENT_TRACKPAD,
4161 EC_DEVICE_EVENT_DSP,
4162 EC_DEVICE_EVENT_WIFI,
4163};
4164
4165enum ec_device_event_param {
4166 /* Get and clear pending device events */
4167 EC_DEVICE_EVENT_PARAM_GET_CURRENT_EVENTS,
4168 /* Get device event mask */
4169 EC_DEVICE_EVENT_PARAM_GET_ENABLED_EVENTS,
4170 /* Set device event mask */
4171 EC_DEVICE_EVENT_PARAM_SET_ENABLED_EVENTS,
4172};
4173
4174#define EC_DEVICE_EVENT_MASK(event_code) BIT(event_code % 32)
4175
4176struct ec_params_device_event {
4177 uint32_t event_mask;
4178 uint8_t param;
4179} __ec_align_size1;
4180
4181struct ec_response_device_event {
4182 uint32_t event_mask;
4183} __ec_align4;
4184
4185/*****************************************************************************/
4120/* Smart battery pass-through */ 4186/* Smart battery pass-through */
4121 4187
4122/* Get / Set 16-bit smart battery registers */ 4188/* Get / Set 16-bit smart battery registers */
@@ -4361,12 +4427,14 @@ enum ec_reboot_cmd {
4361 /* (command 3 was jump to RW-B) */ 4427 /* (command 3 was jump to RW-B) */
4362 EC_REBOOT_COLD = 4, /* Cold-reboot */ 4428 EC_REBOOT_COLD = 4, /* Cold-reboot */
4363 EC_REBOOT_DISABLE_JUMP = 5, /* Disable jump until next reboot */ 4429 EC_REBOOT_DISABLE_JUMP = 5, /* Disable jump until next reboot */
4364 EC_REBOOT_HIBERNATE = 6 /* Hibernate EC */ 4430 EC_REBOOT_HIBERNATE = 6, /* Hibernate EC */
4431 EC_REBOOT_HIBERNATE_CLEAR_AP_OFF = 7, /* and clears AP_OFF flag */
4365}; 4432};
4366 4433
4367/* Flags for ec_params_reboot_ec.reboot_flags */ 4434/* Flags for ec_params_reboot_ec.reboot_flags */
4368#define EC_REBOOT_FLAG_RESERVED0 BIT(0) /* Was recovery request */ 4435#define EC_REBOOT_FLAG_RESERVED0 BIT(0) /* Was recovery request */
4369#define EC_REBOOT_FLAG_ON_AP_SHUTDOWN BIT(1) /* Reboot after AP shutdown */ 4436#define EC_REBOOT_FLAG_ON_AP_SHUTDOWN BIT(1) /* Reboot after AP shutdown */
4437#define EC_REBOOT_FLAG_SWITCH_RW_SLOT BIT(2) /* Switch RW slot */
4370 4438
4371struct ec_params_reboot_ec { 4439struct ec_params_reboot_ec {
4372 uint8_t cmd; /* enum ec_reboot_cmd */ 4440 uint8_t cmd; /* enum ec_reboot_cmd */