Skip to contentSkip to conversation

st1232: Add wakeup-source support

PATCH Superseded [email protected] 5 participants 22 messages Mar 5 – Apr 3

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover st1232: Add wakeup-source support

From: bui duc phuc <[email protected]>

This patch series adds support for using the Sitronix ST1232 touchscreen as a wakeup source on the Armadillo800EVA board.

Patch 1 documents the generic wakeup-source property in the Devicetree binding for the ST1232 touchscreen controller.

Patch 2 enables the wakeup-source property in the ST1232 touchscreen node for the Armadillo800EVA board, allowing touch events to wake the system from suspend.

This series depends on the following patch which has been submitted but not yet merged:

drm: shmobile: Fix blank screen after resume when LCDC is stopped

bui duc phuc (2):
dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source
arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to

    st1232
 .../bindings/input/touchscreen/sitronix,st1232.yaml          | 5 +++++
 arch/arm/boot/dts/renesas/r8a7740-armadillo800eva.dts        | 1 +
 2 files changed, 6 insertions(+)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source

From: bui duc phuc <[email protected]>

Document the 'wakeup-source' property for Sitronix ST1232 touchscreen controllers to allow the device to wake the system from suspend.

---
 .../bindings/input/touchscreen/sitronix,st1232.yaml          | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml +5 -0
index 978afaa4fcef..672544e5a26e 100644
@@ -32,6 +32,10 @@ properties:
     description: A phandle to the reset GPIO
     maxItems: 1
 
+  wakeup-source:
+    description: Device can be used as a wakeup source.
+    type: boolean
+
 required:
   - compatible
   - reg
@@ -51,6 +55,7 @@ examples:
                     reg = <0x55>;
                     interrupts = <2 0>;
                     gpios = <&gpio1 166 0>;
+                    wakeup-source;
 
                     touch-overlay {
                             segment-0 {
Signature · 1 line
2.43.0
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source

Quoted 15 lines · On Thu, Mar 05, 2026 at 06:35:11PM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

Document the 'wakeup-source' property for Sitronix ST1232 touchscreen controllers to allow the device to wake the system from suspend.

---
 .../bindings/input/touchscreen/sitronix,st1232.yaml          | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml +0 -0
index 978afaa4fcef..672544e5a26e 100644

Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml properties: · line 36

Quoted 5 lines
Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml +2 -0
@@ -32,6 +32,10 @@ properties:
     description: A phandle to the reset GPIO
     maxItems: 1
 
+  wakeup-source:
+    description: Device can be used as a wakeup source.

Drop description

Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml properties: · line 37

Quoted 1 line
Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml +1 -0
+    type: boolean

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/2] dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source

Hi Krzysztof,

Thank you for your review. I will drop the description for the 'wakeup-source' property and send the v2 series shortly.

Best regards,
Phuc

#4 lore raw

PATCH 2/2 arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to st1232

In reply to [email protected]

From: bui duc phuc <[email protected]>

Add the wakeup-source property to the ST1232 touchscreen node in the device tree so that the touchscreen interrupt can wake the system from suspend when the panel is touched.

---
 arch/arm/boot/dts/renesas/r8a7740-armadillo800eva.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/renesas/r8a7740-armadillo800eva.dts +1 -0
index 04d24b6d8056..d47a6cc3e756 100644
@@ -228,6 +228,7 @@ touchscreen@55 {
 		pinctrl-0 = <&st1232_pins>;
 		pinctrl-names = "default";
 		gpios = <&pfc 166 GPIO_ACTIVE_LOW>;
+		wakeup-source;
 	};
 };
 
Signature · 1 line
2.43.0
#5 lore raw

v2 cover Input: st1232 - add system wakeup support

In reply to [email protected]

From: bui duc phuc <[email protected]>

Hi all,

This patch series adds system wakeup support for the ST1232 touchscreen controller.

During development it was observed that the device did not expose the "power/wakeup" sysfs attribute, preventing it from being configured as a wakeup source for system suspend.

To address this, the Devicetree node for the touchscreen is updated to include the "wakeup-source" property, and the st1232 driver is extended to initialize the device wakeup capability and report wakeup events to the PM core.

## Testing

The changes were tested on the
Armadillo800EVA board based on the Renesas R8A7740 SoC.

The system successfully resumes from suspend when the LCD panel is touched.

Due to the interrupt hierarchy on this platform, the parent interrupt controller (GIC, IRQ 24) is recorded as the primary source that wakes the SoC, followed by the device interrupt (IRQ 35).

