Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751937AbdIALJm (ORCPT ); Fri, 1 Sep 2017 07:09:42 -0400 Received: from mga09.intel.com ([134.134.136.24]:1485 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbdIALJk (ORCPT ); Fri, 1 Sep 2017 07:09:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,457,1498546800"; d="scan'208";a="130680844" Message-ID: <1504264176.25945.190.camel@linux.intel.com> Subject: Re: [PATCH 2/3] input/keyboard: Add support for Dollar Cove TI power button From: Andy Shevchenko To: Dmitry Torokhov , Takashi Iwai Cc: linux-kernel@vger.kernel.org, Lee Jones , "Rafael J . Wysocki" , Mika Westerberg , Johannes Stezenbach , linux-input@vger.kernel.org, linux-acpi@vger.kernel.org Date: Fri, 01 Sep 2017 14:09:36 +0300 In-Reply-To: <20170831183355.GB14370@dtor-ws> References: <20170822055710.26515-1-tiwai@suse.de> <20170822055710.26515-3-tiwai@suse.de> <20170831183355.GB14370@dtor-ws> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 829 Lines: 37 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 Intel Finland Oy