• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <acpi/acpi.h>
4 #include <console/console.h>
5 #include <ec/google/chromeec/ec.h>
6 #include "ec.h"
7 
mainboard_ec_init(void)8 void mainboard_ec_init(void)
9 {
10 	const struct google_chromeec_event_info info = {
11 		.log_events = MAINBOARD_EC_LOG_EVENTS,
12 		.sci_events = MAINBOARD_EC_SCI_EVENTS,
13 		.s3_wake_events = MAINBOARD_EC_S3_WAKE_EVENTS,
14 		.s5_wake_events = MAINBOARD_EC_S5_WAKE_EVENTS,
15 	};
16 
17 	int s3_wakeup = acpi_is_wakeup_s3();
18 
19 	printk(BIOS_DEBUG, "%s\n", __func__);
20 	post_code(0xf0);
21 
22 	google_chromeec_events_init(&info, s3_wakeup);
23 	if (s3_wakeup) {
24 		/* Clear pending events. */
25 		while (google_chromeec_get_event() != EC_HOST_EVENT_NONE)
26 			;
27 	}
28 
29 	post_code(0xf1);
30 }
31