Thread (31 messages) 31 messages, 7 authors, 2022-09-10

Re: [PATCH 1/8] Input: elan_i2c - Use PM subsystem to manage wake irq

flat view

From: Tony Lindgren <tony@atomide.com>
Date: 2022-09-01 06:58:09
Also in: linux-acpi, lkml

* Rafael J. Wysocki [off-list ref] [220831 18:35]:
On Wed, Aug 31, 2022 at 8:14 PM Raul Rangel [off-list ref] wrote:
quoted
On Wed, Aug 31, 2022 at 12:01 PM Rafael J. Wysocki [off-list ref] wrote:
quoted
On Wed, Aug 31, 2022 at 1:16 AM Raul E Rangel [off-list ref] wrote:
quoted
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 <redacted>
quoted
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 <redacted>

to the patch.
Looks good to me too:

Reviewed-by: Tony Lindgren <tony@atomide.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help