diff mbox series

Input: cyttsp5 - fix power control issue on wakeup

Message ID 20250422184324.3181215-1-hugo@hugovil.com
State Superseded
Headers show
Series Input: cyttsp5 - fix power control issue on wakeup | expand

Commit Message

Hugo Villeneuve April 22, 2025, 6:43 p.m. UTC
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>
---
 drivers/input/touchscreen/cyttsp5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 7adf8b1afc14832de099f9e178f08f91dc0dd6d0

Comments

Hugo Villeneuve April 22, 2025, 6:50 p.m. UTC | #1
On Tue, 22 Apr 2025 14:43:24 -0400
Hugo Villeneuve <hugo@hugovil.com> 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>

I inadvertently removed Mikael SOB tag, I can re-add it if a V2 is
needed.

Hugo.


> ---
>  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
> 
>
Greg Kroah-Hartman April 23, 2025, 6:12 a.m. UTC | #2
On Tue, Apr 22, 2025 at 02:50:26PM -0400, Hugo Villeneuve wrote:
> On Tue, 22 Apr 2025 14:43:24 -0400
> Hugo Villeneuve <hugo@hugovil.com> 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>
> 
> I inadvertently removed Mikael SOB tag, I can re-add it if a V2 is
> needed.

You can't remove it, please add it back.
diff mbox series

Patch

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