diff mbox series

[4/4] Input: adp5588-keys - do not explicitly set device as wakeup source

Message ID 20220528045631.289821-4-dmitry.torokhov@gmail.com
State New
Headers show
Series None | expand

Commit Message

Dmitry Torokhov May 28, 2022, 4:56 a.m. UTC
I2C core will set up device as a wakeup source and will configure interrupt
as a wakeup interrupt if client is created with I2C_CLIENT_WAKE flag. Let's
rely on this facility and to not unconditionally set up the device as
wakeup device in the driver.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/keyboard/adp5588-keys.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Hennerich, Michael May 30, 2022, 10:11 a.m. UTC | #1
> -----Original Message-----
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Sent: Samstag, 28. Mai 2022 06:57
> To: Hennerich, Michael <Michael.Hennerich@analog.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 4/4] Input: adp5588-keys - do not explicitly set device as
> wakeup source
> 
> [External]
> 
> I2C core will set up device as a wakeup source and will configure interrupt as a
> wakeup interrupt if client is created with I2C_CLIENT_WAKE flag. Let's rely on
> this facility and to not unconditionally set up the device as wakeup device in the
> driver.
> 


Looks good! Thanks for the cleanup!

> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>


> ---
>  drivers/input/keyboard/adp5588-keys.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/input/keyboard/adp5588-keys.c
> b/drivers/input/keyboard/adp5588-keys.c
> index df84a2998ed2..2a274240facb 100644
> --- a/drivers/input/keyboard/adp5588-keys.c
> +++ b/drivers/input/keyboard/adp5588-keys.c
> @@ -589,8 +589,6 @@ static int adp5588_probe(struct i2c_client *client,
>  	if (error)
>  		return error;
> 
> -	device_init_wakeup(&client->dev, 1);
> -
>  	dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq);
>  	return 0;
>  }
> @@ -609,9 +607,6 @@ static int __maybe_unused adp5588_suspend(struct
> device *dev)
> 
>  	disable_irq(client->irq);
> 
> -	if (device_may_wakeup(&client->dev))
> -		enable_irq_wake(client->irq);
> -
>  	return 0;
>  }
> 
> @@ -619,9 +614,6 @@ static int __maybe_unused adp5588_resume(struct
> device *dev)  {
>  	struct i2c_client *client = to_i2c_client(dev);
> 
> -	if (device_may_wakeup(&client->dev))
> -		disable_irq_wake(client->irq);
> -
>  	enable_irq(client->irq);
> 
>  	return 0;
> --
> 2.36.1.124.g0e6072fb45-goog
diff mbox series

Patch

diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index df84a2998ed2..2a274240facb 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -589,8 +589,6 @@  static int adp5588_probe(struct i2c_client *client,
 	if (error)
 		return error;
 
-	device_init_wakeup(&client->dev, 1);
-
 	dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq);
 	return 0;
 }
@@ -609,9 +607,6 @@  static int __maybe_unused adp5588_suspend(struct device *dev)
 
 	disable_irq(client->irq);
 
-	if (device_may_wakeup(&client->dev))
-		enable_irq_wake(client->irq);
-
 	return 0;
 }
 
@@ -619,9 +614,6 @@  static int __maybe_unused adp5588_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
-	if (device_may_wakeup(&client->dev))
-		disable_irq_wake(client->irq);
-
 	enable_irq(client->irq);
 
 	return 0;