lkml.org 
[lkml]   [2023]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH v2 1/2] Input: st1232 - remove enable/disable irq if device may wake up
Disabling the interrupts unconditionally in the suspend callback leads
to a loss of the wakeup capability in suspend to idle (freeze) mode.

In commit 95dc58a9a02f ("Input: st1232 - rely on I2C core to configure
wakeup interrupt") redundancy was removed by letting the I2C core manage
the wake interrupt handling. On the other hand, the irq enabling/disabling
became unconditional.

Revert the general interrupt enabling/disabling to its previous state.

Fixes: 95dc58a9a02f ("Input: st1232 - rely on I2C core to configure wakeup interrupt")
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
---
drivers/input/touchscreen/st1232.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 6475084aee1b..d0ee90abc293 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -345,10 +345,10 @@ static int st1232_ts_suspend(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct st1232_ts_data *ts = i2c_get_clientdata(client);

- disable_irq(client->irq);
-
- if (!device_may_wakeup(&client->dev))
+ if (!device_may_wakeup(&client->dev)) {
+ disable_irq(client->irq);
st1232_ts_power(ts, false);
+ }

return 0;
}
@@ -358,10 +358,10 @@ static int st1232_ts_resume(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct st1232_ts_data *ts = i2c_get_clientdata(client);

- if (!device_may_wakeup(&client->dev))
+ if (!device_may_wakeup(&client->dev)) {
+ enable_irq(client->irq);
st1232_ts_power(ts, true);
-
- enable_irq(client->irq);
+ }

return 0;
}
--
2.39.2

\
 
 \ /
  Last update: 2023-09-15 15:48    [W:0.037 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site