Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbdIAMMR (ORCPT ); Fri, 1 Sep 2017 08:12:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:37764 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751540AbdIAMMP (ORCPT ); Fri, 1 Sep 2017 08:12:15 -0400 Date: Fri, 01 Sep 2017 14:12:13 +0200 Message-ID: From: Takashi Iwai To: Andy Shevchenko Cc: Dmitry Torokhov , linux-kernel@vger.kernel.org, Lee Jones , "Rafael J . Wysocki" , Mika Westerberg , Johannes Stezenbach , linux-input@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power button In-Reply-To: <1504264176.25945.190.camel@linux.intel.com> References: <20170822055710.26515-1-tiwai@suse.de> <20170822055710.26515-3-tiwai@suse.de> <20170831183355.GB14370@dtor-ws> <1504264176.25945.190.camel@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1010 Lines: 42 On Fri, 01 Sep 2017 13:09:36 +0200, Andy Shevchenko wrote: > > 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") I couldn't find the commit, but checked the web search. So everything is set up and done by dev_pm_set_wake_irq(), no need to create the own PM ops just for that, right? That stuff was already in v3 patch. thanks, Takashi