summaryrefslogtreecommitdiff
path: root/src/ec/clevo/it5570e/smihandler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ec/clevo/it5570e/smihandler.c')
-rw-r--r--src/ec/clevo/it5570e/smihandler.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ec/clevo/it5570e/smihandler.c b/src/ec/clevo/it5570e/smihandler.c
new file mode 100644
index 0000000000..fedac06e34
--- /dev/null
+++ b/src/ec/clevo/it5570e/smihandler.c
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+#include <cpu/x86/smm.h>
+
+#include "commands.h"
+#include "smm.h"
+
+void ec_smi_apmc(uint8_t apmc)
+{
+ printk(BIOS_DEBUG, "EC SMI APMC handler\n");
+
+ switch (apmc) {
+ case APM_CNT_ACPI_ENABLE:
+ ec_set_acpi_mode(true);
+ break;
+ case APM_CNT_ACPI_DISABLE:
+ ec_set_acpi_mode(false);
+ break;
+ default:
+ break;
+ }
+}
+
+void ec_smi_sleep(uint8_t slp_type)
+{
+ printk(BIOS_DEBUG, "EC SMI sleep handler\n");
+
+ switch (slp_type) {
+ case ACPI_S4:
+ case ACPI_S5:
+ ec_set_enter_g3_in_s4s5(true);
+ __fallthrough;
+ default:
+ break;
+ }
+}