From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: linux-input@vger.kernel.org
Cc: Yangtao Li <frank.li@vivo.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] Input: tca6416-keypad - rely on I2C core to set up suspend/resume
Date: Sun, 23 Jul 2023 22:30:19 -0700 [thread overview]
Message-ID: <20230724053024.352054-2-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20230724053024.352054-1-dmitry.torokhov@gmail.com>
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 --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,
--
2.41.0.487.g6d72f3e995-goog
next prev parent reply other threads:[~2023-07-24 5:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 5:30 [PATCH 1/5] Input: tca6416-keypad - always expect proper IRQ number in i2c client Dmitry Torokhov
2023-07-24 5:30 ` Dmitry Torokhov [this message]
2023-07-24 5:30 ` [PATCH 3/5] Input: tca6416-keypad - fix interrupt enable disbalance Dmitry Torokhov
2023-07-24 5:30 ` [PATCH 4/5] Input: tca6416-keypad - convert to use devm_* api Dmitry Torokhov
2023-07-24 5:30 ` [PATCH 5/5] Input: tca6416-keypad - switch to using input core's polling features Dmitry Torokhov
2023-07-25 19:43 ` Silvan Jegen
2023-07-25 19:50 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230724053024.352054-2-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=frank.li@vivo.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).