diff mbox series

[2/5] Input: tca6416-keypad - rely on I2C core to set up suspend/resume

Message ID 20230724053024.352054-2-dmitry.torokhov@gmail.com
State Accepted
Commit d3176b29263aa8211830c77d87a806066c2c178c
Headers show
Series [1/5] Input: tca6416-keypad - always expect proper IRQ number in i2c client | expand

Commit Message

Dmitry Torokhov July 24, 2023, 5:30 a.m. UTC
tca6416_keypad_suspend() and tca6416_keypad_resume() only configure device
IRQ for wakeup. I2C core already does this by registering interrupt as a
wakeup IRQ in case when device is marked as wakeup-enabled, so we can
simply remove this code from the driver.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/keyboard/tca6416-keypad.c | 25 -------------------------
 1 file changed, 25 deletions(-)
diff mbox series

Patch

diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c
index 01bc0b881188..906dffbf171c 100644
--- a/drivers/input/keyboard/tca6416-keypad.c
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -287,7 +287,6 @@  static int tca6416_keypad_probe(struct i2c_client *client)
 	}
 
 	i2c_set_clientdata(client, chip);
-	device_init_wakeup(&client->dev, 1);
 
 	return 0;
 
@@ -315,33 +314,9 @@  static void tca6416_keypad_remove(struct i2c_client *client)
 	kfree(chip);
 }
 
-static int tca6416_keypad_suspend(struct device *dev)
-{
-	struct i2c_client *client = to_i2c_client(dev);
-
-	if (device_may_wakeup(dev))
-		enable_irq_wake(client->irq);
-
-	return 0;
-}
-
-static int tca6416_keypad_resume(struct device *dev)
-{
-	struct i2c_client *client = to_i2c_client(dev);
-
-	if (device_may_wakeup(dev))
-		disable_irq_wake(client->irq);
-
-	return 0;
-}
-
-static DEFINE_SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
-				tca6416_keypad_suspend, tca6416_keypad_resume);
-
 static struct i2c_driver tca6416_keypad_driver = {
 	.driver = {
 		.name	= "tca6416-keypad",
-		.pm	= pm_sleep_ptr(&tca6416_keypad_dev_pm_ops),
 	},
 	.probe		= tca6416_keypad_probe,
 	.remove		= tca6416_keypad_remove,