Example kernel log during wakeup:

PM: suspend-to-idle
PM: Triggering wakeup from IRQ 24
PM: Triggering wakeup from IRQ 35

## Verified functionality

* The "power/wakeup" sysfs attribute is present for the device.
* The system resumes correctly from 'mem' and 'freeze' states when the touchscreen is touched.

## Changes in v2
* Drop description for wakeup-source property as suggested by Krzysztof Kozlowski.
* Updated commit messages for clarity.
* Added driver-side wakeup handling in st1232.c.

## Patch series

1. dt-bindings: input: touchscreen: st1232: document wakeup-source
2. arm: dts: r8a7740: armadillo800eva: add wakeup-source to st1232
3. Input: st1232: add wakeup support

Feedback and review are welcome.

bui duc phuc (3):
dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source
arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to

    st1232

input: touchscreen: st1232: add system wakeup support

 .../input/touchscreen/sitronix,st1232.yaml    |  4 +++
 .../dts/renesas/r8a7740-armadillo800eva.dts   |  1 +
 drivers/input/touchscreen/st1232.c            | 27 +++++++++++++++----
 3 files changed, 27 insertions(+), 5 deletions(-)
Signature · 1 line
2.43.0
#6 lore raw

PATCH v2 1/3 dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source

From: bui duc phuc <[email protected]>

Document the 'wakeup-source' property for Sitronix ST1232 touchscreen controllers to allow the device to wake the system from suspend.

---

Changes in v2:
- Drop redundant description for wakeup-source property as requested by Krzysztof Kozlowski.

 .../bindings/input/touchscreen/sitronix,st1232.yaml           | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml +4 -0
index 978afaa4fcef..fe1fa217d842 100644
@@ -32,6 +32,9 @@ properties:
     description: A phandle to the reset GPIO
     maxItems: 1
 
+  wakeup-source:
+    type: boolean
+
 required:
   - compatible
   - reg
@@ -51,6 +54,7 @@ examples:
                     reg = <0x55>;
                     interrupts = <2 0>;
                     gpios = <&gpio1 166 0>;
+                    wakeup-source;
 
                     touch-overlay {
                             segment-0 {
Signature · 1 line
2.43.0
#7 lore raw

Re: [PATCH v2 1/3] dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source

Quoted 9 lines · On 06/03/2026 11:40, [email protected] wrote:

From: bui duc phuc <[email protected]>

Document the 'wakeup-source' property for Sitronix ST1232 touchscreen controllers to allow the device to wake the system from suspend.

---

Do not attach (thread) your patchsets to some other threads (unrelated or older versions). This buries them deep in the mailbox and might interfere with applying entire sets. See also:
https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830

Best regards,
Krzysztof

#8 lore raw

Re: [PATCH v2 1/3] dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source

Hi Krzysztof,

Quoted 5 lines

Do not attach (thread) your patchsets to some other threads (unrelated or older versions). This buries them deep in the mailbox and might interfere with applying entire sets. See also:
https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830

Thank you for the guidance.

I would like to apologize for the confusion. While I was reviewing v2 myself, I realized there were technical issues and immediately worked on v3 to fix them. Ironically, the fixes I made in v3 were exactly what you suggested in your feedback for v2.

However, because I was so focused on the code, I sent out v3 before checking my inbox and seeing your comments. This led me to unintentionally repeat the same threading mistake you had just warned me about.

I have now carefully read the documentation you provided. I will ensure that v4 is sent as a fresh, un-threaded series.

Thank you for your patience with a newcomer.

Best regards,
Phuc

#9 lore raw

PATCH v2 2/3 arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to st1232

In reply to [email protected]

From: bui duc phuc <[email protected]>

Add the wakeup-source property to the ST1232 touchscreen node in the device tree so that the touchscreen interrupt can wake the system from suspend when the panel is touched.

---
 arch/arm/boot/dts/renesas/r8a7740-armadillo800eva.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/renesas/r8a7740-armadillo800eva.dts +1 -0
index 04d24b6d8056..d47a6cc3e756 100644
@@ -228,6 +228,7 @@ touchscreen@55 {
 		pinctrl-0 = <&st1232_pins>;
 		pinctrl-names = "default";
 		gpios = <&pfc 166 GPIO_ACTIVE_LOW>;
+		wakeup-source;
 	};
 };
 
Signature · 1 line
2.43.0
#10 lore raw

PATCH v2 3/3 input: touchscreen: st1232: add system wakeup support

In reply to [email protected]

From: bui duc phuc <[email protected]>

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.

Additionally, report wakeup events from the interrupt handler when the device is allowed to wake the system. This allows the PM core to track touch-generated wakeup events and helps avoid potential races with system suspend.

If wakeup is not enabled, the driver retains the existing behavior of disabling the IRQ and powering down the controller during suspend.

---
 drivers/input/touchscreen/st1232.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)
