Angel Pons | 60ec365 | 2020-04-03 01:22:13 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 2 | |
| 3 | #ifndef MAINBOARD_EC_H |
| 4 | #define MAINBOARD_EC_H |
| 5 | |
Aaron Durbin | 91fa9d7 | 2016-09-23 16:38:27 -0500 | [diff] [blame] | 6 | #include <ec/ec.h> |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 7 | #include <ec/google/chromeec/ec_commands.h> |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 8 | |
| 9 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 10 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 11 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 12 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 13 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 14 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 15 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 16 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 17 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_STATUS) |\ |
| 18 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 19 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\ |
| 20 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\ |
Gwendal Grignou | 95b7a6c | 2016-05-03 23:53:23 -0700 | [diff] [blame] | 21 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU) |\ |
| 22 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP)) |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 23 | |
| 24 | #define MAINBOARD_EC_SMI_EVENTS \ |
| 25 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 26 | |
| 27 | /* EC can wake from S5 with lid or power button */ |
| 28 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
| 29 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 30 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 31 | |
| 32 | /* EC can wake from S3 with lid or power button or key press */ |
| 33 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 34 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 35 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 36 | |
| 37 | /* Log EC wake events plus EC shutdown events */ |
| 38 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 39 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 40 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\ |
| 41 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC)) |
| 42 | |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 43 | #endif |