Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1724973

Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power button

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power button
Date 2017-09-01 13:10 +0200
Message-ID <ukRZL-3id-13@gated-at.bofh.it> (permalink)
References <uhaoh-6rP-7@gated-at.bofh.it> <uhaoi-6rP-21@gated-at.bofh.it> <ukCxH-Mh-17@gated-at.bofh.it>
Organization Intel Finland Oy

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power  button Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-08-31 20:40 +0200
  Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power button Takashi Iwai <tiwai@suse.de> - 2017-08-31 22:40 +0200
  Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI  power button Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-09-01 13:10 +0200
    Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power button Takashi Iwai <tiwai@suse.de> - 2017-09-01 14:20 +0200

csiph-web