lkml.org 
[lkml]   [2017]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power button
From
Date
On Thu, 2017-08-31 at 11:33 -0700, Dmitry Torokhov wrote:

> > +
> > + ret = enable_irq_wake(irq);
> > + if (ret)
> > + dev_warn(dev, "Can't enable IRQ as wake source:
> > %d\n", ret);
>
> We do not normally enable wake IRQs in probe, but instead do:
>
> device_init_wakeup(&pdev->dev, true);
>
> in probe() and then check it in suspend/resume:
>
> if (device_may_wakeup(dev)) {
> err = enable_irq_wake(XXX->irq);
> if (!err)
> XXX->irq_wake_enabled = true;
> }
>
> ...
>
> if (XXX->irq_wake_enabled)

No need to duplicate a flag which IRQ core already has.

See, for example, commit
aef3ad103a68 ("serial: core: remove unneeded irq_wake flag")

> disable_irq_wake(XXX->irq);
>
> This allows userspace to inhibit wakeup, if needed.


--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

\
 
 \ /
  Last update: 2017-09-01 13:10    [W:0.075 / U:0.720 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site