drivers/input/touchscreen/st1232.c +22 -5
index 9b3901eec0a5..2bab06cf099b 100644
@@ -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;
 }
 
@@ -363,11 +369,20 @@ 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);
+	int ret;
 
-	disable_irq(client->irq);
+	dev_info(dev, "st1232: suspend called\n");
+	dev_info(dev, "st1232: irq=%d wakeup=%d\n", client->irq, device_may_wakeup(dev));
 
-	if (!device_may_wakeup(&client->dev))
+	if (device_may_wakeup(dev)) {
+		ret = enable_irq_wake(client->irq);
+		dev_info(dev, "st1232: Supend use wakeup\n");
+		dev_info(dev, "enable_irq_wake ret=%d\n", ret);
+	} else {
+		dev_info(dev, "st1232: Suspend Don't use wakeup\n");
+		disable_irq(client->irq);
 		st1232_ts_power(ts, false);
+	}
 
 	return 0;
 }
@@ -377,10 +392,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;
 }
Signature · 1 line
2.43.0
#11 lore raw

Re: [PATCH v2 3/3] input: touchscreen: st1232: add system wakeup support

Quoted 48 lines · On 06/03/2026 11:40, [email protected] wrote:

From: bui duc phuc <[email protected]>

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.

Additionally, report wakeup events from the interrupt handler when the device is allowed to wake the system. This allows the PM core to track touch-generated wakeup events and helps avoid potential races with system suspend.

If wakeup is not enabled, the driver retains the existing behavior of disabling the IRQ and powering down the controller during suspend.

---
 drivers/input/touchscreen/st1232.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)
drivers/input/touchscreen/st1232.c +6 -0
index 9b3901eec0a5..2bab06cf099b 100644
@@ -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;
 }
 

drivers/input/touchscreen/st1232.c static int st1232_ts_suspend(struct device *dev) · line 375

Quoted 8 lines
drivers/input/touchscreen/st1232.c +3 -1
@@ -363,11 +369,20 @@ 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);
+	int ret;
 
-	disable_irq(client->irq);
+	dev_info(dev, "st1232: suspend called\n");
+	dev_info(dev, "st1232: irq=%d wakeup=%d\n", client->irq, device_may_wakeup(dev));

No, there is no need to add success messages.

drivers/input/touchscreen/st1232.c static int st1232_ts_suspend(struct device *dev) · line 380

Quoted 6 lines
drivers/input/touchscreen/st1232.c +4 -1
-	if (!device_may_wakeup(&client->dev))
+	if (device_may_wakeup(dev)) {
+		ret = enable_irq_wake(client->irq);
+		dev_info(dev, "st1232: Supend use wakeup\n");
+		dev_info(dev, "enable_irq_wake ret=%d\n", ret);

Drop both

drivers/input/touchscreen/st1232.c static int st1232_ts_suspend(struct device *dev) · line 382

Quoted 2 lines
drivers/input/touchscreen/st1232.c +2 -0
+	} else {
+		dev_info(dev, "st1232: Suspend Don't use wakeup\n");

Drop

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH v2 3/3] input: touchscreen: st1232: add system wakeup support

Hi Krzysztof,

Quoted 16 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	dev_info(dev, "st1232: suspend called\n");
+	dev_info(dev, "st1232: irq=%d wakeup=%d\n", client->irq, 

device_may_wakeup(dev));

No, there is no need to add success messages.

drivers/input/touchscreen/st1232.c static int st1232_ts_suspend(struct device *dev) · line 380

