linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: adp5588-keys - do not try to disable interrupt 0
@ 2024-10-04 14:07 Dmitry Torokhov
  2024-10-07  6:27 ` Nuno Sá
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2024-10-04 14:07 UTC (permalink / raw)
  To: Michael Hennerich, Nuno Sa; +Cc: Utsav Agarwal, linux-input, linux-kernel

Commit dc748812fca0 ("Input: adp5588-keys - add support for pure gpio")
made having interrupt line optional for the device, however it neglected
to update suspend and resume handlers that try to disable interrupts
for the duration of suspend.

Fix this by checking if interrupt number assigned to the i2c device is
not 0 before trying to disable or reenable it.

Fixes: dc748812fca0 ("Input: adp5588-keys - add support for pure gpio")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/keyboard/adp5588-keys.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index d25d63a807f2..dc734974ce06 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -822,7 +822,8 @@ static int adp5588_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
-	disable_irq(client->irq);
+	if (client->irq)
+		disable_irq(client->irq);
 
 	return 0;
 }
@@ -831,7 +832,8 @@ static int adp5588_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
-	enable_irq(client->irq);
+	if (client->irq)
+		enable_irq(client->irq);
 
 	return 0;
 }
-- 
2.47.0.rc0.187.ge670bccf7e-goog


-- 
Dmitry

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: adp5588-keys - do not try to disable interrupt 0
  2024-10-04 14:07 [PATCH] Input: adp5588-keys - do not try to disable interrupt 0 Dmitry Torokhov
@ 2024-10-07  6:27 ` Nuno Sá
  0 siblings, 0 replies; 2+ messages in thread
From: Nuno Sá @ 2024-10-07  6:27 UTC (permalink / raw)
  To: Dmitry Torokhov, Michael Hennerich, Nuno Sa
  Cc: Utsav Agarwal, linux-input, linux-kernel

On Fri, 2024-10-04 at 07:07 -0700, Dmitry Torokhov wrote:
> Commit dc748812fca0 ("Input: adp5588-keys - add support for pure gpio")
> made having interrupt line optional for the device, however it neglected
> to update suspend and resume handlers that try to disable interrupts
> for the duration of suspend.
> 
> Fix this by checking if interrupt number assigned to the i2c device is
> not 0 before trying to disable or reenable it.
> 
> Fixes: dc748812fca0 ("Input: adp5588-keys - add support for pure gpio")
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---

Reviewed-by: Nuno Sa <nuno.sa@analog.com>

>  drivers/input/keyboard/adp5588-keys.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/keyboard/adp5588-keys.c
> b/drivers/input/keyboard/adp5588-keys.c
> index d25d63a807f2..dc734974ce06 100644
> --- a/drivers/input/keyboard/adp5588-keys.c
> +++ b/drivers/input/keyboard/adp5588-keys.c
> @@ -822,7 +822,8 @@ static int adp5588_suspend(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  
> -	disable_irq(client->irq);
> +	if (client->irq)
> +		disable_irq(client->irq);
>  
>  	return 0;
>  }
> @@ -831,7 +832,8 @@ static int adp5588_resume(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  
> -	enable_irq(client->irq);
> +	if (client->irq)
> +		enable_irq(client->irq);
>  
>  	return 0;
>  }
> -- 
> 2.47.0.rc0.187.ge670bccf7e-goog
> 
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-07  6:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 14:07 [PATCH] Input: adp5588-keys - do not try to disable interrupt 0 Dmitry Torokhov
2024-10-07  6:27 ` Nuno Sá

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).