1 /* SPDX-License-Identifier: GPL-2.0-only */
5 #include <cpu/x86/smm.h>
6 #include <superio/smsc/sch5545/sch5545.h>
8 int mainboard_smi_apmc(u8 data
)
12 case APM_CNT_ACPI_ENABLE
:
13 /* Enable wake on PS2 */
14 val
= inb(SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_EN1
);
15 val
|= (SCH5545_KBD_PME_EN
| SCH5545_MOUSE_PME_EN
);
16 outb(val
, SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_EN1
);
17 /* Clear pending and enable PMEs */
18 outb(SCH5545_GLOBAL_PME_STS
, SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_STS
);
19 outb(SCH5545_GLOBAL_PME_EN
, SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_EN
);
21 case APM_CNT_ACPI_DISABLE
:
22 /* Disable wake on PS2 */
23 val
= inb(SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_EN1
);
24 val
&= ~(SCH5545_KBD_PME_EN
| SCH5545_MOUSE_PME_EN
);
25 outb(val
, SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_EN1
);
26 /* Clear pending and disable PMEs */
27 outb(SCH5545_GLOBAL_PME_STS
, SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_STS
);
28 outb(0, SCH5545_RUNTIME_REG_BASE
+ SCH5545_RR_PME_EN
);