From patchwork Fri Sep 15 13:47:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 723790 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC216EE645C for ; Fri, 15 Sep 2023 13:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235459AbjIONrq (ORCPT ); Fri, 15 Sep 2023 09:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235418AbjIONrp (ORCPT ); Fri, 15 Sep 2023 09:47:45 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2070.outbound.protection.outlook.com [40.107.105.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EEAF199; Fri, 15 Sep 2023 06:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eRMw7YXGkhWLBoItlGrLCosjgKQjB8sBreBTg2mxxxViJkS8R98OFvIUvvPaIAB/bZH8YAOZpxwHRgxSNaMDV2V/kKotE2UKa847/hy/mEbJNmrdvY4MG/WkwjcBa8D04DdFfgHIXK/gkn7882LFRc8NijumDDoe9FD9KW2tEpVbqa4xKQPhsifZFZX8Mf9oRRpM0BFrYyHLWXfc4FzsuyVg07sTxxB6W8Q/0hLyr/KDYziBWXlBHaPqg6PO9AAfhUvaEa3TapIHIFATP9aGARF23S+nnQTpOauED4em6LTptFKePTaaWQhwkChGxZhkDVawDsOgdXox8IOrUxDt9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lReSXGbbC34JLXpYp7jXhMtGRLzpp5PiAqJ8/ESOhf4=; b=KlVswHly68b8ed+5ELwA3tCo6TBLSSS8uBknhgiq3Lvr1TmQNCKdiH+bi7x0oGosjyElgGJf8FwbW5HL3cFyvzL0A9sliZ0rYEV3CcUInn7DnPcAYnsVgkwpNPly6CF3lbAcFzBtq9I7o8OGSZk95f6MMWK0ZStZc+iqmm00H/7rsUHHw586IqdBorYV5kA2bCVuDR36JkYgf8U+wZKzzSNQ+Mqqh1pGcsRxBX1YyICkPncHpFO/GLu10KMpNKtWlpWzhWKMby6PRBd4zz73S4HcPQd09yi1OVT4GVANlDfnCN5mKWdE07vJgRpqBWhSluF029ptoNQmhAqSqXg4xQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lReSXGbbC34JLXpYp7jXhMtGRLzpp5PiAqJ8/ESOhf4=; b=fKM8bPPGWALHW3sYPNQ/g1vK5NHPttcAp4xKhf0dPWwqsItyklxqhFTX6r7TRfb6++kX/SNK/tpIBOayqt6kxw+KQyhlT7bOMssbZRyoF8aGrYyjz9QH9D3Cx2XxTQJ5A42ANm+jhfzdwbAQEDvn589y97UvJZNQRFqCnv4Evbg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by PAWPR08MB9783.eurprd08.prod.outlook.com (2603:10a6:102:2ee::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.31; Fri, 15 Sep 2023 13:47:37 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bc92:216b:11ed:db63]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bc92:216b:11ed:db63%6]) with mapi id 15.20.6792.020; Fri, 15 Sep 2023 13:47:37 +0000 From: Javier Carrasco Date: Fri, 15 Sep 2023 15:47:24 +0200 Subject: [PATCH v2 1/2] Input: st1232 - remove enable/disable irq if device may wake up Message-Id: <20230826-feature-st1232_freeze_wakeup-v2-1-29ae9f747137@wolfvision.net> References: <20230826-feature-st1232_freeze_wakeup-v2-0-29ae9f747137@wolfvision.net> In-Reply-To: <20230826-feature-st1232_freeze_wakeup-v2-0-29ae9f747137@wolfvision.net> To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694785656; l=1728; i=javier.carrasco@wolfvision.net; s=20230509; h=from:subject:message-id; bh=T0v4Wv4A2+43BzLQqP9mZexzHUuL6xkE8xQU5IvVaOw=; b=7+iMu8hXruiEi6dDzXUMw+fSEUPneE3Sf8nZVaqebPZuIcl1SCyg25q1YLnRb46BRyYU/RHk3 asjKjgZR/sTAEu/5/EETgUJm8K7ECh3N7gLSTMXXLtak0bGN5bVz3JP X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=tIGJV7M+tCizagNijF0eGMBGcOsPD+0cWGfKjl4h6K8= X-ClientProxiedBy: VI1PR08CA0233.eurprd08.prod.outlook.com (2603:10a6:802:15::42) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|PAWPR08MB9783:EE_ X-MS-Office365-Filtering-Correlation-Id: 645c98f7-a2f9-477f-f67e-08dbb5f25213 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eDJoauZN2qYn5DGZzNuCJgA+4c6NvaAqihAHY69GqeeZkADeuL909mV7nU5m2YSGIATl/1QAxBABd0wmtGIFlAGNJWL3jyjI/aQdt5B9a3k/jmEhjBB3E3kUtmSqerDbdileNtGNCr5AWSmGGpoIsBayzfgKmSKdcmgAj+tV+QRGA962Ryrdh9tyu8QFUAfteP4BpfisvnhLYwW5Cju3C2LYxNHoPL1YxYaG3GmJVw7RNWSKae/FLxSTf5C+ZD+arNHPruvmA6XYn+bN1x9dwJIGNNz0wSJKbdkmCEBG2NwbAxjKdA0hGDwmBFvJB/hLPQ596CgmdKlY2dSqHitqMherBJ89svawRs8066YwA2pdMGvvNUbI2TqC5bRVmS7Y/w7k5tAhR0nv+u7zEeMdkow/QERHXwtNOFd6vwbZyIzhp1Vd5ZrdlY9fvvOrSaAhoKcpnpP2jyjcGawpCsvb+mqqMt4DOheFXeuxa9SyhTbCU5oFAFWfBeQ6uStSFUgYSnSYGxM+jc1k/fjbzxuSgzEAOjMbvWuvyR/28JDv0+QM4ih3uwIlLzzH6xWiJ/nUE+AhW3RYFk5X7R+8j6BIC14LP+6VBpY7NsOjdiUZFGKrbne9/PELQ/6Emx4roX0p X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4974.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(39850400004)(136003)(396003)(346002)(186009)(451199024)(1800799009)(41300700001)(6506007)(52116002)(6486002)(6666004)(38100700002)(26005)(36756003)(6512007)(86362001)(38350700002)(2906002)(2616005)(83380400001)(6916009)(8936002)(8676002)(478600001)(5660300002)(66556008)(4326008)(44832011)(107886003)(66946007)(316002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?46WBLzUdSWLcYL7kryvz38wJ1J+L?= =?utf-8?q?qdPCAfg6pOxEQaq2MYBk6+AN5vO1axr0aws1LNr8bRcjoFLQy+446yUzuqJv2TgWw?= =?utf-8?q?FG60nzO0Vr8DNkai3rUvN/H76DdkRRzh7Gv2600Bvk1PNToFFlyitSQOeWa8Bo23M?= =?utf-8?q?IBr8ZcLBeTyvRLherZwt1pmTt+1oF29uUswhJBEC9ESlMzsLlxcBUV8L1/rb/dDaq?= =?utf-8?q?sorVr0nYOMKWQtNHlsj6qZmQjlxID6g4do/EQ12ORU+CKL7bNf89LbaAMmpcgoeRe?= =?utf-8?q?Gm5u81juLmStFwSGvkD1HoKrwXwx06eZNWsZZ4cwTGWXvyOzNaI8aoql60HA88NE4?= =?utf-8?q?Lbh32MYwDSHS1C0rq0piEm8uvQXCQOc8HKEF+sO6axTCjkSsKMUV5qkx3NNu6d9Sb?= =?utf-8?q?rjzKShFQzE+nBMqkTm/6DRzhgrwAyWfocPFORcFPhKMwOs1Mw8ppP2fVvFe2kKoEH?= =?utf-8?q?KbZMay1q+efbtwynwaALZQDcReHyZ5fzCDwQPKdEzV2hz6sijTmtmGgfmX91GWhoA?= =?utf-8?q?Gwxuu5pkHtxvuwmCWVoeSpcTr6KGWSlLcKKTw1Uu1ws9+c7TiTQOF0qwv8QrfjdcV?= =?utf-8?q?unaHj+j6qNfY3WwnwkKXfCYTozGrh5v5vPAQzQWuPFjhhLVT04QnJLV4mob7QMHZS?= =?utf-8?q?VbUPTFfU5g1iX8L7a4FLBOUblVxfdsw8ynGdSclrFH3tlt55ntzJawX0UXEx8DPDo?= =?utf-8?q?+hlqauP4HEeQjUruP0CLB2cHkpc1lDgB+iIdD8NThYG9pKMHH0QOpQbyQn/X6T+nQ?= =?utf-8?q?V3j1xVrklKvJkeGMFX2zX7h73WzB2W19j7xKAVlS0Um/f1/NmIlnWV9ignQnlFQjM?= =?utf-8?q?Na5fpnHBFLfv6DuNPQzDb4lJEJL53k57cxlK7bpHlNaJ6pZYL9RsJvtZmn982f5Zu?= =?utf-8?q?OBpH8K8U/RkdBuLEBoy0h7kdpTmBCyyzvT1N1jgUjnnJGHnmRsEkaSi+6ooxtUtX0?= =?utf-8?q?v7Qwu6qgswyO7hKK4NT7GCHDhQK0q7prVhP/onZ6uyHuQDhKdgRFyCoA4XFNUDCO7?= =?utf-8?q?+9esveA8rjpBhaOECrfOy7PjeZ74Jt1KIozTBwZyb+xEOLQoNpYc7xGq9gMHtupdr?= =?utf-8?q?mvKWLtpR8shnrkOnkUOCSdFwbYz6PZD18Vj0PPyCmAuMJN0JKawKjHUeVlqb66jCb?= =?utf-8?q?kH5NYrlX2Zq8JM9GJ/EMjpI5ona7plnNHbgnBzLAfz7Ht9EOkcBsG1X4UzVmquDba?= =?utf-8?q?RUanlQ2peh2XXI9+MeQUczsTq8bNsnO7oimzlIWzfKIJsh3P66mSiaQdclhTkAz+K?= =?utf-8?q?prfTqUwxlbO4meVCLwPz/JHOixZrPQXAZ1iLkSyIyTER8CNsB8oTZTLLHilF4NWot?= =?utf-8?q?/Nn5w7DEK8TDHj8s3VRzFjolXW3Wg5vQWnJpd2fj+sEZaGGVdoNYxiVnNsGJviPQT?= =?utf-8?q?APqBUxk6gY9VcrwQuvXECYdgxHniF6F7y7/NwoTbC9IiIrH9ZLE8PCuUjCSRRCN3j?= =?utf-8?q?ToU7Id9LOjaHe0DEBfeG65rX51TKqe/5qPd83yRVlD1pGlSpuhu0av2SVkL8oHTuq?= =?utf-8?q?tblBadbL5sqWBDWXFdR44psnZd0aqz5CracvnOKA/QyU+bzWwQLeBbc=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 645c98f7-a2f9-477f-f67e-08dbb5f25213 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 13:47:36.7821 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bWwXTtpu8NFI92WDG8azTnSbQSuE8omhDkm5RqZoFFyUY7mIOrBYrG9vLFY68XrYM5Zz5ljt0ul3EvS/qSWGjVnbgr+RQvM5avrfXvTsWvI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9783 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Disabling the interrupts unconditionally in the suspend callback leads to a loss of the wakeup capability in suspend to idle (freeze) mode. In commit 95dc58a9a02f ("Input: st1232 - rely on I2C core to configure wakeup interrupt") redundancy was removed by letting the I2C core manage the wake interrupt handling. On the other hand, the irq enabling/disabling became unconditional. Revert the general interrupt enabling/disabling to its previous state. Fixes: 95dc58a9a02f ("Input: st1232 - rely on I2C core to configure wakeup interrupt") Signed-off-by: Javier Carrasco --- drivers/input/touchscreen/st1232.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index 6475084aee1b..d0ee90abc293 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -345,10 +345,10 @@ 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(&client->dev)) { + disable_irq(client->irq); st1232_ts_power(ts, false); + } return 0; } @@ -358,10 +358,10 @@ 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(&client->dev)) { + enable_irq(client->irq); st1232_ts_power(ts, true); - - enable_irq(client->irq); + } return 0; } From patchwork Fri Sep 15 13:47:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 723383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EC6CEE645D for ; Fri, 15 Sep 2023 13:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235475AbjIONrs (ORCPT ); Fri, 15 Sep 2023 09:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235461AbjIONrr (ORCPT ); Fri, 15 Sep 2023 09:47:47 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2070.outbound.protection.outlook.com [40.107.105.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A8691BEB; Fri, 15 Sep 2023 06:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W3whhnAF5mLhTdfVesRNd/GgYr15BuI3u/lQ2joCYM5rnbIVy2rJD00a6Tdjm7jB0DGV2sdqR+T0P6Ju5Q2IucYqbQyjcmP4vy38i9X5XqymDiOK3WLzLKgf3LCarmUsGnO92lF254E6r48Ak7O+LgkksLpX/VBsa5+begXyt8su8tlTj77Mkuuma59GoHbnjEEJTl6q2C7yHK756CkiZbgiAC6UTKTva5qyA972hh4ItjOeBbxfoVqS9/3eY1lKxlPpiIcpHjjz43gIzfuq75zKWQ+vHx6u8HTbWq0BD0fKJ89rjG6XI3/5Y/mvTloQIVMIEMMJmLxWyq6nOdd7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LALxW/oAIyxG7vh7eSxOonN+J0b9RaumMYhm7Wjenvw=; b=n7z0w36Woih7aeIg8hWd1jvhxw59Lo4BC0nrXMHwRei2wRu+EB7qmo7PqCYtpVY5Odt42Al6LLOpeQx9pMyFs0PSNHo9mOS3HJ2af11SpOQI4xDpz58GsX1SQs0NwHI7qNvjW0ZmxdQQiwwH0/vNSNXFnI3+yOSspzxJdTO06ZcHvwhZ8RJxtk9hT3RF5YhL8hUx67LlJRG81c4ocCkl+DGQ3fRC1H/YQZeojGyChnW6/96qXipRmLC5X43SGnFiqBfo8pPC748j6CES72fTiWLn7dZN9uc1EEP0cMYNiO9WBBvhbEc/8lDBIDiKJSfHG3lPP/L78nHsyDoyGsNz+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LALxW/oAIyxG7vh7eSxOonN+J0b9RaumMYhm7Wjenvw=; b=uajlXT9m/K3l5b951EYzODudZ1jDMFJSl3WmZaTGdY9bsZlqRuU23BQzZXV+irFt/yYGTfUjduB3whIIyzklWJJbuVkkDAoTN/wkbvbyuep/GRCJYX0AWp5MS5QiiNLDeDzecDjR0Ygjxm/AhVJGpc/2KYlIyZeC28ejitUCoGE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by PAWPR08MB9783.eurprd08.prod.outlook.com (2603:10a6:102:2ee::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.31; Fri, 15 Sep 2023 13:47:37 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bc92:216b:11ed:db63]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bc92:216b:11ed:db63%6]) with mapi id 15.20.6792.020; Fri, 15 Sep 2023 13:47:37 +0000 From: Javier Carrasco Date: Fri, 15 Sep 2023 15:47:25 +0200 Subject: [PATCH v2 2/2] Input: st1232 - add wake up event counting Message-Id: <20230826-feature-st1232_freeze_wakeup-v2-2-29ae9f747137@wolfvision.net> References: <20230826-feature-st1232_freeze_wakeup-v2-0-29ae9f747137@wolfvision.net> In-Reply-To: <20230826-feature-st1232_freeze_wakeup-v2-0-29ae9f747137@wolfvision.net> To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694785656; l=1867; i=javier.carrasco@wolfvision.net; s=20230509; h=from:subject:message-id; bh=o408kdN/AxMKMa4Y2r3gFHy5WAht80gNXp9pdeuz7ak=; b=2pGM2GOIs9OZ9STHxUNzvClhwzeOp6P8fd/aDww2jHScsECTYrCwWU9Xa3ycrpIau3poIe8Dr L+Lsl8WrQNPDHCpR+XeG6CSw2+AjlsGzC3f6M0anIH+0HYZK7nd2qy5 X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=tIGJV7M+tCizagNijF0eGMBGcOsPD+0cWGfKjl4h6K8= X-ClientProxiedBy: VI1PR08CA0233.eurprd08.prod.outlook.com (2603:10a6:802:15::42) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|PAWPR08MB9783:EE_ X-MS-Office365-Filtering-Correlation-Id: f0234497-bb9d-4b86-1b56-08dbb5f2523a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gT2lOEChJfZ4MwsA3hEutE64NaCkYO1giojBSmKw/KP8mIUHj0/f+b1B3u2x5lYf5jCEa10lDghPDZiRu4IvQxjsxmfpkpAyBC7PTQ9JNA8zQYkWaKbIYPk7atU2B4aOcLU3AZYMFq4Xa+8/7n0cSD0UAhCM757t1JGAQKEc/BS+oY2wySfy02nLLX0h74dVe77xfws4ga0yQ6C5b7OkCgvK2W/CsCgjK/BTd9GS2UnMxsyMytGKHnLf331VDr+09PNqO2kMJUQ8JgV1dOXdbZfm7mgY/cayVmcj+yBDeCgWHPVj9gss59T5mbPNaqCZhMQIbIYKfW8pdBSCyp2gte5Aad+g7BXqs5WhN1Mgohi38xtxBmbIQgoqaeGBrQwdPDR8ICiCRi9q3L5xXCxegCYGcnRF6C6nphvcq2tH64L9cqp/5bMPweIPHNz47AAjWCGiGLM9Uia+A8YC5g6OgRgjznTMoKavn8zHGAv04mjiFZNkuS0sKjnLMyQWwL+0iT5NBHAdfqn/mM1kEKLRJ7alKlm5KbYBvfci0QbnVCjrPY2Y0cAzVvrUvOik2tWdL+fTwj/2XMLJNEAqKISFPtWEsHwI3+nUCJM6Kc7pU4P3AzgmVpcE3R0/a7NqcsXe X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4974.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(39850400004)(136003)(396003)(346002)(186009)(451199024)(1800799009)(41300700001)(6506007)(52116002)(6486002)(6666004)(38100700002)(26005)(36756003)(6512007)(86362001)(38350700002)(2906002)(2616005)(83380400001)(6916009)(8936002)(8676002)(478600001)(5660300002)(66556008)(4326008)(44832011)(107886003)(66946007)(316002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Ywdi9QAZx+1KfwMI3av5ylBPIR10?= =?utf-8?q?ZcReWkyVL8xggrgHF/21zahK0nsDgYGy1F/OJv/1I+5L6kKDyy3N4OscCGLiWKKzj?= =?utf-8?q?ZmgEiabOZeDnWUDV9r9Er+rICPQvNqs2cgz3Jk4PElodwKq9KsCN3PfQI+ZorW9J5?= =?utf-8?q?FlS4RU3+LlRLDMWoqaKuoc7Xa7lo0cIuFPANYKy65W9K0sKsBjvoz84KD20Sy6cCP?= =?utf-8?q?XxV5y1OYudfct9Dn2Ac8L+njBA1QecPwkhMVOMekahdM6K97EbAyG4hh1Q/zXFZ3N?= =?utf-8?q?jfd9MB91DaewcSZ0Tg19Do5/5zlwuOn6P3DZ3OtZDFn7HRw26iqJO4Q1AlKbMvtPM?= =?utf-8?q?OjNRt+dvNEaDZLTiYYgdc1ZAB3VatarefJ446GQhM03UYzag3Zg3QcvM3Zz5jQrLn?= =?utf-8?q?AhNmyaOB10j4kcvEBm2jSNdfFnhZq6RxOQ3J+al7OrIIDuj+X4+9d5t09hy557aXz?= =?utf-8?q?ZQV30nHEwljBwMmRFioEWpKwB+xD9Q+oTiTbMGiVmjHPHrEkTvBHNbdHLnVgVy3pg?= =?utf-8?q?oCx3ENmbJJG00cPTsQmIe7TNa/6CQf51Uge7nmmyHbCL6pXDPeVvW0FPX77+2ayPL?= =?utf-8?q?kaidJa8cZR2gp+ntTfEUT0Aj9LzxS59sbDOm7tQVAzqKpB6lEYPSdKLwHwVktwjfS?= =?utf-8?q?TWgtZy9Dx20B7l1hBob0EhmzYdbvQPsWLOZDCHuDz1VnlmVhulkz+Jr4ryQtYseTt?= =?utf-8?q?iLfYSL0b5wV3gnKsrJJoPjeZzvvrfUwsb9AaafYQrhI2BzslJCk7fF784UUJR+2Fp?= =?utf-8?q?idaBfTJf48tSLCBbaUlhBgZZA5pxqtG/Ku66cF+u1hsa01a8QVcaF/76pHaXlMbtk?= =?utf-8?q?Hq4ryPya6xCzAOCbfyBHhoQjLD4jPckC86sGmA70sggsIkm6mg3YBR0YG4qPUzOcl?= =?utf-8?q?TewdSlyTY4OMnRRhv4COsoQkMApQHJfMHt3XQLcJOGOXbV8Xeeqmbq1zuhc4HJgZy?= =?utf-8?q?NTGnhfamBwY1ufYvNadtQ2bhCkmicyTTbdTBPOjkVMCf2/FxB9iLiM1aEQJEgMTtJ?= =?utf-8?q?zIVlqAI3hTsJ1cQZgkUiDMrZI7+LUm30qBQmZ4JUo8eamAhq1dnOW9JeNUg4mi85T?= =?utf-8?q?GDta1CiEtCWp7U/Gn3Pwi6qRn+BJGjXzUKpQRT71bY/YsMquSkw0IgORaWd9v5vWs?= =?utf-8?q?iB7zFQmO4YPlz1B3dNaNGCXIUH7NvirZjnHN5iYiQJIa4ffXXPwOy/8aHRfQT3VwC?= =?utf-8?q?n/VecwSOFSb5E59TN9hwtMfKOc4FSBee+IvXDZdtooDAb+RJQD93WguOUPLlGYKvl?= =?utf-8?q?7k2n0EPoRw5kTbGnLI62adZune9SSiQjRtLX58vSxNDJ9fWDGI8T6s3Mm6G32kWo9?= =?utf-8?q?yvFFWaEr7tRi8G10mcWkeL/04TQrp99HK8NLhD+RLqK7+SKMc2jfYvZo5U/wDZ+sx?= =?utf-8?q?on1VDntYrvjYxCroPqHH1YHH7PW2eNkQveq/0zLRwEceY5t/aMT7+BCrpoYmlVwGR?= =?utf-8?q?oX4lfK3lmZd09k7Jktb1YojBzIqA9LGS+n6qFEZpLLyq9xGPpcNaIMorj90gHSkbk?= =?utf-8?q?llwo15UuAH5V2NFHk6gnhNftHrN8ogr51X3JX4W8UwtQlnX3Lg1flJY=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: f0234497-bb9d-4b86-1b56-08dbb5f2523a X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 13:47:37.0666 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r+haayAeTfl7g0aUZjZSJaVWTTy3UN0LVfEtw90NE4sNbMUFdJKTqYhcVDL6d9i0MtA0Z0QL7mJmTWP9cChomPzVMyrMfDcVOmPyUIfqHo4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9783 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This device driver provides wakeup capabilities but the wakeup events are not reflected in sysfs. Add pm_wakeup_event to the interrupt handler in order to do so. Signed-off-by: Javier Carrasco --- drivers/input/touchscreen/st1232.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index d0ee90abc293..ad18d3944bf2 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -59,6 +59,7 @@ struct st1232_ts_data { const struct st_chip_info *chip_info; int read_buf_len; u8 *read_buf; + bool suspended; }; static int st1232_ts_read_data(struct st1232_ts_data *ts, u8 reg, @@ -173,9 +174,13 @@ static int st1232_ts_parse_and_report(struct st1232_ts_data *ts) static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id) { struct st1232_ts_data *ts = dev_id; + struct i2c_client *client = ts->client; int count; int error; + if (ts->suspended && device_may_wakeup(&client->dev)) + pm_wakeup_event(&client->dev, 0); + error = st1232_ts_read_data(ts, REG_XY_COORDINATES, ts->read_buf_len); if (error) goto out; @@ -345,6 +350,8 @@ 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); + ts->suspended = true; + if (!device_may_wakeup(&client->dev)) { disable_irq(client->irq); st1232_ts_power(ts, false); @@ -358,6 +365,8 @@ 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); + ts->suspended = false; + if (!device_may_wakeup(&client->dev)) { enable_irq(client->irq); st1232_ts_power(ts, true);