From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH] gpio: acpi: Call enable_irq_wake for _IAE GpioInts with Wake set Date: Tue, 21 Mar 2017 14:21:52 +0200 Message-ID: <1490098912.19767.122.camel@linux.intel.com> References: <20170318233524.5047-1-hdegoede@redhat.com> <1489937116.19767.92.camel@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Return-path: Received: from mga06.intel.com ([134.134.136.31]:18233 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932276AbdCUMX1 (ORCPT ); Tue, 21 Mar 2017 08:23:27 -0400 In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Hans de Goede , Mika Westerberg , Linus Walleij , Alexandre Courbot Cc: linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org On Mon, 2017-03-20 at 18:20 +0100, Hans de Goede wrote: > Hi, > > On 19-03-17 16:25, Andy Shevchenko wrote: > > On Sun, 2017-03-19 at 00:35 +0100, Hans de Goede wrote: > > > On baytrail / cherrytrail systems with a LID switch the LID switch > > > is > > > often connect to a gpioint handled by an _IAE event handler. > > > Before this commit such systems would not wake up when opening the > > > lid, > > > requiring the powerbutton to be pressed after opening the lid to > > > wakeup. > > > > > > This commit calls enable_irq_wake() for _IAE GpioInts with a valid > > > event handler which have their Wake flag set. This fixes such > > > systems > > > not waking up when opening the lid. > > > > I perhaps give up on my nits against Capital Letters :-), though for > > consistency, please, use Baytrail, Cherry Trail. > > Will fix for v2. > > > > > > + if (event->irq_wake_enabled) > > > > You may use irqd_is_wakeup_set() instead. IRQ framework keeps this > > state > > already. > > That requires having irq_data which is only (normally) available to > irq_chip drivers, so that is not going to work here. Which you can get easily from IRQ line number.  data = irq_get_irq_data(irq);   if (irqd_is_wakeup_set(data)) Would this work? -- Andy Shevchenko Intel Finland Oy