mainboard/intel/avenuecity_crb: Update full IIO configuration
[coreboot2.git] / src / mainboard / dell / snb_ivb_workstations / smihandler.c
blob3ed0d1148349939758f126c6b2302211c855cc69
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <stdint.h>
4 #include <arch/io.h>
5 #include <cpu/x86/smm.h>
6 #include <superio/smsc/sch5545/sch5545.h>
8 int mainboard_smi_apmc(u8 data)
10 u8 val;
11 switch (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);
20 break;
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);
29 break;
30 default:
31 break;
33 return 0;