From 30b0c7adf0a5d77a8e902dbbf0ee68954bf28385 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 13 Jul 2016 13:01:13 -0500 Subject: mainboards: align on using ACPI_Sx definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mainboard_smi_sleep() function takes ACPI sleep values of the form S3=3, S4=4, S5=5, etc. All the chipsets ensure that whatever hardware PM1 control register values are used the interface to the mainboard is the same. Move all the SMI handlers in the mainboard directory to not open code the literal values 3 and 5 for ACPI_S3 and ACPI_S5. There were a few notable exceptions where the code was attempting to use the hardware values and not the common translated values. The few users of SLEEP_STATE_X were updated to align with ACPI_SX as those defines are already equal. The removal of SLEEP_STATE_X defines is forthcoming in a subsequent patch. BUG=chrome-os-partner:54977 Change-Id: I76592c9107778cce5995e5af764760453f54dc50 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/15664 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Furquan Shaikh --- src/mainboard/google/chell/romstage.c | 3 ++- src/mainboard/google/chell/smihandler.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mainboard/google/chell') diff --git a/src/mainboard/google/chell/romstage.c b/src/mainboard/google/chell/romstage.c index 65c095dd65..5360da683c 100644 --- a/src/mainboard/google/chell/romstage.c +++ b/src/mainboard/google/chell/romstage.c @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -25,7 +26,7 @@ void mainboard_romstage_entry(struct romstage_params *params) { /* Turn on keyboard backlight to indicate we are booting */ - if (params->power_state->prev_sleep_state != SLEEP_STATE_S3) + if (params->power_state->prev_sleep_state != ACPI_S3) google_chromeec_kbbacklight(25); /* Fill out PEI DATA */ diff --git a/src/mainboard/google/chell/smihandler.c b/src/mainboard/google/chell/smihandler.c index cd0cc19a35..ff98b367d5 100644 --- a/src/mainboard/google/chell/smihandler.c +++ b/src/mainboard/google/chell/smihandler.c @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -84,11 +85,11 @@ void mainboard_smi_gpi_handler(const struct gpi_status *sts) static void google_ec_smi_sleep(u8 slp_typ) { switch (slp_typ) { - case 3: + case ACPI_S3: /* Enable wake events */ google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS); break; - case 5: + case ACPI_S5: /* Enable wake events */ google_chromeec_set_wake_mask(MAINBOARD_EC_S5_WAKE_EVENTS); break; -- cgit v1.2.3