From patchwork Mon Apr 3 12:47:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13198151 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 17B4DC761A6 for ; Mon, 3 Apr 2023 12:58:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbjDCM6B (ORCPT ); Mon, 3 Apr 2023 08:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbjDCM6A (ORCPT ); Mon, 3 Apr 2023 08:58:00 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2054.outbound.protection.outlook.com [40.107.20.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 543A71702; Mon, 3 Apr 2023 05:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y7tOcs06LvCcIDiCUzFgm8tK4VOShTSPNObhlz+PQB18fyruObksoFSqK+IS7N1CTy3apG4qJ9vShFQzVIz0cM1C5satOkvEt6lWyDHFqUNu1C0Y/YzLQGpKxy71xqgeHhjm/3on9u9O5qSPa19tWmf23C+iul55d3XMdqTQj+3Du1pX5O9WcV9FruhGf1g5zqQvKPn6kz5X7su4ONXhGSy39jHG/GzCfiPyrSIm/6tzzmj0WrWSdZZy3VXgAAd6r+owYQkk3jqVAiPLkhaUcPZpPWLe4GgqYK9RstfNML4qMmjsTROOt7kai2Oww2WOc0dAjt+exEEL03+BaxuC5A== 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=tsReSqbomdhlSTsl75jCknV5AXC8jBXZHUE6qng3+QE=; b=nIU76KtW7q8kVWmDYBdYlJKND44B3gj9czX6ToCYyEwn/REbEmWdMC79kv0KFel0b+MhS74reBnWqmuHPddBeF+8lBoTlV8Ji3vbRYABoB/aAk5gMjYQ/wwJ3Aqx9rg6WlIb+tw/ZENdGRj8+C/4K+U2kChnbzz5th08PQ68OnsDumMYIEtiYCaCxC9O25CQY1YFBfw1KXZp+VrVrpyq57LWAi9lHnD2so1BPfii6K3lNRD0eqx1OHznXiBmHBeYPa62vLDHtoFwCeYeVT3syxI7Pxlo8GEaJrnQNz06TQ/y486U8y5A0JAyvu3HB/D6P/fREcHngEwfZYDLj9Rffw== 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=tsReSqbomdhlSTsl75jCknV5AXC8jBXZHUE6qng3+QE=; b=NkUjMo04yzICc5juIkPseCXBhEzU0d+WDiMA3fRh+1y1wcyErY4ApGPdhBGUW6xJvg5N4A6vE3GOOvBuWvy8LxX6vHdPQJQExjes6kw+l62MUZ+y4vx52eMFN/kNIU6UxGy6xKrUQoC91k0cRkM6pR7IR3zhYkuUmrRaDTy9f/c= 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 DU0PR08MB8787.eurprd08.prod.outlook.com (2603:10a6:10:476::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 12:57:55 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::c445:c8e:be5d:d40e]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::c445:c8e:be5d:d40e%7]) with mapi id 15.20.6254.033; Mon, 3 Apr 2023 12:57:55 +0000 From: Javier Carrasco To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov , Jonathan Cameron , Linus Walleij , Uwe Kleine-g , Michael Riesch , Javier Carrasco Subject: [PATCH 1/2] Input: st1232 - remove enable/disable irq in resume/suspend callbacks Date: Mon, 3 Apr 2023 14:47:06 +0200 Message-Id: <20230403124707.102986-2-javier.carrasco@wolfvision.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230403124707.102986-1-javier.carrasco@wolfvision.net> References: <20230403124707.102986-1-javier.carrasco@wolfvision.net> X-ClientProxiedBy: VI1PR09CA0055.eurprd09.prod.outlook.com (2603:10a6:802:28::23) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DU0PR08MB8787:EE_ X-MS-Office365-Filtering-Correlation-Id: adc6e349-9607-4bd7-5eac-08db34430a3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YlzYqrU0rcv0EJmq47bVVVRJAufhGde1ytCcMriKaCq5uAKk1gHzLOF+oJxnPIIw6irhXx6ZymlHUMdzktfFbYwf7FFafEn6Iqazx0Ydw1mbJJzxilLudeiqJDE7OVvNJdOsVpjEoI/mhT9WyFhTK4kUTF6zPl52mlI1BI2JcwRyE71BJJRHAL9px9thlMk0ODTBC6xMGlMNgx9a4bk8s3JXb3iLe4udERz9dYhKHj4tUp2ZPmz7dTB8mZQpzbryHygefgtiiLSIFC9f3IoBGnXmC0OuqlWZk8nMU/05ugmPQ/y2gy4N70E8prtW74XWQBiBQihpno/K+loqz3NJspJzfgx9VGjEFhg+5zNZGBJO6rDvym4o/n1o81S5Sj9jTYEWpJPWwWrbEwMOEgNlBkPCtc/Euij1ekltW+i9HC5rXN6zPITol2fzEEigaeHv9q0iu6nl8M1hulcdEBpOMKz58KhH2I/iXjm0FYuiro1KJ4jZqgAR4CCqWDw4q8XFD4iP7lWHhweHMq2FDi+l4piaqwLxc/RE0d3xicIXzo32CcS0I74AN7UYlSSOiIQj5BNNHNTvSzVcSYPpoKV1QwJiASCktDePvYlsgCXs0QDFwaaWec3DHOgIl4dDXOLJ 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:(13230028)(4636009)(136003)(346002)(396003)(376002)(366004)(39850400004)(451199021)(2616005)(83380400001)(186003)(52116002)(6486002)(6666004)(478600001)(316002)(107886003)(6512007)(6506007)(2906002)(1076003)(26005)(54906003)(5660300002)(44832011)(15650500001)(36756003)(38100700002)(38350700002)(66556008)(66946007)(66476007)(41300700001)(4326008)(86362001)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 07GTsrnvQqYA06irfaAfRg/zoKQjoSUbEm1/xFOVveY7z37FSZc9gu+sY0GsCgYIVcPSB3g8fk6T2s0S8w0hBYI/h2Eqaskns4lT8aWU/2ITgmOsevvbRUM/+a+eUBmDXvEvvVbem+bANtNu20G/jpBR49q+8uR+VE7/Azxj+Ao1XYIyeQLdDJBW27yoEi5SowjE/3JXml8jKXO1jD/qPaO4tLIbMHCI0cZjmN1cjN0AI6v+KowMVBGxJFkKiZ8TIsq6JH1mz9lhmhN5gKIhS+fgvTm7+lYojwZqApAsSTJ7xUUejhMNYhnSP/rQ+6bYG0z1/uFirPUIsTDAfPFsyRL2karfsc6BWaFeC4E4OuXM8Hg967KC3L97mdoEN8N86IoaL1ixSG106ip7xKgGpWeBLI0g3lhXCLhpCv32z+YycXZE33ZbTacPlWzGLy2cI8yYQ4T6N983LNGq/ZEpDPINQyhHoSEWRr+y9vpIKNxl4bBTcZ5p26tp5aZgEM1BaiO3PviIckBHDL9rzhDdCD3+dWC26EO5uwqYLmzg8l3xNYlkeO0lI6x0RfujVpIJGiHH8lpgG4WpMcf0glv5o/j6P1K5FLKTJXIZyuGXO0vsdyncoQNPVj/81SEHfHx/fdaJWhE3nQn5IPCKowRkuClBZ7hUkgsiwxzIrZP6ZDK8Idtss1hZ6QUK21BeP9OcmSTUbuc+EyHvYdiRQGRFiIG5SqdU7cO5tUcUKxYjw15flPytdeY2svQNN/mLJGQZjETPVf4pT8PMKAtKLQF+zhEOu/PxMtTqWk1EDBOuYOAzT+UXhTFfSp7wtetqIoFYIRA5LYXXZT+tLRI45MveSgKGwjvAEB1V/SAGzq82zyHyHv3k7jDYWVuIGnSFGfJ/pcw4lSbI98AzmLGLrKqPnW/GJmYICZdxH1MrgPgqiHhQ+JlQJi708mRWMKtp0xyrZqV86lMlvZDX6cF/9qdnXsaG3PvaEwKDXRNtd9GiZHSTtZy5uravpsnzDoTieJNudAFvHlSazxD637HjRC59jsJVOOA4A4ehjyby4ntT5QVPh9CIJGmIzNE/zJJPjxttAUhecjpYyyanB5rSms+AUhHoQ8FsbbD8av2olI3qF93kVGXaBTBQ1/lRe34SNUpxgJXPopRt0ITnTrWeyJF5CA1Foua+YhZCMdo9+48gEbUw9fkNiCS3zX9Xw9zNw3si0Cj4H5rIYDAQzyvM1rXCX6elBd3rjfhKt+NcCmFaCfMQYFJSAlvU1kSnEgTGVLXVouWE+OP8r4lQin8oN3ijYZvcHn5tGtQoQDdW7Talof8+FAQ9wdZFfi5hDue3t4TunYqaPssuTXX7wT2AbmbwQOX93WIKdnOJ97Wtoju+l/ishdMfLVjWgqHpAQUeFjuJj7FhYjmuapgbWjODyOom/qVLIlBx/YO9OoZmfJnQ8dunSPbBJ9nptEQvMidZ/Dh7vwMI2FEU35oD6/Y7hrhemHAamrcBq4youMj9ROL+inII6qsZoJ4K2lzY54X94eeqP81jCulrHUKQZzqDJMmao4rpFsUK231VHtq17KP7/VkQqrmtMDyncdCsNTAVkzkMJq9gkGzHZutd02j0jVKzRpmAJZb1KgVjKBp6dH8oZto= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: adc6e349-9607-4bd7-5eac-08db34430a3a X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 12:57:54.3303 (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: nVt1ITvfSgiRBdWy2FjPzC4TXW0KOIrpyRgmzlpuNcTZsEtECj7ZrnwmHGUtw4VWxTo7PQBWw4367gEBicbzw/Sd3SNewcUISgY4r8pzbhQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8787 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Disabling the interrupts 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 was generalized to all devices, regardless of their wakeup capabilities. The interrupt enabling/disabling is carried out by the power subsystem in the resume/suspend states and therefore there is no need to manage it in the device driver. Remove the irq handling in the driver-specific resume/suspend callbacks and rely on the power subsystem. Fixes: 95dc58a9a02f ("Input: st1232 - rely on I2C core to configure wakeup interrupt") Signed-off-by: Javier Carrasco --- drivers/input/touchscreen/st1232.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index f49566dc96f8..faa0be3993f4 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -345,8 +345,6 @@ 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)) st1232_ts_power(ts, false); @@ -361,8 +359,6 @@ static int st1232_ts_resume(struct device *dev) if (!device_may_wakeup(&client->dev)) st1232_ts_power(ts, true); - enable_irq(client->irq); - return 0; } From patchwork Mon Apr 3 12:47:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13198153 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 9B834C76196 for ; Mon, 3 Apr 2023 12:58:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbjDCM6E (ORCPT ); Mon, 3 Apr 2023 08:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232112AbjDCM6C (ORCPT ); Mon, 3 Apr 2023 08:58:02 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2054.outbound.protection.outlook.com [40.107.20.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B472D5B; Mon, 3 Apr 2023 05:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G3gUdnz5M7JvEcqeVupFfe/TeM3sYZOwy9xRSyvNGpX2enOm6P/tDK5Bbq9iPPuNpmTOWRYkLFK7uC2MJ/5zidndKNyBkgRsAZ+Yi/DEMtYsPy0geAUgAfwR7DLj8iVi1hRjk90sjUEAWwmc9HjxvWTOffFiyUMfIboq2l9su9cyFEVik4wwIfmTLPGxgaUNnGFuw2kLgDyutuJeYWNTlnROUe6PtZdGUpXZ8UEtF2m3DdgBcYYmgk4IdtLq9J6EQn31GtC8LUQgqZAo7kNfeNgwtrUXCyNVOUdf8GpPXa/ZSuuNQIz8vQ6OelggnIeVHWQ5SjQo0i+f982BPngjHg== 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=WDh9wCBQDptbMEgYwpXyRzx1UM6n36KRCOxfPDjgK9M=; b=d7SMXvlw3vg+niaGgUEhOobJLqkk40moM9sp5mcIxxag2SYGzI2ifnzhN9fNSnXnAV84X8An/oIn3cpBIqRIGgY4/MUsX3OcY5TTJ2ChnJjuhKlzIaHP3iUkbyNkhzXmmAwWt3vTEtSoqWCcJf0siEXvxjDYwZJEra+ynmiL3eKXhK1WuOoE1TEpFxULmQPs3GV1/2UpQljt44jYx0x10lUPpWQ0hSF7WUHu0rbqebySklWlWfhPNWzDhXrVcXFMNkQQ1FSJ7jZ5wKOLvNaNtoeoeVSnELS7AFFFmpDkRIe9BVbmz2Y8YbIeHZUO/18YJa7aYDqSGxL9WdLeaazBtw== 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=WDh9wCBQDptbMEgYwpXyRzx1UM6n36KRCOxfPDjgK9M=; b=zIF2OWGVNiT8xyQ4b38ZLircqshlZ9BC/uCqkxJ9gLYp8MkIUlUtNp22gAPLyLCYwK8v1JBT2cV7rSqoAY7ey6xajiMpaMlmmVgdyONp3/zeT0SW3CWvA7G98CitEgSZmjMA5csYrGhN9QCGKUULCqTIyDf3SSOGXkT6kaV2b4s= 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 DU0PR08MB8787.eurprd08.prod.outlook.com (2603:10a6:10:476::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 12:57:55 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::c445:c8e:be5d:d40e]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::c445:c8e:be5d:d40e%7]) with mapi id 15.20.6254.033; Mon, 3 Apr 2023 12:57:55 +0000 From: Javier Carrasco To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov , Jonathan Cameron , Linus Walleij , Uwe Kleine-g , Michael Riesch , Javier Carrasco Subject: [PATCH 2/2] Input: st1232 - add wake up event counting Date: Mon, 3 Apr 2023 14:47:07 +0200 Message-Id: <20230403124707.102986-3-javier.carrasco@wolfvision.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230403124707.102986-1-javier.carrasco@wolfvision.net> References: <20230403124707.102986-1-javier.carrasco@wolfvision.net> X-ClientProxiedBy: VI1PR09CA0055.eurprd09.prod.outlook.com (2603:10a6:802:28::23) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DU0PR08MB8787:EE_ X-MS-Office365-Filtering-Correlation-Id: 83c3e5e8-7220-4501-0ca2-08db34430a6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OTE1PftioMSab64ep45+MV/3001mvJPZd6bfTO/ZCBUwLMCl4i1o+4WqX9eC9JYyss92ab3P+ICClzi/dp8oTmHUHIL9q1+lzSR6/XwrPY8k3677PxjQuE2ipcj9cBjuQ7eOIlWiddaV55NDLqblpDfjsYDnhobr0vI2Qr+nh1yjQ8wJWyKL/gDcJvDmagmJbK4obfJ1y02U7hCihQIQyCsdzWhQdbFsyjyfbOlcUwEfy965sFT7UIIShNg1Sb44S3/dcLVQjrnAxKUyS6UCjt04fGOrjGPfQlQGpB/xpegCMQMqHqicyHtU74Q3FSNdPSsiIpUxkXy5WJyzEX18l6lH9Qm0JEn0dKZ+uo0JffOboZgiaHoqE0AL/GHxF98StGSJ/qKeJdTTtc/XhbkDYr8bRvvoZu2gOdN7+tz672K4TypU3ML5JVMeAdh7Qizj6qR9qTVF5IPzFqaWI/qPLU82V3kmgjrdggbHsWhi3V3/w9rLplBsUJFL6irXCU7KJPj6DDhHZN23Pi6/zLtURe1jUWXSX7kvvdmeOSy6Uf7+/vNCl/FcwQ9lPYNZszWawsuDx/N3LINk+N3RC3WB50WwDekqwmBb5BKOR3T7hQjPf8q35tMTL1x1YorUOKFd 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:(13230028)(4636009)(136003)(346002)(396003)(376002)(366004)(39850400004)(451199021)(2616005)(83380400001)(186003)(52116002)(6486002)(6666004)(478600001)(316002)(107886003)(6512007)(6506007)(2906002)(1076003)(26005)(54906003)(5660300002)(44832011)(36756003)(38100700002)(38350700002)(66556008)(66946007)(66476007)(41300700001)(4326008)(86362001)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NYgfO9Rdl4hSux67zqkcOlJNPMj+Iq7EhkyPHa81Aa42oCQ2/F5+CLQvi8LJqCe9qLYiBcM7clIDSxAo0oGuOvvtfcD5L4EHFnpNSUq3kVSG7cOw3E5XK0zSGShbs+WSCkhCsP5Z3ZsyUq9HBFEerrfFc5FgvzgIQSPIhUx+ueVDWIMRkqwF33V+giHo35R5Cmtt3bsQfmPflKCSVaqjx8VfwiiWHhdN89M9V96yZDtXcIu9U2meqlEAIUGWM4RNRep4It2UBfKR13C/vc19xwu8oXKTvWUFzfQWh+WSmI7fWWVTovJgMr0MgIIJnjlwOKsxBUUOypkzljtxHecC8sR0tR2IpVZUJh8r3BPt6bRhCzKRyXBs+OJlN4t5PuKbtb2MFk30rZKyb9wrG5c474cKC4mdtKruAGrg4p03e5Kp5Lu5mB5//AZaQC6OMfGodxEw/2hXp+qLFbCSh/buzzLvNhpbEpTwF2zorifym234PUr+B8BTm0pUp7IO/0lmPu9xcbt/9eAUzg9I9aKTlhs9oney4TYizo9FGl8EHW65jPO5XHnnOXN6JJgm4+cmja7Hv1TKAksxspDqem5gTnJKU93KzM71FhRyslS/qECL7twoVD9SFs3OdscTfUjcWXKUs+9tdfn9RUFB16QmN1LHQIBt0Te4W0DZab05kZzcVQ/fsT9+pbGXhmGPw/esJ5VUoNUXgzt3q6uARXzbOp4hEDVELdhrk8uQuudhXHYPDY4MOJIbIt16gP+QxMhjsmi/6ewcrIPMRmcrYH1XpFRLO+Hrb2nkjZIVcP9S+aT1YMXdteoD1BQNSDTIxaph+SWMqYS+NKVqmHI0JBCi9gIgVwQU432evAPv/stxNtt7SMkR0H4MERQ8fLZ7/YrlL9y5s+D8/WWWeORxs0ycrN/b/dHJVTEE8kHaRMx0GYI5REXYE3Qyii6EPugRcs/Js4mkMKS9gR92G1BvnwWtrTg4WBzBKSpLfqxC+TQU3IiGM1/sujyqwR9zujtga75RHNyc1ApLR3zkwurANRxMc46LrxB8K6p+E+SdFR5xbBwTRFvpnHyhvxZOlW7crdrxcAohoTzKT5V71p185+PgjZjzXvd7SxZ7E4jInU2m+EKKhevB7QFINWE/1W50JUl8noEYKcTlKLH0Ae1L5SAA+u3Jn7HWpRWBQ9Zcjf4zB19FxLJG5KHCjuQfy9FU4XzaUGipycPT3LEw0mgi5O95ItpRBkND82Mv0siY2dt81B20/RA/BT3iP/o5rldtXCYE4+xPMOp1GljCGGr8OMuBXZWi0YeTs55iHeDX729vOHJsBuJ4AphYmxHMcoOZ3c3jwOByNVTDY6Z/5OIcGmxX0FTigEZlPgejLnzEhuu3qMIesVYFJ1XCKCbHjeX1FUtSLihj4PAyCjZdoQC0DAicohthIC3nxwEL3gG+rSKV0C71QqyYg7EgZcH/u5iPip9FhGAWeXFmHcWtq+8XaPcBcHsmJoxIRs4++aLr5kDKg9dWfC8ygnyeCGt4pZcXOoCSj5FaTyDEkFxqvwhSRccf1m8ox0XobUEliOifks8ZjZ/FrLsUtgFkPj7n6x65m6snYDafsUUpfIE5gtO0ZNnHjkmmaD5iP9RoWati9ByhBoQ= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 83c3e5e8-7220-4501-0ca2-08db34430a6a X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 12:57:54.6478 (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: OFhPTwArbspZhFs3Fu+GYt9JD4mqGs5TNIRL+cc/g0CO8dLrh7A7W8gX4rgdVJtHANmBJoUXivbiZokYN2oNWXepFDoy9/qijCBkg4SxyTk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8787 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index faa0be3993f4..f175bea464e1 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; @@ -344,10 +349,16 @@ 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); + struct input_dev *input = ts->input_dev; + + mutex_lock(&input->mutex); + ts->suspended = true; if (!device_may_wakeup(&client->dev)) st1232_ts_power(ts, false); + mutex_unlock(&input->mutex); + return 0; } @@ -355,10 +366,16 @@ 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); + struct input_dev *input = ts->input_dev; + + mutex_lock(&input->mutex); + ts->suspended = false; if (!device_may_wakeup(&client->dev)) st1232_ts_power(ts, true); + mutex_unlock(&input->mutex); + return 0; }