mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
Don't queue non-wake events, and ensure wake events (and all subsequent events) always get queued. BUG=chrome-os-partner:59248, chrome-os-partner:59336 BRANCH=gru TEST=Manual on kevin, go to suspend, press volume keys dozens of times, press 'shift', verify device wakes. Place cursor on URL bar, go to suspend, type "google" quickly, verify device wakes and "google" appears on URL bar. Go to suspend, press 'VolUp' key 5 times, press keyboard, verify device wakes and no volume meter is seen on display. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ibe761187fbcefd686776a512786550970a6fc067 Reviewed-on: https://chromium-review.googlesource.com/405717 Commit-Queue: Douglas Anderson <dianders@chromium.org> Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> (cherry picked from commit aa2f01566314604404e104d7975c6c755c22a601) Reviewed-on: https://chromium-review.googlesource.com/407958 Commit-Ready: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
/* Copyright 2014 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
* Event handling in MKBP keyboard protocol
|
|
*/
|
|
|
|
#ifndef __CROS_EC_MKBP_EVENT_H
|
|
#define __CROS_EC_MKBP_EVENT_H
|
|
|
|
/*
|
|
* Sends an event to the AP.
|
|
*
|
|
* When this is called, the event data must be ready for query. Otherwise,
|
|
* when the AP queries the event, an error is returned and the event is lost.
|
|
*
|
|
* @param event_type One of EC_MKBP_EVENT_*.
|
|
* @return True if event succeeded to generate host interrupt.
|
|
*/
|
|
int mkbp_send_event(uint8_t event_type);
|
|
|
|
/*
|
|
* The struct to store the event source definition. The get_data routine is
|
|
* responsible for returning the event data when queried by the AP. The
|
|
* parameter 'data' points to where the event data needs to be stored, and
|
|
* the size of the event data should be returned.
|
|
*/
|
|
struct mkbp_event_source {
|
|
uint8_t event_type;
|
|
int (*get_data)(uint8_t *data);
|
|
};
|
|
|
|
#define DECLARE_EVENT_SOURCE(type, func) \
|
|
const struct mkbp_event_source __keep __evt_src_##type \
|
|
__attribute__((section(".rodata.evtsrcs"))) \
|
|
= {type, func}
|
|
|
|
#endif /* __CROS_EC_MKBP_EVENT_H */
|