mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
cros_ec: Don't signal wake event for non-wake host events
The subset of wake-enabled host events is defined by the EC, but the EC may still send non-wake host events if we're in the process of suspending. Get the mask of wake-enabled host events from the EC and filter out non-wake events to prevent spurious aborted suspend attempts. Signed-off-by: Shawn Nematbakhsh <[email protected]> Signed-off-by: Thierry Escande <[email protected]> Acked-for-MFD-by: Lee Jones <[email protected]> Signed-off-by: Benson Leung <[email protected]>
This commit is contained in:
parent
d4da97e59e
commit
29d99b966d
4 changed files with 87 additions and 10 deletions
|
|
@ -54,12 +54,19 @@ static const struct mfd_cell ec_pd_cell = {
|
|||
static irqreturn_t ec_irq_thread(int irq, void *data)
|
||||
{
|
||||
struct cros_ec_device *ec_dev = data;
|
||||
bool wake_event = true;
|
||||
int ret;
|
||||
|
||||
if (device_may_wakeup(ec_dev->dev))
|
||||
ret = cros_ec_get_next_event(ec_dev, &wake_event);
|
||||
|
||||
/*
|
||||
* Signal only if wake host events or any interrupt if
|
||||
* cros_ec_get_next_event() returned an error (default value for
|
||||
* wake_event is true)
|
||||
*/
|
||||
if (wake_event && device_may_wakeup(ec_dev->dev))
|
||||
pm_wakeup_event(ec_dev->dev, 0);
|
||||
|
||||
ret = cros_ec_get_next_event(ec_dev);
|
||||
if (ret > 0)
|
||||
blocking_notifier_call_chain(&ec_dev->event_notifier,
|
||||
0, ec_dev);
|
||||
|
|
@ -221,7 +228,7 @@ EXPORT_SYMBOL(cros_ec_suspend);
|
|||
|
||||
static void cros_ec_drain_events(struct cros_ec_device *ec_dev)
|
||||
{
|
||||
while (cros_ec_get_next_event(ec_dev) > 0)
|
||||
while (cros_ec_get_next_event(ec_dev, NULL) > 0)
|
||||
blocking_notifier_call_chain(&ec_dev->event_notifier,
|
||||
1, ec_dev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue