Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp358281rwe; Thu, 1 Sep 2022 00:04:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR51WH+vy6dntU0me7+tZ+f18WgNg1PKTmomfXouvFAbMt+gSLsk2BNc9f4ERwjX1jv1QVq1 X-Received: by 2002:a17:906:4fc3:b0:72e:eab4:d9d7 with SMTP id i3-20020a1709064fc300b0072eeab4d9d7mr22146318ejw.599.1662015895318; Thu, 01 Sep 2022 00:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662015895; cv=none; d=google.com; s=arc-20160816; b=BQNNJ/+jvl1QPmeofWuaSNG8POVIbCYGMxF1oxAA9/MK4YbgEMfjKjfhVRTc7AnD8l Tkt5pLExAPEYe5nQh+KdfiIRGJw1UGPKgXp0gOfyRyQTMohhqv50ezW8r9fIj1AGg3lC Z5TqlpWVhjzWNgfXkIvW4gz99tFAkTHbz5i0BLn6PTCZtpbLagHtN7MJAr3duKFjyzlV YtX4uuUKA8X8v73U9h77dBNF8uNAJ0ylD9uWddmO7gMtkff3qzvGGVC209kBtjlXTCAe LTP2nBQOdEyQ7mKW6RFcF2yWutHy/XW88KL3DiHn4CeDSiZ+yBKs7Wzgponjsv0luonJ vnxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=LXrK0ldgNGJvP5DM189RStm4aomiTbWWjo8FuP1ZDGE=; b=l1nzXJYyogwniolLLxFAr3Gu6IV6GDxKtcIMhuYIv/Ze4+aVhEWY1sonfqbLTmPpPm MXHP54xo39PjaeWZVdQLEJrYQB1uqPDceqAw4sZDzk72C/d07cB3Rsbb5pJYj5FZQHkB zpLHQ8jSNGzYQ5yI4Ia3u48cOObd0w7EyXq7eIgY1LYSobtgywSXTakfdQw93RpA4F67 /JSQMz0C+QxuHYvG5zncNWcRAs98GcxAHK4yWxHbd41ltjPQ0aQclfUVzPxO4cwgGW0M 9MhXV8qOLrrFFHN+PfQucgReyogDKxG7r+0NSfgzKEQj7AAfjVF/HnNSiZMDuHHdjU5l fe/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs30-20020a1709072d1e00b00730a5a456e9si15260063ejc.758.2022.09.01.00.04.27; Thu, 01 Sep 2022 00:04:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231443AbiIAG6E (ORCPT + 99 others); Thu, 1 Sep 2022 02:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233038AbiIAG56 (ORCPT ); Thu, 1 Sep 2022 02:57:58 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9BEB0A3D0F; Wed, 31 Aug 2022 23:57:57 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 828C580A8; Thu, 1 Sep 2022 06:50:31 +0000 (UTC) Date: Thu, 1 Sep 2022 09:57:55 +0300 From: Tony Lindgren To: "Rafael J. Wysocki" Cc: Raul Rangel , ACPI Devel Maling List , linux-input , Hans de Goede , Mario Limonciello , Tim Van Patten , Dmitry Torokhov , "jingle.wu" , Linux Kernel Mailing List Subject: Re: [PATCH 1/8] Input: elan_i2c - Use PM subsystem to manage wake irq Message-ID: References: <20220830231541.1135813-1-rrangel@chromium.org> <20220830171332.1.Id022caf53d01112188308520915798f08a33cd3e@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Rafael J. Wysocki [220831 18:35]: > On Wed, Aug 31, 2022 at 8:14 PM Raul Rangel wrote: > > > > On Wed, Aug 31, 2022 at 12:01 PM Rafael J. Wysocki wrote: > > > > > > On Wed, Aug 31, 2022 at 1:16 AM Raul E Rangel wrote: > > > > > > > > The Elan I2C touchpad driver is currently manually managing the wake > > > > IRQ. This change removes the explicit enable_irq_wake/disable_irq_wake > > > > and instead relies on the PM subsystem. This is done by calling > > > > dev_pm_set_wake_irq. > > > > > > > > i2c_device_probe already calls dev_pm_set_wake_irq when using device > > > > tree, so it's only required when using ACPI. The net result is that this > > > > change should be a no-op. i2c_device_remove also already calls > > > > dev_pm_clear_wake_irq, so we don't need to do that in this driver. > > > > > > > > I tested this on an ACPI system where the touchpad doesn't have _PRW > > > > defined. I verified I can still wake the system and that the wake source > > > > was the touchpad IRQ GPIO. > > > > > > > > Signed-off-by: Raul E Rangel > > > > > > > > > > I like this a lot, but the assumption in the wakeirq code is that the > > > IRQ in question will be dedicated for signaling wakeup. Does it hold > > > here? > > > > The wakeirq code defines two methods: `dev_pm_set_wake_irq` and > > `dev_pm_set_dedicated_wake_irq`. > > The latter is used when you have a dedicated wakeup signal. In this > > driver it's currently assumed > > that the IRQ and the wake IRQ are the same, so I used `dev_pm_set_wake_irq`. > > > > This change in theory also fixes a bug where you define a dedicated > > wake irq in DT, but > > then the driver enables the `client->irq` as a wake source. In > > practice this doesn't happen > > since the elan touchpads only have a single IRQ line. > > OK, thanks! > > Please feel free to add > > Acked-by: Rafael J. Wysocki > > to the patch. Looks good to me too: Reviewed-by: Tony Lindgren