Angel Pons | 2712398 | 2020-04-05 13:22:30 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Furquan Shaikh | 06cd903 | 2016-12-14 12:10:21 -0800 | [diff] [blame] | 2 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Furquan Shaikh | 6985c90 | 2018-10-06 12:03:23 -0700 | [diff] [blame] | 4 | #include <baseboard/variants.h> |
Furquan Shaikh | 06cd903 | 2016-12-14 12:10:21 -0800 | [diff] [blame] | 5 | #include <ec/google/chromeec/ec.h> |
| 6 | |
Furquan Shaikh | 76c392d | 2017-04-13 14:15:56 -0700 | [diff] [blame] | 7 | #include <variant/ec.h> |
Furquan Shaikh | 06cd903 | 2016-12-14 12:10:21 -0800 | [diff] [blame] | 8 | |
Furquan Shaikh | 6985c90 | 2018-10-06 12:03:23 -0700 | [diff] [blame] | 9 | __weak const struct google_chromeec_event_info *variant_get_event_info(void) |
Furquan Shaikh | 06cd903 | 2016-12-14 12:10:21 -0800 | [diff] [blame] | 10 | { |
Furquan Shaikh | 6985c90 | 2018-10-06 12:03:23 -0700 | [diff] [blame] | 11 | static const struct google_chromeec_event_info info = { |
Furquan Shaikh | 2749c52 | 2017-10-04 14:01:41 -0700 | [diff] [blame] | 12 | .log_events = MAINBOARD_EC_LOG_EVENTS, |
| 13 | .sci_events = MAINBOARD_EC_SCI_EVENTS, |
Zhuohao Lee | 2ce56f1 | 2018-10-19 16:50:02 +0800 | [diff] [blame] | 14 | .smi_events = MAINBOARD_EC_SMI_EVENTS, |
Furquan Shaikh | 2749c52 | 2017-10-04 14:01:41 -0700 | [diff] [blame] | 15 | .s3_wake_events = MAINBOARD_EC_S3_WAKE_EVENTS, |
| 16 | .s5_wake_events = MAINBOARD_EC_S5_WAKE_EVENTS, |
Jenny TC | 7e687b8 | 2017-10-27 17:39:22 +0530 | [diff] [blame] | 17 | .s0ix_wake_events = MAINBOARD_EC_S0IX_WAKE_EVENTS, |
Furquan Shaikh | 2749c52 | 2017-10-04 14:01:41 -0700 | [diff] [blame] | 18 | }; |
Furquan Shaikh | 06cd903 | 2016-12-14 12:10:21 -0800 | [diff] [blame] | 19 | |
Furquan Shaikh | 6985c90 | 2018-10-06 12:03:23 -0700 | [diff] [blame] | 20 | return &info; |
| 21 | } |
Furquan Shaikh | 06cd903 | 2016-12-14 12:10:21 -0800 | [diff] [blame] | 22 | |
Furquan Shaikh | 6985c90 | 2018-10-06 12:03:23 -0700 | [diff] [blame] | 23 | void mainboard_ec_init(void) |
| 24 | { |
| 25 | google_chromeec_events_init(variant_get_event_info(), |
| 26 | acpi_is_wakeup_s3()); |
Furquan Shaikh | 06cd903 | 2016-12-14 12:10:21 -0800 | [diff] [blame] | 27 | } |