linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Input: cyttsp5 - fix power control issue on wakeup
@ 2025-04-23 13:52 Hugo Villeneuve
  2025-04-24  8:00 ` Alistair
  2025-04-28 19:19 ` Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: Hugo Villeneuve @ 2025-04-23 13:52 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Maximilian Weigand,
	Alistair Francis
  Cc: hugo, Mikael Gonella-Bolduc, stable, Hugo Villeneuve, linux-input,
	linux-kernel

From: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>

The power control function ignores the "on" argument when setting the
report ID, and thus is always sending HID_POWER_SLEEP. This causes a
problem when trying to wakeup.

Fix by sending the state variable, which contains the proper HID_POWER_ON or
HID_POWER_SLEEP based on the "on" argument.

Fixes: 3c98b8dbdced ("Input: cyttsp5 - implement proper sleep and wakeup procedures")
Cc: stable@vger.kernel.org
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Signed-off-by: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>
---
Changes for v2:
 - Add Mikael SOB tag

 drivers/input/touchscreen/cyttsp5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
index eafe5a9b89648..86edcacb4ab3e 100644
--- a/drivers/input/touchscreen/cyttsp5.c
+++ b/drivers/input/touchscreen/cyttsp5.c
@@ -580,7 +580,7 @@ static int cyttsp5_power_control(struct cyttsp5 *ts, bool on)
 	int rc;
 
 	SET_CMD_REPORT_TYPE(cmd[0], 0);
-	SET_CMD_REPORT_ID(cmd[0], HID_POWER_SLEEP);
+	SET_CMD_REPORT_ID(cmd[0], state);
 	SET_CMD_OPCODE(cmd[1], HID_CMD_SET_POWER);
 
 	rc = cyttsp5_write(ts, HID_COMMAND_REG, cmd, sizeof(cmd));

base-commit: 7adf8b1afc14832de099f9e178f08f91dc0dd6d0
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Input: cyttsp5 - fix power control issue on wakeup
  2025-04-23 13:52 [PATCH v2] Input: cyttsp5 - fix power control issue on wakeup Hugo Villeneuve
@ 2025-04-24  8:00 ` Alistair
  2025-04-28 19:19 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Alistair @ 2025-04-24  8:00 UTC (permalink / raw)
  To: Hugo Villeneuve, Linus Walleij, Dmitry Torokhov,
	Maximilian Weigand
  Cc: Mikael Gonella-Bolduc, stable, Hugo Villeneuve, linux-input,
	Linux Kernel Mailing List

On Wed, 23 Apr 2025, at 11:52 PM, Hugo Villeneuve wrote:
> From: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>
> 
> The power control function ignores the "on" argument when setting the
> report ID, and thus is always sending HID_POWER_SLEEP. This causes a
> problem when trying to wakeup.
> 
> Fix by sending the state variable, which contains the proper HID_POWER_ON or
> HID_POWER_SLEEP based on the "on" argument.
> 
> Fixes: 3c98b8dbdced ("Input: cyttsp5 - implement proper sleep and wakeup procedures")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> Signed-off-by: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>

Reviewed-by: Alistair Francis <alistair@alistair23.me>

Alistair

> ---
> Changes for v2:
> - Add Mikael SOB tag
> 
> drivers/input/touchscreen/cyttsp5.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
> index eafe5a9b89648..86edcacb4ab3e 100644
> --- a/drivers/input/touchscreen/cyttsp5.c
> +++ b/drivers/input/touchscreen/cyttsp5.c
> @@ -580,7 +580,7 @@ static int cyttsp5_power_control(struct cyttsp5 *ts, bool on)
> int rc;
>  
> SET_CMD_REPORT_TYPE(cmd[0], 0);
> - SET_CMD_REPORT_ID(cmd[0], HID_POWER_SLEEP);
> + SET_CMD_REPORT_ID(cmd[0], state);
> SET_CMD_OPCODE(cmd[1], HID_CMD_SET_POWER);
>  
> rc = cyttsp5_write(ts, HID_COMMAND_REG, cmd, sizeof(cmd));
> 
> base-commit: 7adf8b1afc14832de099f9e178f08f91dc0dd6d0
> -- 
> 2.39.5
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Input: cyttsp5 - fix power control issue on wakeup
  2025-04-23 13:52 [PATCH v2] Input: cyttsp5 - fix power control issue on wakeup Hugo Villeneuve
  2025-04-24  8:00 ` Alistair
@ 2025-04-28 19:19 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2025-04-28 19:19 UTC (permalink / raw)
  To: Hugo Villeneuve
  Cc: Linus Walleij, Maximilian Weigand, Alistair Francis,
	Mikael Gonella-Bolduc, stable, Hugo Villeneuve, linux-input,
	linux-kernel

On Wed, Apr 23, 2025 at 09:52:43AM -0400, Hugo Villeneuve wrote:
> From: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>
> 
> The power control function ignores the "on" argument when setting the
> report ID, and thus is always sending HID_POWER_SLEEP. This causes a
> problem when trying to wakeup.
> 
> Fix by sending the state variable, which contains the proper HID_POWER_ON or
> HID_POWER_SLEEP based on the "on" argument.
> 
> Fixes: 3c98b8dbdced ("Input: cyttsp5 - implement proper sleep and wakeup procedures")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> Signed-off-by: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-28 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 13:52 [PATCH v2] Input: cyttsp5 - fix power control issue on wakeup Hugo Villeneuve
2025-04-24  8:00 ` Alistair
2025-04-28 19:19 ` Dmitry Torokhov

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).