From patchwork Fri Sep 15 13:47:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 14078 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1378089vqi; Fri, 15 Sep 2023 16:25:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjX83N+9S2+2HhyUo2eB+F+MrwYFZbcO2+k3aR6kzF2wzlqhXp5pV7ga3ng+NJmoLOv5g5 X-Received: by 2002:a17:90b:1c89:b0:26d:4d1c:5395 with SMTP id oo9-20020a17090b1c8900b0026d4d1c5395mr8609158pjb.18.1694820307065; Fri, 15 Sep 2023 16:25:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1694820307; cv=pass; d=google.com; s=arc-20160816; b=gjdyLWBKwvQu/0rDNqLdSAUyIj6bDcmB9/LObRJIFID+aXtnpFId9zJGGE6aPxrP4S WJZ3p/+quV/kpOnCK9DvX4SfhL/5+SvrEpIisKNgPXaiwtzENCVe2ZqzbXgrjNu6WkUO 8YVTvIgy5lnrLALNHKdzduQHH91cWyr7QLv0Dqbh8btraCRwpb+74Uqwozt/gCxqB5kT htK0ydnNNGa6hCYWd7wyV2w8BeZK5IgqwTH8BpfBrQkoys6DdcY4ywHZm/B4X5TyLSP2 q7ZsvZlZy97z/kCUiQL3luo1cZc/st9ruLQU7o5rQFK7TZS+Pf00yNpHo0vI5/NKLRCY nPug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:content-transfer-encoding :message-id:date:subject:from:dkim-signature; bh=Opds6waEb8sct5lvtGQmWwRkF0ju7yJOrbohF50nuRo=; fh=a8Qb7YIebk0ucpJ+B2DGlXr8ABTshRDxe7IAvR150AE=; b=bRf+HF+/nyk5zYvkoLrZYttz6SIMwLm3ocv5bEEIf2iEfSsrfC7yCHZ4Gp0vazuaHe 4XSKSxFFuRP6HDZH/kY3i1Nb9sLQIBU7cllQ5Vw37YAPEQhi2ES05d7iZVhuaSN2bfXX oKgkkvajq6GZqFj1gAytl2Pw1k8fX25Kviq9+u8ROwPv878X5KRq1ATmbxUm+B2oCzZl FbcZqC1nLRmLV1D/adWrdfsttOnGspN//yYVh/+S7v8LAhXN45xgHmVXU/Kga+RuS4mF D+7tGvNRd1S9fvYmZIt+aS7rc0Uv35GF4gRrLgPAi3om9xqfBdSdyy54KJWWV9F7+omK LMCg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=YWpZ7lpj; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u64-20020a638543000000b0057764b2f3dfsi3840629pgd.198.2023.09.15.16.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 16:25:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=YWpZ7lpj; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AB31582EA156; Fri, 15 Sep 2023 06:48:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235451AbjIONrq (ORCPT + 31 others); Fri, 15 Sep 2023 09:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235407AbjIONrp (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 DFB591FF5; Fri, 15 Sep 2023 06:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KxfCV08bgEC4o/5K6mp7fFiY5HQyukKJ5dwPMVvtNGZYGrzuzsDCavB60P73p1EK6vmhseRhFcTNEOnypY3pSXZm/elpAVX4u4l3RCrHSwOkdyeZsRSpgeJq6Da2ODxgY9XKI+jQvhaup/a2LTIrS8g9/OXWR5hXmP9Z+QXWa1QiAaaud2jXrIoF8z6m5i2oyx/9RidkUcSyX/xJw27jA+OMQqBbYSYz+FrrSrobz9mlLkk3VOrYqxFhvnxym6QRQIzxZ9OlZmBkiLIPdV4bCB43iKelM6KGSL6mKTlixOG2pF+l6STGSYEEv+/dy5KTHPksgA4RBO1Ot93G2MKkxg== 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=Opds6waEb8sct5lvtGQmWwRkF0ju7yJOrbohF50nuRo=; b=kTffYm4S4PVg1n/3+jDCuAra4uX4TKdt8FF4YuBCBFJ41llcHwRc+CpNbPZgymFjafy1iPWIqhS+V0MbP0PpnLziEILGfkN1ZhecP6SLDlRBaZEmTIw+mzEr4hh4Rkr7oH65YWLi0Vu5NW+vgn3ymcnmnX1cJoTYBojY5JAFoDf9mZAGHNgRg8psgToM6v03UYDy4pYrNwYMNHqxIWwod1pNSRAt0Wq8ChOWJ8IiTzh4x1mLMUkZQfPXWEXepeqeIjq02CNwlnXjRGdbVx0xYnVOcrAzemeT1W+RuIviS7mXj7tjuEHACmvBzdzKzldxSclSXi8LfX5kUeWrL6yLjw== 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=Opds6waEb8sct5lvtGQmWwRkF0ju7yJOrbohF50nuRo=; b=YWpZ7lpjF5p4Qwd9qGbuOF3VrMKiIwYETx07CrMAFrH5V4DXhi9v7P0Rw6ssH7wAWRQYi9Ahk8imzLkeAipm7788o08YhFBC/HLhKPH7xfG5DYb/9aG9PzRM/oAssljQi42hVDAuCgErFcg+a6lhq2uI2s+mS6rGrtufblyiUyI= 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:36 +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:36 +0000 From: Javier Carrasco Subject: [PATCH v2 0/2] Input: st1232: wakeup in Suspend to idle Date: Fri, 15 Sep 2023 15:47:23 +0200 Message-Id: <20230826-feature-st1232_freeze_wakeup-v2-0-29ae9f747137@wolfvision.net> X-B4-Tracking: v=1; b=H4sIAGtgBGUC/yWOyw6CMBBFf4V0bUkZSEFX/ochpNSpVElLpjxUw r9bYXnu4py7soBkMbBLsjLC2QbrXQQ4JUx3yj2Q23tkBgJyUYHkBtU4EfIwZpBDYwjxi82iXjg NXEsBZ1kZMKVkUdGqgLwl5XQXJW7q+zgOhMa+9+atjtzZMHr67Bfm7L8etULkGRSlKNMsWivJg T/VbJFSrYhU0P66+N4cn1OHI6u3bfsB8x3YbdIAAAA= 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=1537; i=javier.carrasco@wolfvision.net; s=20230509; h=from:subject:message-id; bh=da5YvR2hX2ppM6RgVFSXd7AleMVl1rIx2CgP/coMfqU=; b=9XbBU3kMH/o33kggB8kUQw/ESMBp/OvpbD0N4MJUY/2YEyTn0ST0H1NP7hIIBmTtQTdiS2tvo 0ZJIV6kK2GTCfWUn0qddA747lRUBV7YGfnabcfZP06rizv1/AfN5MmH 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: c09d9e42-c150-4338-4856-08dbb5f251e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3KjN8cK9DrUiVoOM7h43R8Vka6Y8EQRF6CjDoWdXwhsFYQWPyyqBXefkIRJQFpaocobOP+MLPOjrps9xJISBlZpSKBwqr/lldjD/53eGx1dvZxd0y5tR+MphLSOlALy49eZyMsltDk4jbPcbsydcA2jzKCBKniceJboMXkKN+8bFt34Kbhiy1q6RkO5scgywCia2t8Vqh737KIttZmRL9t+8AYA8p6bGAvVWTDx0VrouOEbk3k93yNlBEKig1QdDqETAQEFu30kWeubUxZjEiAFeRAhZP3LA0JVqfFK4ticmkYRvqvUc8ROgdu7yMeLHvZoNiMzU2UzdcbASUbD4b5Uep5Dv2zFlG74LA6bvQfiOZgFMeLZXzcgGKv4VDwJOatR9Sls9q4iIaXauQ+mTk1c35x46ViLYN5TpDFXhNtts64DqXMyghWX5amrrtoewhr+gpXQTbon0sOju14d47TWS1iOusHK/WO0GuA08KIGheUX+jtavNdEZeW/1KyA9dfyoFuEJolnX6zIQC11taZ9GqJIJMRyVGoPTNmBzaIMbUWRCgAtFBV+DWNltZF8ysSofCojF5EZnWefE5XuUcMq6/G4eqFdfAzCsHRbRi24= 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)(966005)(83380400001)(6916009)(15650500001)(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?Ui2kB3k4lbjbNX3z6QGStKc5ANZV?= =?utf-8?q?sZNnloegU44nn4mZXMTdVuiW1O5Fwz3GIVyULy1yUvWH+m60bWxGnlJznsi3nTzUK?= =?utf-8?q?fFhJ4Y6RJawTMp8U2R1tmyNOm8AkvppdJuGN1EKn1QCVTu3lRFvnfhQ3/ugU7zEno?= =?utf-8?q?eRv4kYxMQAriy5QlI4od9uspp2tKOXn4UV9X5vCj9hm3QT78qfvNNKHhzJntCX3zp?= =?utf-8?q?doxyke3B40fEM+MC4b9BLcXxGy6gIVcED+aWKFiF9ICFdk0xY4TjsN+GH/x4XwNtV?= =?utf-8?q?3HePdrTNzynYq3ApM+FOWIxnsNDktnYqT/0nXA6CUx4FfXmfTTSPIKyOvmowe4vdg?= =?utf-8?q?5PQvfW6MXtdw9SnLPAI9yEeYAmilGdcGEF81F9hxil8V8RWwz9nheKvZmMy3x4yCL?= =?utf-8?q?Uj7GGk8cpiqATCdqT+32ar8+Jr6kPka8dqKZHf2o3mAo50k/Tk3j0ZwmNUkcun6tF?= =?utf-8?q?19djBSlMDvoajhn/r8rJ20/5jGOuVGN01c7dzeotmfcWb6WggwMkgndIZR8wVXlDj?= =?utf-8?q?epfK69w/N1dpyjyoFS+UEUyiND/0bOVgJuESMCrHwPht3cJi3NX3nuw+/5BunI89L?= =?utf-8?q?z5UeWsQBRQd3AIGZmtGy2odosVESFr6hkIgPlYm98sFhgqJ7j0dqssGNAJpF7PuXP?= =?utf-8?q?Kv5yg0qZHUmI09wbYGUUt18tJ5ADzOAqW21NQOCM52jvuSA7aDT3x1Yz4gw0I4PX/?= =?utf-8?q?G3YI3dW8bW2WUmn5EnnVnrWpjJaQ3CDLMY+h4FNtUDPAX3avsII4Gq08LRf65n7CJ?= =?utf-8?q?ifkMB6LNYLrl3d96tG4+CFNqUHUELW7wNFtQobNXhW/wDJfQICXOoMOKPbexLs5kd?= =?utf-8?q?gXmobrg/VWmoNQ1yp6Q4toBeb9/13DgH8jS9LL/YZgGtT1qNSmCddGzPJzf9JL1ew?= =?utf-8?q?rWs4vmvfayxJZDAdFC4gbL8Nrr8rN3zqtsfuqbjsJy5bvQRzPAj8mUTrHRfnWQr3T?= =?utf-8?q?gX7gArNrxjBfRsh+wlYGCIBZ9pS+ltWj2O2iPeFe6FSuQHvf1FmGuAJhjamm1esdq?= =?utf-8?q?Xj0deLQu8cEDNBFxzD0vF9KQ5fJF81WvlIhpE7CR91zr2HjlutVi9Jj7Rh/kAtFQJ?= =?utf-8?q?gIuid3v8zj3rmj96fEc9KXUXqh6/WwyQnxfeRNBR/wJVfpM1ZfpyN0AKz2MAKx8wF?= =?utf-8?q?64BbAbslVTIcNj4TKjWEM0M2w+iFiEbpK0bqecTjZTOFtjiwmfmxsm5gGIR6RS8ed?= =?utf-8?q?+p33MDh+mavSnpJvTJO9P4lcD/9MqqosZ0yBo5hAtpO7D+4miIF1YccokOAXnmwcb?= =?utf-8?q?cmHuQG28LgNU9/R/ioB8qcR+UNcj50ez3nJoad7GjqSuZ6jKMLOda/LXKPAOdrFK0?= =?utf-8?q?VdhNuC4PrBMZPnTyNyzEt32i42htImdXzOYmHWAXPsX2lQtPg9YWtde2ya+534IAw?= =?utf-8?q?9OjMM2cUw7mqtuSrYpMHAvTGKHPOKUxUTHb0WMjnOAspUsFE9H16xAWYjg6tR25sj?= =?utf-8?q?jWIer8VJJ3fgywljZfljkVqrmsKxuJvKWeQdxKdQDvQwQvg4MJQiIbyexafWsJ3hH?= =?utf-8?q?mV4FCcFkNes+9t0SnazvpGG39A5IdvJBK7LovcYD8vG2/7icdx85qpU=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: c09d9e42-c150-4338-4856-08dbb5f251e4 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.4972 (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: z4pKmfnm5opnBHpwSa5eJOMsP12E3u41amij2lpv0lWxT6jWVggnntpTXFCtMt6LQlSftzXTju5q2njBTtq4nkMowWrcJSveasu020J/mxQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9783 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 06:48:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777147898619965999 X-GMAIL-MSGID: 1777147898619965999 The st1232 touchscreen provides an interrupt line that can be configured as a wakeup source, and currently it is possible to use this mechanism in "Suspend to RAM" and "Hibernate" power states. Unfortunately, that does not work in "Suspend to idle" (freeze) because the device driver disables interrupts in its suspend callback unconditionally. Partially reverting the patch where this modification was made to disable interrupts only if the device is not a wakeup source has proved to solve the issue. Given that the st1232 device driver does not reflect its wakeup events in sysfs, this series also adds pm_wakeup_event to the interrupt handler. These changes have been successfully tested with an ST1624-N32C and a Rockchip-based platform. Signed-off-by: Javier Carrasco --- Changes in v2: - PATCH 1/2: enable/disable irq if the device is not a wakeup source. - PATCH 2/2: remove unnecessary mutex locking/unlocking. - Link to v1: https://lore.kernel.org/r/20230403124707.102986-2-javier.carrasco@wolfvision.net --- Javier Carrasco (2): Input: st1232 - remove enable/disable irq if device may wake up Input: st1232 - add wake up event counting drivers/input/touchscreen/st1232.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) --- base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d change-id: 20230826-feature-st1232_freeze_wakeup-c602968f2f76 Best regards,