diff options
author | Rob Barnes <robbarnes@google.com> | 2021-06-14 10:22:21 -0600 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2021-06-30 04:57:16 +0000 |
commit | f1ade489c85c95c572ef907bdb3b7f4835c1a9c7 (patch) | |
tree | ea5c369beecca0d625b0f440af932dbc03a1dad5 /src/ec/google | |
parent | 8bc5fa9f0a36514c2a7ebc5a375b18cb467a57e7 (diff) |
ec/google: Use EC_HOST_EVENT_NONE
google_chromeec_get_event returns 0 for no event. Return
EC_HOST_EVENT_NONE=0 to improve readability.
BUG=b:184074997
TEST=Build and boot guybrush without error
Signed-off-by: Rob Barnes <robbarnes@google.com>
Change-Id: Ic08ed9ccdd7c0023d0fe8b641fcf60dca495a242
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55547
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/ec/google')
-rw-r--r-- | src/ec/google/chromeec/ec.h | 2 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec_i2c.c | 4 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec_lpc.c | 8 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec_spi.c | 4 | ||||
-rw-r--r-- | src/ec/google/chromeec/smihandler.c | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 35ce3cce6e..ed9f4e43ba 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -19,7 +19,7 @@ uint64_t google_chromeec_get_wake_mask(void); int google_chromeec_set_sci_mask(uint64_t mask); int google_chromeec_set_smi_mask(uint64_t mask); int google_chromeec_set_wake_mask(uint64_t mask); -uint8_t google_chromeec_get_event(void); +enum host_event_code google_chromeec_get_event(void); /* Check if EC supports feature EC_FEATURE_UNIFIED_WAKE_MASKS */ bool google_chromeec_is_uhepi_supported(void); diff --git a/src/ec/google/chromeec/ec_i2c.c b/src/ec/google/chromeec/ec_i2c.c index 68e3cf2db8..7342fc2ab3 100644 --- a/src/ec/google/chromeec/ec_i2c.c +++ b/src/ec/google/chromeec/ec_i2c.c @@ -239,8 +239,8 @@ int google_chromeec_command(struct chromeec_command *cec_command) #endif /* CONFIG_EC_GOOGLE_CHROMEEC_I2C_PROTO3 */ -u8 google_chromeec_get_event(void) +enum host_event_code google_chromeec_get_event(void) { printk(BIOS_ERR, "%s: Not supported.\n", __func__); - return 0; + return EC_HOST_EVENT_NONE; } diff --git a/src/ec/google/chromeec/ec_lpc.c b/src/ec/google/chromeec/ec_lpc.c index 623aed50ff..a82ea5d9ab 100644 --- a/src/ec/google/chromeec/ec_lpc.c +++ b/src/ec/google/chromeec/ec_lpc.c @@ -461,11 +461,11 @@ static int google_chromeec_data_ready(u16 port) EC_LPC_CMDR_DATA); } -u8 google_chromeec_get_event(void) +enum host_event_code google_chromeec_get_event(void) { if (google_chromeec_wait_ready(EC_LPC_ADDR_ACPI_CMD)) { printk(BIOS_ERR, "Timeout waiting for EC ready!\n"); - return 0; + return EC_HOST_EVENT_NONE; } /* Issue the ACPI query-event command */ @@ -473,12 +473,12 @@ u8 google_chromeec_get_event(void) if (google_chromeec_wait_ready(EC_LPC_ADDR_ACPI_CMD)) { printk(BIOS_ERR, "Timeout waiting for EC QUERY_EVENT!\n"); - return 0; + return EC_HOST_EVENT_NONE; } if (google_chromeec_data_ready(EC_LPC_ADDR_ACPI_CMD)) { printk(BIOS_ERR, "Timeout waiting for data ready!\n"); - return 0; + return EC_HOST_EVENT_NONE; } /* Event (or 0 if none) is returned directly in the data byte */ diff --git a/src/ec/google/chromeec/ec_spi.c b/src/ec/google/chromeec/ec_spi.c index ecf1b420fe..0124191d35 100644 --- a/src/ec/google/chromeec/ec_spi.c +++ b/src/ec/google/chromeec/ec_spi.c @@ -100,8 +100,8 @@ int google_chromeec_command(struct chromeec_command *cec_command) return crosec_command_proto(cec_command, crosec_spi_io, &slave); } -u8 google_chromeec_get_event(void) +enum host_event_code google_chromeec_get_event(void) { printk(BIOS_ERR, "%s: Not supported.\n", __func__); - return 0; + return EC_HOST_EVENT_NONE; } diff --git a/src/ec/google/chromeec/smihandler.c b/src/ec/google/chromeec/smihandler.c index fca67ca810..cd0cd4f41e 100644 --- a/src/ec/google/chromeec/smihandler.c +++ b/src/ec/google/chromeec/smihandler.c @@ -37,7 +37,7 @@ static void clear_pending_events(void) { struct ec_response_get_next_event mkbp_event; - while (google_chromeec_get_event() != 0) + while (google_chromeec_get_event() != EC_HOST_EVENT_NONE) ; printk(BIOS_DEBUG, "Clearing pending EC events. Error code EC_RES_UNAVAILABLE(9) is expected.\n"); |