Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2175941pxb; Tue, 12 Oct 2021 00:33:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCKOUYg0m5kHJ8A3WiXM7R6lcAP/zON0eS0ehlGIhurWpPWOaJZLDdLEVzwJKEN9IJ/ct1 X-Received: by 2002:a17:906:f8d0:: with SMTP id lh16mr29981709ejb.367.1634024009270; Tue, 12 Oct 2021 00:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634024009; cv=none; d=google.com; s=arc-20160816; b=0g1xup02Ewl7hlhx9jervfIdA3qT5OvEk9qgopa2e5zkkNJsztFefTBkYSSvW96qjC SdSPprJw5cKOAS34kN6XMgOQe5O3LP7uBVWk2kTCTpi4BDWlQ41OQM+QKCtQZHIsYMaZ APykqtT6R3RJgpl1MLRaFHHNR7Qdz0wouLJ+ZMANo9ALQ2QPCzq3iDjNQJOFFK1iYqsi mHg9retFtgY85akXrKXUGaz2Oln1+L6kcetigJE5xL/RiB9J3SUxYN94cSNFT6JkZIqN YyzwKte/chsEwbWyVjg1/yH4valKw0VgBpwjt9tbZHZ8Q6UUtzzptjsQbdnNE8vZthKr hX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=JnveVyUJxymNAFHeYFircy9L/buzTM+7agfcS4bgS2o=; b=LyJS1zkQHDoNOUzSbzihZBg962e2iZpHVHs8sk8tYwvM9Qc3AdRstUrJLIDCa15KPz +eLGnYA05FZRBofWkqHG8j2+rmQyV0R24rHCeHWzvwej6/bX7qVnzlrMJ9ckFfk871Yz r21ia2CUpACFy93NsX3x2hjZuOC3ctNgKqTbP+VLTeSNQrRbylG9OnO/QGt7Ug92w2N1 +2YCCpcCDxKSltGuCNHGNvnXJYREeG0403puNDQRsGcN72EPLBc7x7cdGto001l9YHNG xXc1FkUUsPUzROOGX3GzPR1cGIN1hDw77EOOhULi9Ufvr32DRemluKWXZ0v8kEtEoSp/ 23LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TU62GjX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rs6si14067380ejb.640.2021.10.12.00.33.04; Tue, 12 Oct 2021 00:33:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TU62GjX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233966AbhJLHc4 (ORCPT + 99 others); Tue, 12 Oct 2021 03:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232500AbhJLHcz (ORCPT ); Tue, 12 Oct 2021 03:32:55 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20568C061570; Tue, 12 Oct 2021 00:30:54 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id i12so51204201wrb.7; Tue, 12 Oct 2021 00:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=JnveVyUJxymNAFHeYFircy9L/buzTM+7agfcS4bgS2o=; b=TU62GjX2/BZDoFark1y4nnk0jlgAgrIF/JtLmiZnhk/Z4Y6xlod4+x/C0K66hsDJRJ MmGkW96ZAesQxpXtVHQpXaHhwadUf5VYF26bFRl/y0XzfweSwN/CQDuc+yKj3kCgcVyy M+z9wSHZEQDTIJ5CKMOGUe5ZXp8BRZmXmIetYOLZuuf7/woTXd70h9qc9+kE/gB9orSk scpIKU823W33z5tLxDCZEXVMLVY5tdwnFRNSTNvYtWX04016eJ2cTU9lfqO2lvlBj5OT J8EYsqdvvZyuSzAC2vSxRUYH3lVbI4CSLNEOSzeuSA1Eg5d5baLZO+5GIulBe8LgQdt4 Jxrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=JnveVyUJxymNAFHeYFircy9L/buzTM+7agfcS4bgS2o=; b=Mj22CQIKr0rG7R04kz3RbkPdI3vvNcM0xnx9hHxRcGnMZpbzeZzcFxmZTMq4vcXhwB zahLSISreifc4ONq7o1XSARU68h/Xd/gGBFAfZGZhb3J2WUXb7EvMW5bZdExUCQM1RfO 3fZnRX7PEgMN7z2dzlWHQGrtEjfIT81oG1DkRnxnq9qGZMtuGcZzkuPA9EadefH+yj0Y INyFhVwsmTy7azd1EPEBhugklUUPW2BHlpzrTaxpg/bMmyVj3vHsLbkWmcS/UuxFoWGP EjsnJuH6c85D/lTXLAyaN+bvkhEv9Ly/F8O4NOnhFCh78EgQNHyfRlRl6i+/3URKnwyz jJjg== X-Gm-Message-State: AOAM530/TPaEDWq6r4lKnP66YLgCNAaUG6XQOrVcn83KYxaGKEqPtEIG mvitWM9SKyCJq2f5gxR5XqM= X-Received: by 2002:a05:600c:3595:: with SMTP id p21mr3803779wmq.71.1634023852780; Tue, 12 Oct 2021 00:30:52 -0700 (PDT) Received: from [192.168.1.21] ([195.245.16.219]) by smtp.gmail.com with ESMTPSA id j14sm4237565wrw.12.2021.10.12.00.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 00:30:52 -0700 (PDT) Message-ID: Subject: Re: [PATCH 3/4] Input: ep93xx_keypad - use dev_pm_set_wake_irq() From: Alexander Sverdlin To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Date: Tue, 12 Oct 2021 09:30:46 +0200 In-Reply-To: <20211012013735.3523140-3-dmitry.torokhov@gmail.com> References: <20211012013735.3523140-1-dmitry.torokhov@gmail.com> <20211012013735.3523140-3-dmitry.torokhov@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Mon, 2021-10-11 at 18:37 -0700, Dmitry Torokhov wrote: > Instead of manually toggling interrupt as wakeup source in suspend/resume > methods, let's declare keypad interrupt and wakeup interrupt and leave the > rest to the PM core. > > Signed-off-by: Dmitry Torokhov Acked-by: Alexander Sverdlin > --- >  drivers/input/keyboard/ep93xx_keypad.c | 13 +++++++------ >  1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c > index 6be5474ba2f2..a66cfeaf5b21 100644 > --- a/drivers/input/keyboard/ep93xx_keypad.c > +++ b/drivers/input/keyboard/ep93xx_keypad.c > @@ -27,6 +27,7 @@ >  #include >  #include >  #include > +#include >   >  /* >   * Keypad Interface Register offsets > @@ -191,9 +192,6 @@ static int __maybe_unused ep93xx_keypad_suspend(struct device *dev) >   >         mutex_unlock(&input_dev->mutex); >   > -       if (device_may_wakeup(&pdev->dev)) > -               enable_irq_wake(keypad->irq); > - >         return 0; >  } >   > @@ -203,9 +201,6 @@ static int __maybe_unused ep93xx_keypad_resume(struct device *dev) >         struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); >         struct input_dev *input_dev = keypad->input_dev; >   > -       if (device_may_wakeup(&pdev->dev)) > -               disable_irq_wake(keypad->irq); > - >         mutex_lock(&input_dev->mutex); >   >         if (input_device_enabled(input_dev)) { > @@ -316,7 +311,11 @@ static int ep93xx_keypad_probe(struct platform_device *pdev) >                 goto failed_free_irq; >   >         platform_set_drvdata(pdev, keypad); > + >         device_init_wakeup(&pdev->dev, 1); > +       err = dev_pm_set_wake_irq(&pdev->dev, keypad->irq); > +       if (err) > +               dev_warn(&pdev->dev, "failed to set up wakeup irq: %d\n", err); >   >         return 0; >   > @@ -342,6 +341,8 @@ static int ep93xx_keypad_remove(struct platform_device *pdev) >         struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); >         struct resource *res; >   > +       dev_pm_clear_wake_irq(&pdev->dev); > + >         free_irq(keypad->irq, keypad); >   >         if (keypad->enabled) -- Alexander Sverdlin.