From patchwork Wed Apr 23 13:52:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 884631 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3175F1A23AC; Wed, 23 Apr 2025 13:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745416377; cv=none; b=Zr2X+kE+1LIiGdiDBe4UGOph4eP6SrCtfGtppxdg5HRJWwKhWnNl/t+CA5x5rHpRX5qxWP+KCIx/+ePyZdybT4B0Dqgxcy75oWtqW4fTjaylgBKYxZvlk8iPgJTpFZsZWXbLcy0RAycJocvBVIFStyF4yUgIHt2/KInbMlZewaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745416377; c=relaxed/simple; bh=KUKZbHAriJOIzQIQdzNGHbT7RDZY7bT+Pa+gg0mDIgk=; h=From:To:Cc:Date:Message-Id:MIME-Version:Content-Type:Subject; b=asrgR5/BF3wpTAsXIiRX309maDkMDXi+Fs8lg6H1pDUIDXJn/r6wtIokZbe5oHJ3jcEcSEgL3IStCDm8U826ahOrKI9MN26yhhgAI7ltExG6HHEQL+V1BaIdDssXzMfP4OM05caRbKUsvrtBxIxZi/6E4hwcZoP/R4kpOK4/ffA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=iJrkxxYc; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="iJrkxxYc" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=tnvSs/gBKw3NOmvliWJyDFCWiOaJ4p22Yq2ks0Z5jtM=; b=iJrkxxYcQU+qkY8IBTfpSk+aL+ qSjSaTtWys+QoMP09vAn+SIsYkOvavZXxyrASufxZUTJGNmula3W0ruGxzJQjBg2XIswsXH4/FP1B KVzJs7Uy37rtNcftcwjAe0k7ux/RpRgdgytv7y0sNjmgTygu05CuE5kqefp95KI+pQxk=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:38616 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1u7aWr-0000FT-Gr; Wed, 23 Apr 2025 09:52:45 -0400 From: Hugo Villeneuve To: Linus Walleij , Dmitry Torokhov , Maximilian Weigand , Alistair Francis Cc: hugo@hugovil.com, Mikael Gonella-Bolduc , stable@vger.kernel.org, Hugo Villeneuve , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 23 Apr 2025 09:52:43 -0400 Message-Id: <20250423135243.1261460-1-hugo@hugovil.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Subject: [PATCH v2] Input: cyttsp5 - fix power control issue on wakeup X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) From: Mikael Gonella-Bolduc 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 Signed-off-by: Mikael Gonella-Bolduc --- Changes for v2: - Add Mikael SOB tag drivers/input/touchscreen/cyttsp5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 7adf8b1afc14832de099f9e178f08f91dc0dd6d0 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));