Subrata Banik | 9b4f221 | 2020-10-10 15:53:33 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef __BASEBOARD_EC_H__ |
| 4 | #define __BASEBOARD_EC_H__ |
| 5 | |
| 6 | #include <ec/ec.h> |
| 7 | #include <ec/google/chromeec/ec_commands.h> |
| 8 | #include <baseboard/gpio.h> |
| 9 | |
| 10 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 11 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 12 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 13 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 14 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 15 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 16 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 17 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 18 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_STATUS) |\ |
| 19 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
| 20 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\ |
| 21 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\ |
| 22 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU) |\ |
| 23 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE) |\ |
| 24 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP) |\ |
| 25 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_MUX)) |
| 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 | /* |
| 36 | * EC can wake from S3 with lid or power button or key press or |
| 37 | * mode change event. |
| 38 | */ |
| 39 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 40 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 41 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED) |\ |
| 42 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE)) |
| 43 | |
| 44 | #define MAINBOARD_EC_S0IX_WAKE_EVENTS (MAINBOARD_EC_S3_WAKE_EVENTS) |
| 45 | |
| 46 | /* Log EC wake events plus EC shutdown events */ |
| 47 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 48 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 49 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN) |\ |
| 50 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC)) |
| 51 | |
| 52 | /* |
| 53 | * ACPI related definitions for ASL code. |
| 54 | */ |
| 55 | |
| 56 | /* Enable EC backed ALS device in ACPI */ |
| 57 | #define EC_ENABLE_ALS_DEVICE |
| 58 | |
Subrata Banik | 9b4f221 | 2020-10-10 15:53:33 +0530 | [diff] [blame] | 59 | /* Enable EC backed PD MCU device in ACPI */ |
| 60 | #define EC_ENABLE_PD_MCU_DEVICE |
| 61 | |
| 62 | /* Enable LID switch and provide wake pin for EC */ |
| 63 | #define EC_ENABLE_LID_SWITCH |
| 64 | #define EC_ENABLE_WAKE_PIN GPE_EC_WAKE |
| 65 | |
| 66 | #define SIO_EC_MEMMAP_ENABLE /* EC Memory Map Resources */ |
| 67 | #define SIO_EC_HOST_ENABLE /* EC Host Interface Resources */ |
| 68 | #define SIO_EC_ENABLE_PS2K /* Enable PS/2 Keyboard */ |
| 69 | |
| 70 | #endif /* __BASEBOARD_EC_H__ */ |