soc/intel: Remove blank lines before '}' and after '{'
[coreboot2.git] / src / mainboard / samsung / lumpy / smihandler.c
blobe7861cb38f096ae1a50ec8343259fe19231a55eb
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <cpu/x86/smm.h>
5 #include <halt.h>
6 #include <southbridge/intel/bd82x6x/pch.h>
7 #include <southbridge/intel/bd82x6x/me.h>
8 #include <northbridge/intel/sandybridge/sandybridge.h>
9 #include <ec/smsc/mec1308/ec.h>
10 #include "ec.h"
12 static u8 mainboard_smi_ec(void)
14 u8 cmd;
16 cmd = read_ec_command_byte(EC_GET_SMI_CAUSE);
18 switch (cmd) {
19 case EC_LID_CLOSE:
20 printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n");
22 /* Go to S5 */
23 poweroff();
24 break;
27 return cmd;
30 void mainboard_smi_gpi(u32 gpi_sts)
32 if (gpi_sts & (1 << EC_SMI_GPI)) {
33 /* Process all pending EC requests */
34 ec_set_ports(EC_MAILBOX_PORT, EC_MAILBOX_PORT+1);
35 while (mainboard_smi_ec() != 0xff);
37 /* The EC may keep asserting SMI# for some
38 * period unless we kick it here.
40 send_ec_command(EC_SMI_DISABLE);
41 send_ec_command(EC_SMI_ENABLE);
45 int mainboard_smi_apmc(u8 apmc)
47 ec_set_ports(EC_MAILBOX_PORT, EC_MAILBOX_PORT+1);
49 switch (apmc) {
50 case APM_CNT_ACPI_ENABLE:
51 send_ec_command(EC_SMI_DISABLE);
52 send_ec_command(EC_ACPI_ENABLE);
53 break;
55 case APM_CNT_ACPI_DISABLE:
56 send_ec_command(EC_SMI_ENABLE);
57 send_ec_command(EC_ACPI_DISABLE);
58 break;
60 return 0;