diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-10-09 22:02:22 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-17 23:14:19 -0700 |
commit | b9e07ce1bfa42ea2a5e7564575b0072c13811c31 (patch) | |
tree | 16e69783b0b8e1825c88a2753912949dc9ef7ef8 /include/lpc.h | |
parent | 501fba17a93c5a08afd4bdaeb9c632712557c362 (diff) | |
download | chrome-ec-b9e07ce1bfa42ea2a5e7564575b0072c13811c31.tar.gz |
host_event: Move host events and mask handling into common code
Instead of duplicating the handling of host events and host event
masks in chip lpc drivers, add routines in common code to provide
basic functions like setting/getting of masks, setting/getting of
events and handling of masks transitions across sysjump.
BUG=None
BRANCH=None
TEST=make -j buildall. Verified following:
1. Event masks are correctly retained across sysjumps.
2. Wake from S3 works fine.
3. Wake from S0ix works fine.
4. SCI generated correctly.
Change-Id: Ie409f91b12788e4b902b2627e31ba5ce40ff1d27
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/707771
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/lpc.h')
-rw-r--r-- | include/lpc.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/include/lpc.h b/include/lpc.h index 03699dab35..ff9642b6f5 100644 --- a/include/lpc.h +++ b/include/lpc.h @@ -71,17 +71,20 @@ enum lpc_host_event_type { LPC_HOST_EVENT_SMI = 0, LPC_HOST_EVENT_SCI, LPC_HOST_EVENT_WAKE, + LPC_HOST_EVENT_COUNT, }; /** - * Set the event state. + * Get current state of host events. */ -void lpc_set_host_event_state(uint32_t mask); +uint32_t lpc_get_host_events(void); /** - * Clear and return the lowest host event. + * Get host events that are set based on the type provided. + * + * @param type Event type */ -int lpc_query_host_event_state(void); +uint32_t lpc_get_host_events_by_type(enum lpc_host_event_type type); /** * Set the event mask for the specified event type. @@ -92,11 +95,18 @@ int lpc_query_host_event_state(void); void lpc_set_host_event_mask(enum lpc_host_event_type type, uint32_t mask); /** - * Return the event mask for the specified event type. + * Get host event mask based on the type provided. + * + * @param type Event type */ uint32_t lpc_get_host_event_mask(enum lpc_host_event_type type); /** + * Clear and return the lowest host event. + */ +int lpc_get_next_host_event(void); + +/** * Set the EC_LPC_STATUS_* mask for the specified status. */ void lpc_set_acpi_status_mask(uint8_t mask); @@ -124,4 +134,11 @@ void lpc_disable_acpi_interrupts(void); /* Enable LPC ACPI interrupts */ void lpc_enable_acpi_interrupts(void); +/** + * Update host event status. This function is called whenever host event bits + * need to be updated based on initialization complete or host event mask + * update or when a new host event is set or cleared. + */ +void lpc_update_host_event_status(void); + #endif /* __CROS_EC_LPC_H */ |