Quoted 6 lines
drivers/input/touchscreen/st1232.c +4 -1
-	if (!device_may_wakeup(&client->dev))
+	if (device_may_wakeup(dev)) {
+		ret = enable_irq_wake(client->irq);
+		dev_info(dev, "st1232: Supend use wakeup\n");
+		dev_info(dev, "enable_irq_wake ret=%d\n", ret);

Drop both

Quoted 4 lines

drivers/input/touchscreen/st1232.c static int st1232_ts_suspend(struct device *dev) · line 382

Quoted 2 lines
drivers/input/touchscreen/st1232.c +2 -0
+	} else {
+		dev_info(dev, "st1232: Suspend Don't use wakeup\n");

Drop

My apologies. You are absolutely right. I realized these debug messages were unnecessary and already removed them in the v3 I sent (though I unfortunately messed up the threading for that version).
I will ensure they stay removed in v4, which will be sent as a fresh thread.

Best regards,
Phuc

#13 lore raw

v3 cover Input: st1232 - add system wakeup support

In reply to [email protected]

From: bui duc phuc <[email protected]>

Hi all,

This patch series adds system wakeup support for the ST1232 touchscreen controller.

During development it was observed that the device did not expose the "power/wakeup" sysfs attribute, preventing it from being configured as a wakeup source for system suspend.

To address this, the Devicetree node for the touchscreen is updated to include the "wakeup-source" property, and the st1232 driver is extended to initialize the device wakeup capability and report wakeup events to the PM core.

Testing

The changes were tested on the
Armadillo800EVA board based on the Renesas R8A7740 SoC.

The system successfully resumes from suspend when the LCD panel is touched.

Due to the interrupt hierarchy on this platform, the parent interrupt controller (GIC, IRQ 24) is recorded as the primary source that wakes the SoC, followed by the device interrupt (IRQ 35).

Example kernel log during wakeup:

PM: suspend-to-idle
PM: Triggering wakeup from IRQ 24
PM: Triggering wakeup from IRQ 35

Verified functionality

* The "power/wakeup" sysfs attribute is present for the device.
* The system resumes correctly from 'mem' and 'freeze' states when the touchscreen is touched.

Changes in v3:
* Patch 3: Removed debug dev_info() log messages for a cleaner production-ready implementation.
* No changes to Patch 1 and Patch 2.

Changes in v2
* Drop description for wakeup-source property as suggested by Krzysztof Kozlowski.
* Updated commit messages for clarity.
* Added driver-side wakeup handling in st1232.c.

Patch series

1. dt-bindings: input: touchscreen: st1232: document wakeup-source
2. arm: dts: r8a7740: armadillo800eva: add wakeup-source to st1232
3. Input: st1232: add wakeup support

This series depends on the following patch which has been submitted but not yet merged:

drm: shmobile: Fix blank screen after resume when LCDC is stopped

Feedback and review are welcome.

bui duc phuc (3):
dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source
arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to

    st1232

input: touchscreen: st1232: add system wakeup support

 .../input/touchscreen/sitronix,st1232.yaml    |  4 ++++
 .../dts/renesas/r8a7740-armadillo800eva.dts   |  1 +
 drivers/input/touchscreen/st1232.c            | 22 ++++++++++++++-----
 3 files changed, 21 insertions(+), 6 deletions(-)
Signature · 1 line
2.43.0
#14 lore raw

PATCH v3 1/3 dt-bindings: input: touchscreen: sitronix,st1232: Add wakeup-source

From: bui duc phuc <[email protected]>

Document the 'wakeup-source' property for Sitronix ST1232 touchscreen controllers to allow the device to wake the system from suspend.

---
 .../bindings/input/touchscreen/sitronix,st1232.yaml           | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml +4 -0
index 978afaa4fcef..fe1fa217d842 100644
@@ -32,6 +32,9 @@ properties:
     description: A phandle to the reset GPIO
     maxItems: 1
 
+  wakeup-source:
+    type: boolean
+
 required:
   - compatible
   - reg
@@ -51,6 +54,7 @@ examples:
                     reg = <0x55>;
                     interrupts = <2 0>;
                     gpios = <&gpio1 166 0>;
+                    wakeup-source;
 
                     touch-overlay {
                             segment-0 {
Signature · 1 line
2.43.0
#15 lore raw

PATCH v3 2/3 arm: dts: renesas: r8a7740-armadillo800eva: Add wakeup-source to st1232

In reply to [email protected]

From: bui duc phuc <[email protected]>

Add the wakeup-source property to the ST1232 touchscreen node in the device tree so that the touchscreen interrupt can wake the system from suspend when the panel is touched.

---
 arch/arm/boot/dts/renesas/r8a7740-armadillo800eva.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/renesas/r8a7740-armadillo800eva.dts +1 -0
index 04d24b6d8056..d47a6cc3e756 100644
@@ -228,6 +228,7 @@ touchscreen@55 {
 		pinctrl-0 = <&st1232_pins>;
 		pinctrl-names = "default";
 		gpios = <&pfc 166 GPIO_ACTIVE_LOW>;
+		wakeup-source;
 	};
 };
 
Signature · 1 line
2.43.0
#16 lore raw

PATCH v3 3/3 input: touchscreen: st1232: add system wakeup support

In reply to [email protected]

From: bui duc phuc <[email protected]>

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.

---
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(-)
drivers/input/touchscreen/st1232.c +16 -6
index 9b3901eec0a5..8fce17d8bdc0 100644
@@ -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;
 }
Signature · 1 line
2.43.0
maintainer
#17 lore raw

Re: [PATCH v3 3/3] input: touchscreen: st1232: add system wakeup support

Quoted 5 lines · On Fri, Mar 06, 2026 at 06:19:12PM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

The ST1232 touchscreen controller can generate an interrupt when the panel is touched, which may be used as a wakeup source for the system.

Quoted 7 lines

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.

I do not believe this patch is needed: i2c core already handles "wakeup-source" property and manages wakeup IRQ.

Thanks.

Signature · 1 line
Dmitry
#18 lore raw

Re: [PATCH v3 3/3] input: touchscreen: st1232: add system wakeup support

Hi Dmitry,

Quoted 11 lines · Dmitry Torokhov
Quoted 10 lines · On Fri, Mar 06, 2026 at 06:19:12PM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

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.

Quoted 5 lines
Quoted 2 lines

If wakeup is not enabled, the driver retains the existing behavior of disabling the IRQ and powering down the controller during suspend.

I do not believe this patch is needed: i2c core already handles "wakeup-source" property and manages wakeup IRQ.

No, it is not needed, as mentioned in the cover letter of v4[1], and as tested by me[2].

[1] https://lore.kernel.org/[email protected]
[2] https://lore.kernel.org/CAMuHMdUqiaP=COTkKU_jK6Hdii+YJ5+zXnxFkOOnhLri5NakTw@mail.gmail.com

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#19 lore raw

Re: [PATCH v3 3/3] input: touchscreen: st1232: add system wakeup support

Hi Dmitry, Geert,

Thank you, Dmitry, for the review and the explanation. You are absolutely right; I realized the I2C core handles this automatically, which is tại sao I dropped those changes in the v4 series [1] as Geert mentioned.

Thank you, Geert, for pointing that out and for your support.

While working on this, I also noticed similar redundant wakeup handling in the mpr121 driver and sent a cleanup patch to remove it [2].

[1] https://lore.kernel.org/[email protected]
[2] https://lore.kernel.org/all/[email protected]/

Thanks,
Phuc

Quoted 37 lines · Geert Uytterhoeven

Hi Dmitry,

Quoted 11 lines · Dmitry Torokhov
Quoted 10 lines · On Fri, Mar 06, 2026 at 06:19:12PM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

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.

Quoted 5 lines
Quoted 2 lines

If wakeup is not enabled, the driver retains the existing behavior of disabling the IRQ and powering down the controller during suspend.

I do not believe this patch is needed: i2c core already handles "wakeup-source" property and manages wakeup IRQ.

No, it is not needed, as mentioned in the cover letter of v4[1], and as tested by me[2].

[1] https://lore.kernel.org/[email protected]
[2] https://lore.kernel.org/CAMuHMdUqiaP=COTkKU_jK6Hdii+YJ5+zXnxFkOOnhLri5NakTw@mail.gmail.com

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#20 lore raw

Re: [PATCH v3 0/3] Input: st1232 - add system wakeup support

In reply to [email protected]

Krzysztof already adviced you to not attach new series to old threads. Please follow this suggestion:

Do not attach (thread) your patchsets to some other threads (unrelated or older versions). This buries them deep in the mailbox and might interfere with applying entire sets. See also:
https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830

#21 lore raw

Re: [PATCH v3 0/3] Input: st1232 - add system wakeup support

Hi Wolfram,

Quoted 9 lines

Krzysztof already adviced you to not attach new series to old threads. Please follow this suggestion:

Do not attach (thread) your patchsets to some other threads (unrelated or older versions). This buries them deep in the mailbox and might interfere with applying entire sets. See also:

https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830

You are right, and I apologize for the duplication of the mistake.

I missed Krzysztof's earlier reply while I was preparing v3, which led to this incorrect threading again. I have already replied to Krzysztof's thread to acknowledge the error.

I will follow the proper process by starting a fresh, un-threaded series for v4.

Thank you for the reminder.

Best regards,
Phuc