Duncan Laurie | 09170f1 | 2015-10-09 09:25:32 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2015 Google Inc. |
| 5 | * Copyright (C) 2015 Intel Corporation |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Duncan Laurie | 09170f1 | 2015-10-09 09:25:32 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #ifndef MAINBOARD_EC_H |
| 18 | #define MAINBOARD_EC_H |
| 19 | |
Aaron Durbin | 91fa9d7 | 2016-09-23 16:38:27 -0500 | [diff] [blame] | 20 | #include <ec/ec.h> |
Duncan Laurie | 09170f1 | 2015-10-09 09:25:32 -0700 | [diff] [blame] | 21 | #include <ec/google/chromeec/ec_commands.h> |
| 22 | |
| 23 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 24 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 25 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 26 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 27 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 28 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 29 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 30 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 31 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_STATUS) |\ |
| 32 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
| 33 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD) |\ |
| 34 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\ |
| 35 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\ |
| 36 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER) |\ |
Gwendal Grignou | 95b7a6c | 2016-05-03 23:53:23 -0700 | [diff] [blame] | 37 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU) |\ |
| 38 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP)) |
Duncan Laurie | 09170f1 | 2015-10-09 09:25:32 -0700 | [diff] [blame] | 39 | |
| 40 | #define MAINBOARD_EC_SMI_EVENTS \ |
| 41 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 42 | |
| 43 | /* EC can wake from S5 with lid or power button */ |
| 44 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
| 45 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 46 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 47 | |
| 48 | /* EC can wake from S3 with lid or power button or key press */ |
| 49 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 50 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 51 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 52 | |
| 53 | /* Log EC wake events plus EC shutdown events */ |
| 54 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 55 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 56 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\ |
| 57 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC)) |
| 58 | |
Duncan Laurie | 09170f1 | 2015-10-09 09:25:32 -0700 | [diff] [blame] | 59 | #endif |