Angel Pons | d28443e | 2020-04-05 13:22:44 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 2 | |
| 3 | #ifndef MAINBOARD_EC_H |
| 4 | #define MAINBOARD_EC_H |
| 5 | |
| 6 | #include <ec/ec.h> |
| 7 | #include <ec/google/chromeec/ec_commands.h> |
| 8 | |
| 9 | #define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */ |
| 10 | #define EC_SMI_GPI 34 /* GPIO34 is EC_SMI# */ |
| 11 | |
| 12 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 13 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 14 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 15 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 16 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 17 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 18 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 19 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
Caveh Jalali | 4e71517 | 2022-11-07 22:18:25 -0800 | [diff] [blame^] | 20 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD)) |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 21 | |
| 22 | #define MAINBOARD_EC_SMI_EVENTS \ |
| 23 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 24 | |
| 25 | /* EC can wake from S5 with lid or power button */ |
| 26 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
| 27 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 28 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 29 | |
| 30 | /* EC can wake from S3 with lid or power button or key press */ |
| 31 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 32 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 33 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 34 | |
| 35 | /* Log EC wake events plus EC shutdown events */ |
| 36 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 37 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 38 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)) |
| 39 | |
| 40 | #endif |