Skip to contentSkip to conversation

Input: adp5588-keys - do not try to disable interrupt 0

PATCH In review Dmitry Torokhov 2 participants 2 messages Oct 4, 2024 – Oct 7, 2024

Subsystems (3)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: adp5588-keys - do not try to disable interrupt 0

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")
---
 drivers/input/keyboard/adp5588-keys.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/input/keyboard/adp5588-keys.c +4 -2
index d25d63a807f2..dc734974ce06 100644
@@ -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;
 }
Signature · 5 lines
2.47.0.rc0.187.ge670bccf7e-goog


-- 
Dmitry
Reviewed-by Nuno Sa on v1 1/1
#1 lore raw
Quoted 11 lines · Dmitry Torokhov

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")

---

Quoted 32 lines

 drivers/input/keyboard/adp5588-keys.c | 6 ++++--

 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/input/keyboard/adp5588-keys.c +0 -0
index d25d63a807f2..dc734974ce06 100644
@@ -822,7 +822,8 @@ static int adp5588_suspend(struct device *dev)
  {
  	struct i2c_client *client = to_i2c_client(dev);

drivers/input/keyboard/adp5588-keys.c +2 -1
-	disable_irq(client->irq);
+	if (client->irq)
+		disable_irq(client->irq);


  return 0;
 }

drivers/input/keyboard/adp5588-keys.c +0 -0
@@ -831,7 +832,8 @@ static int adp5588_resume(struct device *dev)
  {
  	struct i2c_client *client = to_i2c_client(dev);

drivers/input/keyboard/adp5588-keys.c +2 -1
-	enable_irq(client->irq);
+	if (client->irq)
+		enable_irq(client->irq);


  return 0;
 }

Signature · 1 line
2.47.0.rc0.187.ge670bccf7e-goog