Angel Pons | 210a008 | 2020-04-02 23:48:24 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 2 | |
| 3 | #ifndef _EC_GOOGLE_CHROMEEC_SMM_H |
| 4 | #define _EC_GOOGLE_CHROMEEC_SMM_H |
| 5 | |
| 6 | #include <stdint.h> |
| 7 | |
| 8 | /* Process all events from the EC when EC triggered an SMI#. */ |
| 9 | void chromeec_smi_process_events(void); |
| 10 | |
Kyösti Mälkki | 027f86e | 2022-12-02 15:30:10 +0200 | [diff] [blame^] | 11 | void chromeec_set_usb_charge_mode(int slp_type); |
| 12 | |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 13 | /* |
| 14 | * Set wake masks according to sleep type, clear SCI and SMI masks, |
| 15 | * and clear any pending events. |
| 16 | */ |
Furquan Shaikh | 8788fd6 | 2017-11-20 20:28:18 -0800 | [diff] [blame] | 17 | void chromeec_smi_sleep(int slp_type, uint64_t s3_mask, uint64_t s5_mask); |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 18 | |
| 19 | /* |
Duncan Laurie | 7378a17 | 2017-06-29 23:52:17 -0700 | [diff] [blame] | 20 | * Set device event masks according to sleep type, |
| 21 | * and clear any pending device events. |
| 22 | */ |
Furquan Shaikh | 8788fd6 | 2017-11-20 20:28:18 -0800 | [diff] [blame] | 23 | void chromeec_smi_device_event_sleep(int slp_type, uint64_t s3_mask, |
| 24 | uint64_t s5_mask); |
Duncan Laurie | 7378a17 | 2017-06-29 23:52:17 -0700 | [diff] [blame] | 25 | |
| 26 | /* |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 27 | * Provided the APMC command do the following while clearing pending events. |
| 28 | * APM_CNT_ACPI_ENABLE: clear SMI mask. set SCI mask. |
| 29 | * APM_CNT_ACPI_DISABLE: clear SCI mask. set SMI mask. |
| 30 | */ |
Furquan Shaikh | 8788fd6 | 2017-11-20 20:28:18 -0800 | [diff] [blame] | 31 | void chromeec_smi_apmc(int apmc, uint64_t sci_mask, uint64_t smi_mask); |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 32 | |
| 33 | #endif /* _EC_GOOGLE_CHROMEEC_SMM_H */ |