Commit d3176b29 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: tca6416-keypad - rely on I2C core to set up suspend/resume

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.

Link: https://lore.kernel.org/r/20230724053024.352054-2-dmitry.torokhov@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 687fe7df
...@@ -287,7 +287,6 @@ static int tca6416_keypad_probe(struct i2c_client *client) ...@@ -287,7 +287,6 @@ static int tca6416_keypad_probe(struct i2c_client *client)
} }
i2c_set_clientdata(client, chip); i2c_set_clientdata(client, chip);
device_init_wakeup(&client->dev, 1);
return 0; return 0;
...@@ -315,33 +314,9 @@ static void tca6416_keypad_remove(struct i2c_client *client) ...@@ -315,33 +314,9 @@ static void tca6416_keypad_remove(struct i2c_client *client)
kfree(chip); 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 = { static struct i2c_driver tca6416_keypad_driver = {
.driver = { .driver = {
.name = "tca6416-keypad", .name = "tca6416-keypad",
.pm = pm_sleep_ptr(&tca6416_keypad_dev_pm_ops),
}, },
.probe = tca6416_keypad_probe, .probe = tca6416_keypad_probe,
.remove = tca6416_keypad_remove, .remove = tca6416_keypad_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment