Angel Pons | 47f26db | 2020-04-05 13:22:34 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [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> |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [diff] [blame] | 7 | #include <ec/google/chromeec/ec_commands.h> |
| 8 | |
Aaron Durbin | 84da959 | 2013-11-07 11:19:34 -0600 | [diff] [blame] | 9 | /* GPIO_S0_000 is EC_SCI#, but it is bit 24 in GPE_STS */ |
| 10 | #define EC_SCI_GPI 24 |
| 11 | /* GPIO_S5_07 is EC_SMI#, but it is bit 23 in GPE_STS and ALT_GPIO_SMI. */ |
| 12 | #define EC_SMI_GPI 23 |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [diff] [blame] | 13 | |
| 14 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 15 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 16 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 17 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 18 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 19 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 20 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 21 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 22 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [diff] [blame] | 23 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\ |
| 24 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\ |
Gwendal Grignou | 95b7a6c | 2016-05-03 23:53:23 -0700 | [diff] [blame] | 25 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP)) |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [diff] [blame] | 26 | |
| 27 | #define MAINBOARD_EC_SMI_EVENTS \ |
| 28 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 29 | |
| 30 | /* EC can wake from S5 with lid or power button */ |
| 31 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
| 32 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 33 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 34 | |
| 35 | /* EC can wake from S3 with lid or power button or key press */ |
| 36 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 37 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 38 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 39 | |
| 40 | /* Log EC wake events plus EC shutdown events */ |
| 41 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 42 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 43 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)) |
| 44 | |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [diff] [blame] | 45 | #endif |