Angel Pons | 62079a5 | 2020-04-05 13:21:34 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Georgi | 406313d | 2015-07-20 22:01:32 +0200 | [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> |
Patrick Georgi | 406313d | 2015-07-20 22:01:32 +0200 | [diff] [blame] | 7 | #include <ec/google/chromeec/ec_commands.h> |
Matt DeVillier | 19e7060 | 2018-07-08 19:22:05 -0500 | [diff] [blame] | 8 | #include <variant/ec.h> |
Patrick Georgi | 406313d | 2015-07-20 22:01:32 +0200 | [diff] [blame] | 9 | |
Karthikeyan Ramasubramanian | 017b5c4 | 2018-11-14 08:53:01 -0700 | [diff] [blame] | 10 | #ifdef EC_ENABLE_MULTIPLE_DPTF_PROFILES |
Matt DeVillier | 19e7060 | 2018-07-08 19:22:05 -0500 | [diff] [blame] | 11 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 12 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 13 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 14 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 15 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 16 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 17 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 18 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 19 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_STATUS) |\ |
| 20 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
| 21 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\ |
| 22 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\ |
Matt DeVillier | 19e7060 | 2018-07-08 19:22:05 -0500 | [diff] [blame] | 23 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU) |\ |
| 24 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP) |\ |
| 25 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE)) |
| 26 | #else |
Patrick Georgi | 406313d | 2015-07-20 22:01:32 +0200 | [diff] [blame] | 27 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 28 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 29 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 30 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 31 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 32 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 33 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 34 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 35 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_STATUS) |\ |
| 36 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
Patrick Georgi | 406313d | 2015-07-20 22:01:32 +0200 | [diff] [blame] | 37 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\ |
| 38 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\ |
Gwendal Grignou | 95b7a6c | 2016-05-03 23:53:23 -0700 | [diff] [blame] | 39 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU) |\ |
| 40 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP)) |
Matt DeVillier | 19e7060 | 2018-07-08 19:22:05 -0500 | [diff] [blame] | 41 | #endif |
Patrick Georgi | 406313d | 2015-07-20 22:01:32 +0200 | [diff] [blame] | 42 | |
| 43 | #define MAINBOARD_EC_SMI_EVENTS \ |
| 44 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 45 | |
| 46 | /* EC can wake from S5 with lid or power button */ |
| 47 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
| 48 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 49 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 50 | |
| 51 | /* EC can wake from S3 with lid or power button or key press */ |
| 52 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 53 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 54 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 55 | |
| 56 | /* Log EC wake events plus EC shutdown events */ |
| 57 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 58 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 59 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\ |
| 60 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC)) |
| 61 | |
Patrick Georgi | 406313d | 2015-07-20 22:01:32 +0200 | [diff] [blame] | 62 | #endif |