From: phucduc.bui@gmail.com
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Jeff LaBundy <jeff@labundy.com>, Bastian Hecht <hechtb@gmail.com>,
Javier Carrasco <javier.carrasco@wolfvision.net>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH v3 3/3] input: touchscreen: st1232: add system wakeup support
Date: Fri, 6 Mar 2026 18:19:12 +0700 [thread overview]
Message-ID: <20260306111912.58388-4-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260306111912.58388-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
The ST1232 touchscreen controller can generate an interrupt when the
panel is touched, which may be used as a wakeup source for the system.
Add support for system wakeup by initializing the device wakeup
capability in probe() based on the "wakeup-source" device property.
When wakeup is enabled, the driver enables IRQ wake during suspend
so that touch events can wake the system.
If wakeup is not enabled, the driver retains the existing behavior of
disabling the IRQ and powering down the controller during suspend.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v3:
- Remove debug dev_info() messages to clean up the code and comply with
upstream coding standards.
drivers/input/touchscreen/st1232.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 9b3901eec0a5..8fce17d8bdc0 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -183,6 +183,9 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)
int count;
int error;
+ if (device_may_wakeup(&ts->client->dev))
+ pm_wakeup_event(&ts->client->dev, 0);
+
error = st1232_ts_read_data(ts, REG_XY_COORDINATES, ts->read_buf_len);
if (error)
goto out;
@@ -356,6 +359,9 @@ static int st1232_ts_probe(struct i2c_client *client)
i2c_set_clientdata(client, ts);
+ device_init_wakeup(&client->dev,
+ device_property_read_bool(&client->dev, "wakeup-source"));
+
return 0;
}
@@ -364,10 +370,12 @@ static int st1232_ts_suspend(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct st1232_ts_data *ts = i2c_get_clientdata(client);
- disable_irq(client->irq);
-
- if (!device_may_wakeup(&client->dev))
+ if (device_may_wakeup(dev)) {
+ enable_irq_wake(client->irq);
+ } else {
+ disable_irq(client->irq);
st1232_ts_power(ts, false);
+ }
return 0;
}
@@ -377,10 +385,12 @@ static int st1232_ts_resume(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct st1232_ts_data *ts = i2c_get_clientdata(client);
- if (!device_may_wakeup(&client->dev))
+ if (device_may_wakeup(dev)) {
+ disable_irq_wake(client->irq);
+ } else {
st1232_ts_power(ts, true);
-
- enable_irq(client->irq);
+ enable_irq(client->irq);
+ }
return 0;
}
--
2.43.0
next prev parent reply other threads:[~2026-03-06 11:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 11:35 [PATCH 0/2] st1232: Add wakeup-source support phucduc.bui
2026-03-05 11:35 ` [PATCH 1/2] dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source phucduc.bui
2026-03-06 8:18 ` Krzysztof Kozlowski
2026-03-06 10:24 ` phucduc.bui
2026-03-05 11:35 ` [PATCH 2/2] arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to st1232 phucduc.bui
2026-03-06 10:40 ` [PATCH v2 0/3] Input: st1232 - add system wakeup support phucduc.bui
2026-03-06 10:40 ` [PATCH v2 1/3] dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source phucduc.bui
2026-03-06 10:42 ` Krzysztof Kozlowski
2026-03-07 2:46 ` phucduc.bui
2026-03-06 10:40 ` [PATCH v2 2/3] arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to st1232 phucduc.bui
2026-03-06 10:40 ` [PATCH v2 3/3] input: touchscreen: st1232: add system wakeup support phucduc.bui
2026-03-06 10:44 ` Krzysztof Kozlowski
2026-03-07 2:50 ` phucduc.bui
2026-03-06 11:19 ` [PATCH v3 0/3] Input: st1232 - " phucduc.bui
2026-03-06 11:19 ` [PATCH v3 1/3] dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source phucduc.bui
2026-03-06 11:19 ` [PATCH v3 2/3] arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to st1232 phucduc.bui
2026-03-06 11:19 ` phucduc.bui [this message]
2026-03-06 11:49 ` [PATCH v3 0/3] Input: st1232 - add system wakeup support Wolfram Sang
2026-03-07 2:53 ` phucduc.bui
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=20260306111912.58388-4-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=geert+renesas@glider.be \
--cc=hechtb@gmail.com \
--cc=javier.carrasco@wolfvision.net \
--cc=jeff@labundy.com \
--cc=krzk+dt@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=robh@kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/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